Get Entry time EMA value — Tradetron Community
← Community

Get Entry time EMA value

Keyword help 858 views

Jai

How can we create an EXIT condition like this example:
close > entry time EMA20 + (some value)

Tradetron Team Tradetron team

Store the EMA value at the moment you enter, then compare against the stored value in the exit.

Steps

  1. In the Entry block, open Runtime Variable, name it ema_entry, click Fx and set it to the EMA of the last closed candle:
    Position(EMA(CLOSE(Symbol(<instrument>, '15m')), 20), -1)
  2. Runtime variables are written right after the entry leg is taken, so this value stays frozen at entry.
  3. In the Exit condition:
    Position(CLOSE(Symbol(<instrument>, '15m')), -1) > Get Runtime Number(ema_entry) + Number(<value>)
    Use Get Runtime Number (not Get Runtime) because you are doing arithmetic on it.

Example

At entry the 20 EMA is 18,450. With <value> = 50, the exit fires when a 15-minute candle closes above 18,500.

Notes: a Universal Exit clears runtime variables. You can see stored values on the Deployed page → ⋮ → Runtime Data. Test in Live Offline.

Worked example: Use Entry Candle - High and Low using Runtime Variable - #8 by Nelson

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