Know performance, backtest now
that day.
Backtested Gross Gains
This graph compares the Algo's best and worst performance over time, showing how returns can vary depending on when you start using the Algo.
Know performance, backtest now
Performance Summary
Hover to see parameter details.
Tap to see parameter details.
Avg Drawdown
--
Indicates the average decline the strategy experiences in downturns, revealing how deep its typical losses go.
Risk : Reward
--
Indicates how much the Algo typically earns for every rupee it risks. E.g., 1:3 means it targets ₹3 in reward for every ₹1 of risk.
Frequency of trade
--
Indicates how often the Algo trades on average.
Risk
--
Indicates the expected volatility of the Algo and is classified into levels like Low, Medium, and High.
Max Drawdown
--
Indicates the largest decline the Algo has faced so far, reflecting its most severe historical downturn.
Success Ratio
--
Indicates the percentage of trades that end in profit. E.g., 70% means 7 out of 10 trades are winners.
Avg Profit in Trade
--
Indicates the average gain the Algo earns on its winning trades.
Avg Loss in Trade
--
Indicates the average loss the Algo incurs on its losing trades.
Avg Time to Recovery
--
Indicates the average number of days the Algo took to bounce back after experiencing its average drawdown.
Max Time to Recovery
--
Indicates the number of days the Algo took in the past to recover from its worst drawdown to date.
Sharpe Ratio
--
Indicates how well an Algo balances risk and return, showing how effectively it manages volatility.
*Metrics/Analytics basis past data. Historical data does not guarantee future results.
Know performance, backtest now

Strategy Overview
This Python trading algorithm, named "Ratio-Return Credit Spread Exit-Early", aims to generate trading signals for credit spread strategies on NIFTY options. It leverages a combination of technical indicators derived from historical options data, including open interest (OI), implied volatility (IV), volume, and proprietary factors like Hamiltonian energy and entropy. The core methodology involves calculating a composite alpha signal based on three factors: resource depletion (entropy drop), niche specialization (volume/OI concentration), and directional bias (Hamiltonian energy/IV imbalance). The algorithm reads pre-calculated option data, computes a rolling time-series rank of the alpha signal and a secondary alpha based on IV kurtosis and eigenvalue, and then assesses these alpha values to identify potential credit spread opportunities. The algorithm specifically looks for entry signals for credit put spreads and credit call spreads based on the levels of 'alpha' and 'alpha2', with different thresholds for long and short positions. The algorithm generates trading signals based on the calculated alpha values, initiating a credit spread strategy when specific conditions are met. It looks for "long" opportunities when 'alpha' exceeds 0.85 and 'alpha2' exceeds 0.8, triggering a credit put spread. Conversely, it looks for "short" opportunities when 'alpha' is below 0.15 and 'alpha2' is below 0.2, triggering a credit call spread. The risk management component includes setting a stop-loss based on a percentage of the margin required for the trade, as well as a target profit level. The algorithm determines the specific option contracts to trade based on the at-the-money (ATM) strike price and predefined offsets (e.g., 400 points). The trading logic then constructs the necessary buy and sell orders, factoring in the lot size of the NIFTY options. To encourage early profit taking, the algorithm sets a "premature_target_ttl," and will attempt to book the trade if the profit target is reached prior to expiry. Finally, the algorithm checks for active trades before executing a new trade, pushing a message to Slack, and using Stratzy's API to send the trades for execution, only after calculating the maximum potential profit for the credit spread.
This Algo is managed by
Stratzy
Stratzy is a place where you can get tailored guidance for your portfolio to help you make the right investments. Gain access to battle tested algos, automation of your investments and insights about the market, right in the palm of your hand. Your wealth generation begins here.
More algos by Stratzy









































































