This algorithm is a sophisticated options trading strategy that combines quantum mechanics principles with traditional financial indicators to generate trading signals for naked options positions. The core innovation lies in its use of a quantum-inspired approach where it treats the options market as a quantum system, calculating Hamiltonian energy levels for different strike prices. The algorithm processes 1-minute interval data for Nifty 50 options, calculating implied volatility (IV) for various strike prices (ATM, ITM, and OTM options at different moneyness levels), and then uses these IV values to compute second derivatives that represent the "kinetic energy" component of the quantum system. The algorithm also incorporates open interest, volume, and strike price data to calculate potential energy through linear regression, ultimately combining these into a total Hamiltonian energy for each option contract.
The trading logic is based on two primary alpha signals: a time-series ranked sentiment indicator and a volatility-based signal. The first alpha signal combines factors like spot returns, put-call volume ratios, and changes in implied volatility, while the second alpha signal looks for specific conditions around predicted volatility changes and implied volatility skew. The algorithm generates long signals (buying call options) when the sentiment is bearish (alpha < 0.2) but there's positive momentum in call volatility predictions, and short signals (buying put options) when sentiment is bullish (alpha > 0.8) but there's negative momentum in put volatility predictions.
The strategy puts a trailing SL of 30% and multiple targets where partial quantities are booked at 24%, 48% and 72%, and only executes trades during specific market hours (10:15 AM to 2:15 PM) to avoid high volatility periods at market open and close.