The "Curve-Whisper Credit Spread Overnight" algorithm is designed to identify potential overnight credit spread opportunities in NIFTY options. The core strategy involves analyzing a combination of option chain data, volatility, open interest, and custom indicators to generate trading signals. It uses a proprietary "alpha" signal, derived from option pricing, implied volatility, and open interest data to determine if a credit spread is likely to be profitable. This "alpha" is calculated using a combination of call and put option pressures along with flow resistance, then normalized using a time-series rank. The algorithm then uses the generated signals to enter a credit spread by selling a near-the-money (ATM) option and buying a further out-of-the-money (OTM) option to limit risk.
The algorithm generates signals based on the calculated "alpha" values. A low "alpha" suggests a potential long (buy) opportunity on a put spread, while a high "alpha" suggests a potential short (sell) opportunity on a call spread. The algorithm implements risk management primarily through the credit spread structure itself, limiting potential losses to the difference between the strike prices, less the premium received. A stop loss is defined, which is applied at a percentage of margin required. Trades are only executed during specific market hours, between 10:15 and 14:15, and skips trading on the day of NIFTY expiry, ensuring trades align with backtested logic. Lot sizes and quantities are determined programmatically. The algo uses the helper functions to define required values, such as determining strike prices and expiry dates.