Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
14.106%
Drawdown
13.200%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0.974
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-0.003
Beta
1.006
Annual Standard Deviation
0.118
Annual Variance
0.014
Information Ratio
-0.245
Tracking Error
0.008
Treynor Ratio
0.114
Total Fees
$3.81
namespace QuantConnect 
{   
	public class VWAPAlgorithm : QCAlgorithm
    {
    	private VolumeWeightedAveragePriceIndicator _vwap;
        public override void Initialize() 
        {
			SetStartDate(2013, 1, 1);         
            AddSecurity(SecurityType.Equity, "SPY", Resolution.Daily);
            _vwap = VWAP("SPY", 20);
        }

        public void OnData(TradeBars data) 
        {   
        	if (!Portfolio.HoldStock) SetHoldings("SPY", 1m);
            Plot("SPY", "Price", data["SPY"].Price);
        	Plot("SPY", "VWAP", _vwap);
        }
    }
}