Hi Imran,
@Tradehull_Imran
We are using Tradehull + Dhan in a log-only algo setup and would like clarity on three specific implementation points.
- Option symbol resolution (strike finalised, expiry offset known)
We already decide the strike ourselves (ITM logic) and only need Tradehull for expiry resolution & symbol mapping.
Our strike logic (fixed and final) is:
rounded_high = round(index_sh_high / 100) * 100
rounded_low = round(index_sh_low / 100) * 100
ce_strike = rounded_high - 200 # CE ITM
pe_strike = rounded_low + 200 # PE ITM
We also already decide expiry offset:
Expiry = 0 → current weekly expiry
Expiry = 1 → next weekly expiry
Could you please confirm the recommended Tradehull-supported way to fetch the exact option symbol (CE / PE) when strike price and expiry offset are already known, without using OTM_Strike_Selection for strike logic or any LTP-based logic?
- Expiry-day detection (weekly expiry)
We want to reliably detect weekly expiry day so that on expiry:
We switch from Expiry = 0 → Expiry = 1
With our current setup (strike fixed, expiry offset controlled by us), what is the recommended Tradehull way to detect that “today is weekly expiry day”?
- Live market feed (Index + Option)
We are currently subscribing to the live NIFTY index feed via Dhan and building our own 1-minute candle engine.
After index direction is locked, we want to subscribe to only one option (CE or PE):
Index live feed → direction logic
After lock → subscribe to CE or PE only
security_id already resolved
Could you also confirm the recommended Dhan / Tradehull approach to:
Subscribe to live NIFTY index feed, and
Subscribe to live option feed (CE / PE) using security_id,
so ticks can be forwarded into a custom candle engine?
If there are simpler or more robust patterns you recommend for live feed handling, we’re open to those as well.
A minimal reference example would be really helpful. Thanks.