How to exit a trade after a set number of minutes — Tradetron Community
← Help Center

How to exit a trade after a set number of minutes

Keywords & logic 2 views

To close a position a fixed number of minutes after entry, add an exit condition that compares the entry time with the current time.

Steps

  1. In the Strategy builder, open the exit condition of the set.
  2. Pick the Time Difference (T2-T1) keyword. It returns the minutes from Time 1 to Time 2.
  3. Set Time 1 to EntryTime (the time the strategy entered) and Time 2 to Time with exchange NSE (the current IST time).
  4. Choose greater than or equal to and enter the number of minutes, for example Number(30).

The condition reads like this:

Time Difference (T2-T1) (EntryTime, Time(‘NSE’)) >= 30

Good to know

  • It works only within the same day. Times are in HHMM form.
  • Before any entry, EntryTime has no value, so the condition does not fire. That is expected.
  • Do not compare the result with “not equal to”; use greater than or equal to.
  • Test in Live Offline before going live.

More on these keywords: Keyword Documentation — Tradetron

:sparkles: Edited with AI from the original Tradetron article, checked against current docs (Oct 2026). Spot something wrong? Tell us in the Community.

Still stuck? Ask the community

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