Price is X% higher than a particular intraday bar
Author: jedi2wlp
Creation Date: 8/21/2017 5:45 AM
profile picture

jedi2wlp

#1
I was wondering if I could get some help with tweaking a pre-built rule. There's a rule that says "Price is higher by X% than it was a number of bars ago". Does anybody know an easy way to tweak the code so that the % is based on a particular intraday bar?

For example, rule = price is 0.5% higher than the 10:45 am bar.

Any help is greatly appreciated.
profile picture

Eugene

#2
The rule does not lend itself to be "tweaked" easily. So this example should do it:

CODE:
Please log in to see this code.
profile picture

jedi2wlp

#3
Awesome, thank you very much Eugene for the help!
profile picture

Eugene

#4
Glad to help.

Note: If you're trading only in active stocks guaranteed to have the 10:45 am bar you might want to change "false" to "true":
CODE:
Please log in to see this code.

Otherwise, the code falls back on the first bar after 10:45.
profile picture

jedi2wlp

#5
Good to know. thanks for the tip!
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).