Overall Statistics
Total Trades
240
Average Win
0.51%
Average Loss
-0.17%
Compounding Annual Return
10.656%
Drawdown
2.800%
Expectancy
0.124
Net Profit
2.472%
Sharpe Ratio
1.02
Probabilistic Sharpe Ratio
50.447%
Loss Rate
72%
Win Rate
28%
Profit-Loss Ratio
2.97
Alpha
0.083
Beta
0.013
Annual Standard Deviation
0.084
Annual Variance
0.007
Information Ratio
-0.731
Tracking Error
0.152
Treynor Ratio
6.62
Total Fees
$240.00
namespace QuantConnect.Algorithm.CSharp
{
    public class VentralParticleChamber : QCAlgorithm
    {
    	RelativeStrengthIndex _rsi;
    	SimpleMovingAverage _smaLong;
    	ExponentialMovingAverage _emaShort;
        VolumeWeightedAveragePriceIndicator _vwap;

    	private string ticker =  "SPY";

        public override void Initialize()
        {
            SetStartDate(2019, 8, 10);  //Set Start Date
            SetCash(10000);             //Set Strategy Cash
            
            AddEquity(ticker, Resolution.Second);
            
            //Request data before Initialize
            SetWarmUp(TimeSpan.FromMinutes(181));
            
            _rsi = RSI(ticker, 14, MovingAverageType.Simple, Resolution.Minute);
            _emaShort = EMA(ticker, 15, Resolution.Minute);
            
            _smaLong = SMA(ticker, 180, Resolution.Minute); 
            _vwap = VWAP(ticker, 20);

            
            


        }

        
        public override void OnData(Slice data)
        {
        	if(!_smaLong.IsReady) return;
        	var quantity = Portfolio[ticker].Quantity;
        	
        	if(_rsi > 55 && quantity == 0  && _emaShort > _smaLong && _vwap > 20) 
        	{
        		SetHoldings(ticker, 1);
        		Debug($"Purchased ");
        	} 
        	else if (_emaShort < _smaLong && quantity > 0)
        	{
        		Liquidate();
        		Debug("Sold");
        		
        	}
        }
        	public override void OnEndOfDay() {
        		Plot("RSI", _rsi);
        		Plot("EMA", _smaLong, _emaShort);
        	}
        		
           
           }
        }