Trailing Stoploss Coding/Condition Builder — Tradetron Community
← Community

Trailing Stoploss Coding/Condition Builder

Strategy 1,211 views

Arvind Keshri

Is there a way to trail the positions based on Nifty Futures movement…say I entered with credit spread at Nifty Futures 16300 and SL is 0.5% away(based on Nifty Futures price)…Now I want to trail my exit criteria with each 2-3 point move of Nifty Futures in favorable direction…how this can be done/

Tradetron Team Tradetron team

Yes, with runtime variables:

  1. In the Entry runtime, store the Nifty Futures LTP: entryfut = LTP(Nifty futures).
  2. Keep the stop in another variable: slfut = entryfut − 0.5% (for a bullish spread).
  3. Exit (Set Exit) when LTP(Nifty futures) <= Get Runtime(slfut).
  4. To trail, add a Repair Continuous that fires when LTP(futures) >= LastRepairedUnderlyingPrice + 3 and, in its runtime, raises slfut.

Repair Continuous needs a condition that resets after each fire, otherwise it loops and the strategy can be blocked. Test with small quantity in Live Offline.

Trailing that must update on every move is simpler in Python. You can connect your AI to Tradetron via MCP to help build it.

:sparkles: Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.

Tradetron अब हिन्दी में भी उपलब्ध है हिन्दी में देखें Continue in English