The classic intraday 9:15–9:30 opening range breakout for Indian markets, built on the Nubra Python SDK (nubra-sdk).
- Let the market settle from 9:15 to 9:30 record the high and low of that window
- BUY when price breaks above the range high (stoploss = range low)
- SELL when price breaks below the range low (stoploss = range high)
- One trade per day, checked once per minute
- Intraday 1-minute candles via
market.historical_data(...)withintraDay: True - Instrument lookup for the
refIdvia the refdata module - Stoploss attached to the entry order via
exitConfig.stoplossParams - A simple, honest polling loop with error handling around every network call
Dry run by default it prints the range and the breakout signal but places nothing until:
PLACE_ORDER = TrueSYMBOL = "RELIANCE"
QTY = 1
RANGE_START = (9, 15)
RANGE_END = (9, 30)Prices from the SDK are integers in paise (₹1 = 100). Candle timestamps use your computer's local timezone — run on a machine set to IST.
pip install -r requirements.txt
python opening_range_breakout.pyStart it before 9:30 IST on a trading day; it waits for the range to complete, then watches for the break.
Educational example only — not investment advice. Breakouts fail often; always use the stoploss. Trade at your own risk.