Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
-0.702
Tracking Error
0.127
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
namespace QuantConnect.Algorithm.CSharp
{
    public class CalmFluorescentPinkShark : QCAlgorithm
    {
		Symbol _symbol;

        public override void Initialize()
        {
            
            SetStartDate(2021, 1, 1);
        	SetEndDate(2021, 02, 28);
        	
        	SetCash(100000);
        	
        	SetWarmUp(2);
        	
        	
        	var equity = AddEquity("SPY", Resolution.Minute);
        	equity.SetDataNormalizationMode(DataNormalizationMode.Raw);
        	
        	_symbol = equity.Symbol;
        	
        	SetBenchmark("SPY");
        
        	var option = AddOption(_symbol, Resolution.Minute);
        	option.SetFilter(-20, 20, TimeSpan.FromDays(30), TimeSpan.FromDays(60));
        	option.PriceModel = OptionPriceModels.CrankNicolsonFD();
        	
        	// Every week 30 mins after market is open
        	Schedule.On(DateRules.WeekStart(_symbol, 0), TimeRules.AfterMarketOpen(_symbol, 30), () => 
        	{
        		if (IsWarmingUp) return;
        		RunWeeklySchedule();
        	});
        }
        
		private void RunWeeklySchedule()
		{	
        	foreach(var i in this.CurrentSlice.OptionChains)
            {
                var chain = i.Value;
                
            	var option = chain.Where(x => x.Right == OptionRight.Call)
            					.OrderByDescending(x => x.Expiry)
            					.OrderByDescending(x => x.Greeks.Delta)
            					.FirstOrDefault();
            	
            	if (option != null)
            	{
            		Plot("Options", "Delta", option.Greeks.Delta);
            		Plot("Options", "Strike", option.Strike);
            		
            		Debug($"Expiration: {option.Expiry}");
            		Debug($"Strike: {option.Strike}");
            		Debug($"Delta: {option.Greeks.Delta}");
            		
            	}
                
            }
		}
        

        
    }
}