“Value When” fetch EMA cross over of Prev Day — Tradetron Community
← Community

“Value When” fetch EMA cross over of Prev Day

Uncategorized 1,021 views

Bhavesh Savla

I’ve strategy where I’ve used Value When to get EMA 9 & 21 cross over. I enter / exit on high / low of this candle.
This is intraday strategy and exit at 1520.
But, next day, it recognize previous day cross over use those values.
Is there a way to stop this? In short, I need TODAY’s fresh cross-overs.
Please help.

Tradetron Team Tradetron team

Why: Value When looks back through the whole series. On a new morning, the most recent crossover can still be from yesterday.

Ways to get only today’s crossovers:

  1. Check the cross candle directly. Use Position ( Cross ( EMA 9, EMA 21 ), -1 ) to detect a fresh cross. In that block’s runtime variables, store the cross candle’s high and low (Position ( HIGH, -1 ), Position ( LOW, -1 )). Use Get Runtime for the entry and exit levels.
  2. Universal Exit at end of day (e.g. 15:20). It clears the variables, so each day starts clean.
  3. Add a time gate like Time ( NSE ) >= 920 so the first comparison happens after at least one candle of today has formed.

Runtime variables write only after a leg is taken. If the cross must be stored before any trade, ask support (chat on tradetron.tech) or use custom Python. Test in Live Offline.

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