Need code for Range breakout strategy for Nifty


Kindly let me know code for a Range Breakout strategy for Nifty:

Rules are:

  1. High of Range is: High of Nifty till 10:15

  2. Low of Range is: Low of Nifty till 10:15

  3. Long entry at cross of 10:15 high

  4. Short entry at cross of 10:15 low

  5. Exit at 50 points in either direction

  6. Stop Loss is Low of range if Long entry and High of Range if Short entry.


Ok, Zerodha Pi does not have time-based entry/ exit strategy. But there is a work around. If you tell me the time frame used for trading, i can try

Its an Intraday strategy and the position will be auto-squared-off at 3:20 p.m.
Time frame is 15 min candle.

set the time frame as 15m.
For Buy,
Target fixing is not possible.
Stop Loss for BUY entry-
Stop Loss for SELL entry,

Thanks Andrew. How to fix the target for auto trading? Is it possible to set target and other Trading rules using Amibroker?