Candle close with supertrend indicator — Tradetron Community
← Community

Candle close with supertrend indicator

Keyword help 1,892 views

Sanjay Shah

Hi

It seems that Supertrend Stratergy is not working correctly as expected as it will consider candle high or low also even it candle close is mentioned in condition for supertrend cross over.
Example: in BNF option condition is for supertrend cross over with spot BNF for candle close.
Suppose there is CE buy happens as per entry condition after cross over after 4-5 candle if low of any candle toches or goes below buy supertrend then exit will happens even though candle close for same candle happens above buy supertrend. This is exit condition which tells exit should happen id siupertrend cross over happen only after close of candle is not met.

sag

is this issue solved with new supertrend they have added? facing similar issue and the tradetron team is pathetic, they never reply to emails

Amit Pathak

PleaseShare SS of Code

Tradetron Team Tradetron team

Use the close of a completed candle, not the live price.

Why it exits on a wick

If the exit compares LTP (or candle 0, which is still forming) with Supertrend, it reacts to every tick. A candle whose low dips below the Supertrend line triggers the exit even if that candle later closes above it.

Close-based exit (for a CE bought on an up-cross)

Position(CLOSE(Symbol(<instrument>, '5m')), -1) < Position(SUPERTREND(Symbol(<instrument>, '5m'), 10, 3), -1)

  • -1 is the last completed candle, so the check only changes once a candle has closed.
  • For a fresh cross, also check the candle before: close at -2 was above Supertrend at -2.
  • Use the same instrument (e.g. BANKNIFTY spot or futures), timeframe, period and multiplier as your entry.

Matching your chart

SUPERTREND is the ATR-based version. ST SMA is a variant smoothed with SMA. If values differ from your charting tool, check that the period, multiplier and candle type match, and try the other keyword.

Check the values in the Notification Log while running in Live Offline. Reference: Keyword Documentation — Tradetron

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