It’s my first post. I’ve played a bit with was shown on the video tutorial and now I’d like to buy after 30 seconds from an event. How can I achieve this task?
The event is a green candlestick.
Can you help me or suggest what to read?
Strategies are executed when a bar closes, so to be sure you enter after 30 seconds you have to launch your strategy in 30-second timeframe and, when the event occurs set a avariable of your choice and, based on that info, enter the next candle. Roberto
Thanks for the answer. How do I recognize a candle has started / closed?
It’s straigthforward. Simply:
IF close > ..... THEN //close ALWAYS refers to the currently closed bar/candlestick
ENDIF
//
IF close[1] > ..... THEN //close[1] refers to the previously closed bar/candlestick
ENDIF
You have to use a number within brackets to refer to some bar in the past, [0] can be omitted and refers to the currently closed bar/candlestick.
The bar/candlestick that is being opened and which is the bar/candlestick when your trade is entered cannot be referred to until it is closed.
Roberto