Hello, 

Finally after months I managed to find some free time to try out your platform and it looks awsome.

But... For educational purpose I'm trying to implement simple scalping strategy found on yt.
It buys or sells based on 5 min EMA 8, 23 and 1h EMA 8, 23 . For now it is suuuper bad. Way to bad to be real so I started to look for mistakes in my implementation. After printing some values I found out that my EMA's are off.

I need 5m EMA and 1h EMA so according to documentation for QC I implemented it this way:

self.PreferedResolution = Resolution.Second self.AddForex(self.FXSymbol, Resolution.Second, Market.Oanda) consolidator5m = QuoteBarConsolidator(timedelta(minutes=5)) self.price = self.Identity(self.FXSymbol, self.PreferedResolution) self.RegisterIndicator(self.FXSymbol, self.price, consolidator5m) self.ema8 = self.EMA(self.FXSymbol, 8, self.PreferedResolution) self.ema21 = self.EMA(self.FXSymbol, 21, self.PreferedResolution) self.RegisterIndicator(self.FXSymbol, self.ema8, consolidator5m) self.RegisterIndicator(self.FXSymbol, self.ema21, consolidator5m) consolidator1h = QuoteBarConsolidator(timedelta(hours=1)) self.emah8 = self.EMA(self.FXSymbol, 8, self.PreferedResolution) self.emah21 = self.EMA(self.FXSymbol, 21, self.PreferedResolution) self.RegisterIndicator(self.FXSymbol, self.emah8, consolidator1h) self.RegisterIndicator(self.FXSymbol, self.emah21, consolidator1h) consolidator5m.DataConsolidated += self.OnDataConsolidated self.SubscriptionManager.AddConsolidator(self.FXSymbol, consolidator5m) self.SubscriptionManager.AddConsolidator(self.FXSymbol, consolidator1h)

With :

self.PreferedResolution = Resolution.Second

5m EMA is equal to 1h EMA which is absolutely incorrect.

With :

self.PreferedResolution = Resolution.Minute self.PreferedResolution = Resolution.Hour

Values of 5m EMA and 1h EMA are different but still look wrong but at least they are updated every 5 minutes and are diffrent from each other :)

With: 

self.PreferedResolution = Resolution.Daily

Values of 1h EMA are updated only every hour and 5m EMA is updated every 5 minutes.

 

Can someone explain this behaviour and point me to right direction?

I've read somewhere on this community forum that it's better to have higher resolution data input then algorithms decision making resolution so my goal is to have Resolution.Second data consolidated into 5m QuoteBars so my algo will make decision about buying/selling every 5 minutes

Author