I've tried to develop a strategy with tight stop loss and take profit, it's possible that it could open and close a position in a single candle, but not sure that backtesting is working as expected.
go_long(): timestamp = 1, price = 5000, buy at 5000, stop_loss = 4990, take_profit = 5030. During the next candle (timestamp = 2) the position should be open (a market order) and if the price goes to 5050 the position should be closed before the time of candle close, isn't it? (and next closed candle of timestamp 2 could be : (high:5080, low:4995, open:5000, close:5050))
Are stop loss and take profit orders sent immediately on the exchange?
Looking at the tradingview output I'm not sure it works as expected. What do you think?
During backtesting the close position (for take profit or stop loss) is calculated and triggered when a brand new candle has closed or trying simulating the process of candle creation too? (I'm not sure I've explained myself correctly ...)
Thanks as always