Hi All,

I am new to Quant Connect and really liking the site as well as the community that comes with it.  I am new to Algo Trading, but not new to finance or coding as I have a degree in Computer Science, so I'm just trying to put the two together.

I am currently trying to create an algorithm that makes buy/sell decisions based off of an Elliot Wave Oscillator (EWO) indicator.  For those who don't know, EWO is simply the difference of a 5 day SMA and a 35 day SMA.  I also only want to take in data and make decisions from a 2min chart. With that being said, I have gone through and tried to build this indicator using a consolidator to make the 2min trade bars, but both of my SMAs seem to be a little off and the EWO doesn't line up with the real charts I'm comparing them to.  Through research, I have found that a reason that the SMAs may be off is because the backtesting data doesn't always match up to the actual data that a broker shows you (I am comparing with WeBull).  Then, if the SMAs are off, then of course the EWO will be off too, but I feel like there is something more I am missing.  As you will see in the code, I really only need to keep track of the current EWO value as well as the previous, so I only made a 2 element array, but I do understand that it may be beneficial to use a rolling window as it could help the code be more efficient when retrieving the data for the SMAs.  I am open to switching to rolling window if that is thought to be better, but wouldn't mind a small explanation/code snippet showing how to use it properly in this situation.

In all, I guess my question is for someone with some more experience to look over my code and try to figure out why my EWO/SMA indicators are not giving results that match charts that I see on my broker (WeBull).  Once I can get the EWO to produce the right values, then I think I can really hit the ground running with the rest of the code/logic (lol knock on wood right)

From reading a lot of other threads, I know that people like actual results when we say that our numbers dont match up so, as you may be able to read in the Benchmark chart in the backtest, for January 6th, '23 at 9:30am, it gives sma5 as $382.41 and sma35 as $380 when my Webull chart gives $382.54 and $382 respectively.

To wrap up, 1) Thank you for taking the time to read this, 2) Main goal to get out of this is getting the 2min EWO to give correct value on a 2min chart, 3) It would be nice to learn the statement that allows me to look at the backtested benchmark chart in different time intervals (i.e., 2min time interval to compare my results to a real 2min chart on WeBull) 

Author