Hello! This my first post so here goes: i am working on an algo that uses the 13ema and the 20sma and tracks when they cross on the 1hour time frame. I don't get any errors when it runs but when i look at the test trades it made they dont align with the same indicator crossover data from my Oanda charts. Did i set these up correctly or am i missing something to make these indicators show the true data. I'd laso like to have it execute the trade as soon as they cross instead of waiting on the 1 hour candle to close. Please help & thanks in advance!

   
 

def __init__(self): self.symbol = "EURUSD" self.previous = None self.fast = None self.slow = None def Initialize(self): self.SetStartDate(2017,6,25) #Set Start Date self.SetEndDate(2018,2,1) #Set End Date self.SetCash(100000) #Set Strategy Cash self.AddForex("EURUSD", Resolution.tick, Market.Oanda) #Set time frame for bars. # create a 13 period exponential moving average self.fast = self.EMA(self.symbol, 13, Resolution.hour); # create a 20 period simple moving average self.slow = self.SMA(self.symbol, 20, Resolution.hour); self.PlotIndicator("EMA", self.fast); self.PlotIndicator("SMA", self.slow); self.previous = None def OnData(self, data): # wait for our fast ema to fully initialize if not self.fast.IsReady: return # wait for our slow ema to fully initialize if not self.slow.IsReady: return

Author