how do i limit one trade per candle because i have a trade that was open in a lower timeframe and it close for exit reasons. after exit, it opens another position within the same candle on the higher time frame.
thank you
There you go:
Timeframe(1h,UpdateOnClose)
Bar1H = barindex
//
Timeframe(default)
Once TradeON = 1
MyBar = Bar1H
If MyBar <> MyBar[1] Then
TradeON = 1
Endif
If MyLongConditions and TradeON Then
Buy 1 contract at Market
TradeON = 0
Endif
should the tradeon in line 10 be equal to something ?
It’s a boolean which will be equal to 1 (true) when the barindex from the 1 hour timeframe is different from the previous one on the inferior timeframe.