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)
Louis Szeto
Hi Jclute17
Please note that self.SMA(…) is an automatic updating indicator, i.e. it will update for every slice data received for SPY, so you were double updating it with (1) minute data from automatic update, and (2) 2-minute consolidated data from RegisterIndicator method. Instead, you might want to use a manually updating indicator and subscribe it to the 2-minute consolidator:
If you were trying to match it indicator value from a 3rd party source, make sure you have followed the points here:
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Jclute17
Thank you Louis!
I am looking forward to implementing your tips in the coming days :)
Jclute17
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!