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.864
Tracking Error
0.125
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
#region imports
from AlgorithmImports import *
#endregion

class VWAPwithSTD(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 1, 1)
        self.SetEndDate(2022, 4, 12)
        self.SetCash(100_000)
        self.stock = self.AddEquity("QQQ", Resolution.Minute).Symbol
        self.vwap = self.VWAP(self.stock, 14, Resolution.Daily)
        self.std = self.STD(self.stock, 14, Resolution.Daily)
        self.SetWarmUp(30, Resolution.Daily)


    def OnData(self, data):
        if self.IsWarmingUp or not self.std.IsReady:
            return
            
        price =  self.Securities[self.stock].Price
        vwap = self.vwap.Current.Value
        std = self.std.Current.Value
        ub1 = vwap + std 
        ub2 = vwap + 2*std
        lb1 = vwap - std 
        lb2 = vwap - 2*std 
        
        self.Plot("QQQ", 'price', price)
        self.Plot("QQQ", 'vwap', vwap)
        self.Plot("QQQ", 'ub2', ub2)
        self.Plot("QQQ", 'ub1', ub1)
        self.Plot("QQQ", 'lb1', lb1)
        self.Plot("QQQ", 'lb2', lb2)