Hi colleagues,
One simple questions: I am operating in 4h candles and I want to open and close operations at the beginning and the end of the bar, regardless the outcome. I think I know the answer but I see ackward results in the backtest.
Example: 090000 bar.
IF time=090000 AND my conditions THEN
BUY 1 CONTRACT AT MARKET
ENDIF
Now, to close this operation at the CLOSE of the candle (4 hour), shall I refer to 125900 or 130000???
IF time=XXXXXX THEN
SELL AT MARKET
ENDIF
Thanks,
Juan
Time refer to the Close of the bar. Code is only read once at Close. You can also use OpenTime which is the time of the bar where the code is read.
Nicolas,
Thanks so much as always,
Juan