Overall Statistics |
Total Trades 6 Average Win 9.53% Average Loss -0.35% Compounding Annual Return 8.780% Drawdown 24.400% Expectancy 18.020 Net Profit 18.380% Sharpe Ratio 0.373 Probabilistic Sharpe Ratio 16.061% Loss Rate 33% Win Rate 67% Profit-Loss Ratio 27.53 Alpha 0.118 Beta -0.035 Annual Standard Deviation 0.308 Annual Variance 0.095 Information Ratio 0.051 Tracking Error 0.334 Treynor Ratio -3.307 Total Fees $0.00 |
import numpy as np ### <summary> ### Basic template algorithm simply initializes the date range and cash. This is a skeleton ### framework you can use for designing an algorithm. ### </summary> class BasicTemplateAlgorithm(QCAlgorithm): '''Basic template algorithm simply initializes the date range and cash''' def Initialize(self): self.SetStartDate(2017,7, 31) #Set Start Date self.SetEndDate(2019,7,31) #Set End Date self.SetCash(5000) #Set Strategy Cash self.AddForex("EURGBP", Resolution.Daily, Market.Oanda) self.SetBrokerageModel(BrokerageName.OandaBrokerage) self.rsi = self.RSI("EURGBP", 14) def OnData(self, data): if not self.rsi.IsReady: return if self.rsi.Current.Value < 30 and self.Portfolio["EURGBP"].Invested <= 0: self.Debug("RSI is less then 30") self.MarketOrder("EURGBP", 25000) self.Debug("Market order was placed") if self.rsi.Current.Value > 70: self.Debug("RSI is greater then 70") self.Liquidate() def OnEndOfDay(self): self.Plot("Indicators","RSI", self.rsi.Current.Value)