Need code for Range breakout strategy for Nifty

Hi,

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.

Regards

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,
LAST>REF(HIGH,4)
For SELL,
LAST<REF(LOW,1)
Target fixing is not possible.
Stop Loss for BUY entry-
REF(LOW,4)
Stop Loss for SELL entry,
REF(HIGH,4)

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