Overall Statistics
Total Trades
30
Average Win
0.16%
Average Loss
-0.15%
Compounding Annual Return
20.147%
Drawdown
1.000%
Expectancy
0.104
Net Profit
0.235%
Sharpe Ratio
-2.712
Probabilistic Sharpe Ratio
35.273%
Loss Rate
47%
Win Rate
53%
Profit-Loss Ratio
1.07
Alpha
-3.613
Beta
0.232
Annual Standard Deviation
0.045
Annual Variance
0.002
Information Ratio
-104.989
Tracking Error
0.144
Treynor Ratio
-0.529
Total Fees
$30.60
namespace QuantConnect.Algorithm.CSharp
{
    public class DynamicVerticalRegulators : QCAlgorithm
    {

        public override void Initialize()
        {
            SetStartDate(2020, 6, 1);  //Set Start Date
            SetCash(100000);             //Set Strategy Cash

			SetExecution(new ImmediateExecutionModel());

			SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());

			UniverseSettings.Resolution = Resolution.Minute;
			var symbols = new[] { QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA),  QuantConnect.Symbol.Create("GLD", SecurityType.Equity, Market.USA),
			 QuantConnect.Symbol.Create("TLT", SecurityType.Equity, Market.USA)};
			SetUniverseSelection( new ManualUniverseSelectionModel(symbols) );
			
			SetAlpha(new MyAlpha());
		

        }
        
    }
    
    
    public class MyAlpha : AlphaModel
    {
    	
    	public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data){
    		
    		var insights = new List<Insight>();
    		
    		var now = algorithm.Time;
    		foreach(var symbol in data.Keys)
    		{
	            if (!algorithm.Portfolio[symbol].Invested)
	            {
		            // close insight today at 3:59 PM
		            var nextClose = algorithm.Securities[symbol].Exchange.Hours.GetNextMarketClose(algorithm.Time, false).AddMinutes(-2);
		            
		           
		            if(now < nextClose){
			            var insight = Insight.Price(symbol, nextClose, InsightDirection.Up);
			            insights.Add(insight);
		            }
		            
	            }
    		}
    		
    		return insights;
    	
    	}
    	
    }
}