The problem here is that if, on the upcoming days the bulls take over and keep breaking new highs, I will have a chain reaction of alerts coming off.
So, in order to prevent that I'd like to put a TIME GAP, between new highs and new lows.
For instance, I want to make the indicator to alert only if 20day high/low is reached AND there was a time gap of AT LEAST 1 month between the previous high/low.
Can someone help me how to put the time gap?
if there are no time gap, is there any other way I can make that happen?
two more questions:
is there a way to exit/close my open positions at a specified time? like at 3pm.
I could only find : setexitonclose.
lastly, is there a way to set a limit order NOT on close,at market, but rather something like previous 20day high/low?
Thanks.
Code: Select all
if high > highest(high, 1560)[20] then buy ....
if low > lowest(lowest, 1560)[20] then short sell...