Breakout strategy based on previous day last 5 mints candle
Strategy2,247 views
Rajendra Reddy
I want to create breakout strategy based on previous day last 5 mints candel which 3.25pm candel and I want trade to happen everyone time it cross from up to down and down to up
Also lock my profit to rs 300 and trail from there for every 300 positive should lock profit, example if profit reache to 600 rs the profit should lock to 600
Lion Algos
You can try with ’ Initialize Variable ’ for getting values of high and low of previous day last 5 min candle. Use that variables in entry conditions.
For locking profit you can set that in advance setting
Rajendra Reddy
I am not finding that keyword, can you please send me sample code same and entry should be taken every time it breaks high or low of previous day 5 mints candle also first entry should fresh break of current day
Tradetron TeamTradetron team
Capture yesterday’s last 5-minute candle. In Initialize Variables, store pd_high and pd_low. They are written at the first condition check of the run, before today’s first 5-minute candle closes, so -1 still points at yesterday’s 15:25 candle:
pd_high = Position(HIGH(<inst>, '5m'), -1)
pd_low = Position(LOW(<inst>, '5m'), -1)
Initialize Variables can’t be used in list-based strategies.
Entries: long when LTP > Get Runtime Number(pd_high), short when LTP < Get Runtime Number(pd_low). Use separate sets.
Lock profit at 300 and trail every 300: in Universal Exit, use Universal Exit TSL: Universal Exit TSL('tsl-points', 300, 300, 300, 300) == Number(1). That is: activate at 300, lock 300, raise by 300 every +300. Adjust as needed.
Repeated crosses: after each exit the entry can fire again when the condition is true. Add a time gate, or a re-entry counter with a runtime variable, to avoid flip-flopping.
Test in Live Offline.
Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.