A mutiple entry-condition
Author: topcat77
Creation Date: 9/23/2009 2:39 PM
profile picture

topcat77

#1
I am writing a momentum strategy that precludes long entries while the down-slope of
the lower Bollinger Band exceeds a specified gradient. An ROC function defines gradient:
CODE:
Please log in to see this code.

CODE:
Please log in to see this code.


And the script command is:

CODE:
Please log in to see this code.


Simple enough. However, even when that condition is true entry is permitted if the relative gradients

CODE:
Please log in to see this code.


between the two series (rocbbL and rocbbL6) is less than a specified amount, say 0.75 (essentially the rate of decline has slowed). So it would override the previous condition , that is: “ even if rocbbL[bar] is less than -0.11 but RelGrad is less than 0.75 then signal counts” How could that be scripted ?
profile picture

Cone

#2
Use the OR operator ||

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

topcat77

#3
Thanks Cone
tossing this thing around in my mental salad-bowl I missed the simplest way to state the solution
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).