Overall Statistics |
Total Trades 616070 Average Win 0% Average Loss -0.01% Compounding Annual Return 1038.232% Drawdown 3.900% Expectancy -1 Net Profit 4295.434% Sharpe Ratio 5.96 Probabilistic Sharpe Ratio 97.543% Loss Rate 100% Win Rate 0% Profit-Loss Ratio 0 Alpha 9.77 Beta 0.34 Annual Standard Deviation 1.65 Annual Variance 2.722 Information Ratio 5.829 Tracking Error 1.655 Treynor Ratio 28.909 Total Fees $0.00 Estimated Strategy Capacity $6000.00 Lowest Capacity Asset ETHBTC XJ |
import time class FormalSkyBlueChinchilla(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 1, 1) # self.SetEndDate(2020, 12, 31) self.SetCash(100000) self.symbols = [Symbol.Create("BTCUSD", SecurityType.Crypto, Market.GDAX), Symbol.Create("ETHBTC", SecurityType.Crypto, Market.GDAX), Symbol.Create("ETHUSD", SecurityType.Crypto, Market.GDAX) ] ## Manual universe selection with tick-resolution data self.UniverseSettings.Resolution = Resolution.Minute self.SetUniverseSelection(ManualUniverseSelectionModel(self.symbols)) self.SetExecution(VolumeWeightedAveragePriceExecutionModel()) # self.SetBrokerageModel(BrokerageName.AlphaStreams) # btc = self.AddCrypto("BTCUSD") # btc.BuyingPowerModel = SecurityMarginModel(3.3) self.buy_portfolio = True def OnData(self, data): ''' OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. Arguments: data: Slice object keyed by symbol containing the stock data ''' ## Check to make sure all currency symbols are present if len(data.Keys) < 3: return [] try: ## Extract QuoteBars for all three Forex securities bar_a = data[self.symbols[0]].Ask bar_b = data[self.symbols[1]].Ask bar_c = data[self.symbols[2]].Ask except: return triangleRate = (bar_c.Close)*(1/bar_a.Close) *(1/ bar_b.Close) if triangleRate > 1: self.MarketOrder("BTCUSD", 0.5) self.MarketOrder("ETHBTC", 1/data["ETHBTC"].Ask.Close*self.Portfolio.CashBook["BTC"].Amount) self.MarketOrder("ETHUSD", -self.Portfolio.CashBook["ETH"].Amount) self.Liquidate("ETHUSD") pass