Hi, I've been lurking for a while but this is my first post here. Thanks in advance for any suggestions/help.
I am trying to write something that is very basic yet I can't seem to find the solution.
I have two conditions: (1) a high price and (2) a low price.
I would like to say the condition "Downtrend" is triggered when close is below the low price and remain "Downtrend" until close is above the high price in which case it stays in "Uptrend" status until the close drops below the low price again.
Thus far, I've been using very basic IF statements but it will not hold the "Downtrend" or "Uptrend" until the next trigger. It only holds these values while the initial trigger is valid.
Has anyone coded something like this? Are there any indicators that you could think of already in thinkScript that has this logic that I could look at?
Happy New Year! Thanks!
Ryan
I am trying to write something that is very basic yet I can't seem to find the solution.
I have two conditions: (1) a high price and (2) a low price.
I would like to say the condition "Downtrend" is triggered when close is below the low price and remain "Downtrend" until close is above the high price in which case it stays in "Uptrend" status until the close drops below the low price again.
Thus far, I've been using very basic IF statements but it will not hold the "Downtrend" or "Uptrend" until the next trigger. It only holds these values while the initial trigger is valid.
Has anyone coded something like this? Are there any indicators that you could think of already in thinkScript that has this logic that I could look at?
Happy New Year! Thanks!
Ryan