This algorithm is designed to sell options when the market is in a "premium zone" - meaning options are overpriced relative to their historical patterns. It analyzes Nifty options data in real-time, calculating various volatility metrics like implied volatility (IV) across different strike prices (ATM, ITM, OTM). The algorithm creates two key signals called "alpha" and "alpha2" that measure how expensive options are compared to their normal levels. When both alpha values drop below 0.2 (indicating options are relatively cheap), it triggers a short strangle trade.
How it trades: When the signal is triggered, the algorithm sells both a call option and a put option at out-of-the-money strikes (100 points away from the current market price). This is called a "short strangle" strategy - it profits when the market stays within a range and doesn't move too much in either direction. The algorithm only trades during specific market hours (10:15 AM to 2:00 PM) and automatically handles expiry dates, switching to the next week's options if it's expiry day. It includes risk management with a 2% stop-loss and only runs when there's no existing active trade.
Show more 