Hi All,

I've been attempting to test a basic EMA crossover strategy for Crypto, but having had some strange backtests I dug into the results and it seems the crossover event occurs at UTC time but the orders are processed at Eastern. In effect it's as if the order is being placed four hours after the crossover occurred.

For example, the price for a Buy Order executed at the time of the crossover (07:57) actually matches the ask close price in the Historical Data at 11:57:

 

153910_1621525995.jpgMarket Order

 

153910_1621526055.jpgBitfinex XRP Data

I tried changing the Brokerage to GDAX, the Account Type to Cash and the Asset to ETHUSD but found the same issue. I also checked the algo using FX (specifically EURUSD through FXCM) and found no such issue, so it seems to be specifically related to Crypto. I limited the date range to a few days just to identify the cause of the unexpected results I had been seeing. 

I'm fairly new to coding so please forgive the simplistic nature of the algorithm. I'm sure it's simply a case of something I haven't included or configured correctly so any guidance would be much appreciated.

Thanks

Author