How to use price of Nifty option at particular time for using as SL in Algo — Tradetron Community
← Community

How to use price of Nifty option at particular time for using as SL in Algo

Keyword help 1,856 views

GW

Hi,
I want to use 9:45 candle low and high of particular Call option of Nifty for entering and exiting a trade. I am not able to find way for referring this in condition to check entry and exit in my strategy. Can anyone help please.

magnum

Select the call option using LTP keyword or position and close keywords and proceed

GW

Hi, magnum, Can you please explain. What I want is as below:
I want to see at 9:45 what is the High and low of a CE option which is nearly 100pt (2 strike) away from Nifty. Say nifty at 9:45 is at 18400. So, I want to record High (call it A)and Low (call it B) of 15min candle for 18500CE (9:45). I want to sell this 18500CE whenever its price is < (B-0.5) and then wait. The SL is (A+0.5) i.e. whenever this 18500CE LTP is above (A+0.5), I want to exit trade and again wait for re-entry at (B-0.5). So, I want a way to refer these two values throughout the intraday trade. Can you help how to do that.

Tradetron Team Tradetron team

Short answer: read the 9:45 candle of the option with the Indicator Value (Time) keyword, or save the candle’s high and low in runtime variables when you enter, then use them in your exits.

Option 1: Indicator Value (Time)

This keyword returns a series value at a clock time today. For example, the high of the option’s 15-minute candle that starts at 9:45:
Indicator Value (Time) ( HIGH ( Symbol ( your NIFTY CE, 15m ) ), '09:45' )
Use LOW(...) the same way. Then, in the entry condition after 10:00: LTP ( your NIFTY CE ) > Indicator Value (Time) ( HIGH (...), '09:45' ).

Option 2: runtime variables at entry

  1. In the Entry block’s Runtime section:
    • A = Position ( HIGH ( Symbol ( Traded Instrument Name ( Entry, 1, 1, 1 ), 15m ) ), -1 )
    • B = Position ( LOW ( Symbol ( Traded Instrument Name ( Entry, 1, 1, 1 ), 15m ) ), -1 )
  2. Exit condition: LTP ( Traded Instrument Name ( Entry, 1, 1, 1 ) ) > Get Runtime Number ( A ) OR < Get Runtime Number ( B ).

Runtime variables are written once, right after the leg is taken, so they do not move later. Pick the option itself with ATM SPOT and a strike offset in the Position Builder. Test in Live Offline first.

Example thread: 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.