Overall Statistics |
Total Trades 113 Average Win 0.74% Average Loss -0.07% Compounding Annual Return 2014.351% Drawdown 4.300% Expectancy 0.268 Net Profit 2.540% Sharpe Ratio 7.704 Probabilistic Sharpe Ratio 0% Loss Rate 89% Win Rate 11% Profit-Loss Ratio 10.83 Alpha -108.359 Beta 38.203 Annual Standard Deviation 0.777 Annual Variance 0.604 Information Ratio 3.955 Tracking Error 0.757 Treynor Ratio 0.157 Total Fees $0.00 Estimated Strategy Capacity $9000.00 Lowest Capacity Asset ETHUSD XJ |
# Crypto VWAP from AlgorithmImports import * # --------------------------------------- CRYPTO = "ETHUSD"; SL = -0.02; TP = 0.02; # --------------------------------------- class DeterminedAsparagusManatee(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 6, 21) self.SetEndDate(2020, 6, 23) self.SetCash(100000) self.crypto = self.AddCrypto(CRYPTO, Resolution.Minute).Symbol self.vwap = self.VWAP(self.crypto) def OnData(self, data: Slice): if not self.vwap.IsReady: return pnl = self.Securities[self.crypto].Holdings.UnrealizedProfitPercent currentclose = self.Securities[self.crypto].Close vwap = self.vwap.Current.Value self.Plot(self.crypto, "current close", currentclose) self.Plot(self.crypto, "vwap", vwap) if not self.Portfolio[self.crypto].IsLong: if currentclose >= vwap: self.SetHoldings(self.crypto, 1, False, "currentclose > vwap") elif not self.Portfolio[self.crypto].IsShort: if currentclose < vwap: self.SetHoldings(self.crypto, -1, False, "currentclose < vwap") elif self.Portfoliov[self.crypto].Invested: if pnl < SL: self.Liquidate(self.crypto, "Stop Loss") elif pnl > TP: self.Liquidate(self.crypto, "Take Profit")