Is it possible to a place limit order using webhook from TradingView?
Otherwise TradingView firers market orders on candle closing bases.
Is it possible to a place limit order using webhook from TradingView?
Otherwise TradingView firers market orders on candle closing bases.
Since TradingView only communicates one-way with Delta, we cannot confirm whether a limit order has been filled. If a limit order remains unfilled, subsequent algo trades may break logical flow. To avoid this risk and ensure execution reliability, Delta <> Tradingview integration currently supports only market orders.
Thanks @ayush.aggrwl.
In that case, if a strategy is running on 1H timeframe, current open position will be closed only once 1H candle is completed even though TP has been reached in realtime. Is there any practical alternate to achieve this than placing a limit order?
Set calc_on_every_tick=true inside the strategy function. @Biscuit
strategy(“My Strategy”, calc_on_every_tick = true)
By default, strategies only update on bar close, meaning signals (like take-profit or stop-loss triggers) fire after the entire candle completes. When calc_on_every_tick is set to true, TradingView will recalculate your strategy on every incoming price tick while the current candle is still forming — instead of waiting for the candle to close. The strategy logic runs continuously within the live candle. As soon as price conditions are met (e.g., TP or SL), your script reacts immediately. On historical bars, this setting has no effect — it only applies to real-time execution.
Thanks @ayush.aggrwl for taking your time out.
I found that calc_on_every_tick is good idea but it does not only affect exit position (TP/SL) but also opening a new position, basically all conditions are evaluated in realtime than candle closing, same as you explained.
On thinking deep, I find that using strategy.exit() can be better idea than calc_on_every_tick where it can be coded in a way to use only for TP, while strategy.close()can be used for SL on candle closing bases. Also, strategy.entry()remains to be delayed on candle closing.
Please feel free to share your thoughts on this.
Since your strategy timeframe is above 15 minutes, you can definitely try this hybrid setup — using strategy.exit() for TP and strategy.close() for SL on candle close.
Try it out and let me know how it performs in your tests.
It should work well, if not, you can always toggle calc_on_every_tick as true.