Reputation: 368
how to enter a strategy at the bar open price?
when i use "process_orders_on_close=true", the strategy entry happens on the close of current bar, When I use "process_orders_on_close=false" then getting one bar delay to enter the strategy.
I have tried everything following changes but nothing worked
1.using ">=" or "<=" when the price goes above or below certain level instead of crossovers or crossunder
2."process_orders_on_close=true" removes the delay but the short entry/ long entry happens at the close of the bar but i need it at the open of the bar.
My problem is same as below mentioned link but none of the suggestions are working which are mentioned in the link. https://www.tradingview.com/script/Bi3j0E8Q-Help-needed-with-strategy-Entry-is-off-by-2-candles/
Upvotes: 2
Views: 3111
Reputation:
Your indicator that is providing the signals for your entry/exit waits for the candle, that caused the signal, to close. But that is a good thing because otherwise your strategy would be repainting.
The strategy would enter on candle open but when the trade goes bad and the signal is invalidated it would delete the trade it just made from the trade history like it never even entered a trade there. But sadly you cant just take back your trades in real life when they go bad.
So to avoid that from happening its good to let your strategy only enter trades once the candle that caused the signal to close so the signal it gave cannot be invalidated anymore.
Hope I didnt explain that too poorly haha hope it helps.
Upvotes: 5