3

When I enter a strategy.entry position, when I look at the graph that shows the color change for a condition, the actual buy order does not execute until the third candle of the color and vice versa when selling, i.e., it is the third red candle before the sell strategy is executed.

If I can change the color of the indicator in a plot in one candle, it seems like I should be able to execute a strategy.entry in the same candle.

Any ideas on why there is a delay in the strategy being executed?

Yoyofanusa
  • 31
  • 1
  • 2
  • Without a code example is hard to say what is wrong with your script. Check the TV's execution model explanation - https://www.tradingview.com/pine-script-docs/en/v4/language/Execution_model.html#execution-model. Could be you validate your condition by the candle close (1 bar delay) + forward this to the strategy execution (+1 bar delay) = entry is delayed by 2 candles from the signal. – e2e4 Jul 26 '20 at 17:03

1 Answers1

5

Try using process_orders_on_close=true in the first line of the strategy function. You can take reference of this link Help needed with strategy - Entry is off by 2 candles. Even if problem not resolved then the possible solution is to make the exact same strategy in study.

Gander
  • 1,854
  • 1
  • 23
  • 30
TJalam
  • 308
  • 4
  • 16