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.408 Tracking Error 0.186 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset |
# region imports from AlgorithmImports import * from datetime import timedelta # endregion class CalculatingSkyBlueFlamingo(QCAlgorithm): def Initialize(self): self.SetStartDate(2018, 9, 1) ## Set Start Date self.SetCash(100000) ## Set Strategy Cash self.AddForex('GBPUSD', Resolution.Hour, Market.Oanda) self.strength = self.RSI('GBPUSD', 6, MovingAverageType.Wilders) self.strength.Updated += self.RSIUpdated self.rsi = RollingWindow[IndicatorDataPoint](2) ## Create on a Sunday -- Oanda Forex opens 17:00 Sunday, closes Friday 17:00 self.Schedule.On(self.DateRules.On(2018, 9, 2), self.TimeRules.At(17,0), self.DailyConsolidator) def RSIUpdated(self, sender, updated): self.rsi.Add(updated) def OnData(self, data): ## Skip because this is for hourly data pass def DailyConsolidator(self): consolidator = QuoteBarConsolidator(24) ## 24 hours in a day consolidator.DataConsolidated += self.OnDataConsolidated self.SubscriptionManager.AddConsolidator('GBPUSD', consolidator) self.RegisterIndicator('GBPUSD', self.strength, consolidator) def OnDataConsolidated(self, sender, bar): self.Log('New Daily Bar >> ' + str(bar.Close)) self.Log('CurrRSI Value >> ' + str(self.rsi[0])) self.Log('PrevRSI Value >> ' + str(self.rsi[1]))