I am using Bollinger Bands, Keltner Channels to do some checks. I consistently notice that all the values of these indicators are completely wrong when I compare them to real data on my ThinkorSwim platform.
Is this a test environment problem? I don't have confidence to go live with this if the data on which I am basing my trading rules is incorrect.
Here is how I am initializing it: Note that even EMAs are wrong too, but I am trying to get BBs and KCs to work first. Relevant code given below:
I have added long entries and can confirm that values are completely off. Here is one example that you can check yourself with SPY data for 1-3-2022 date. Note that all BB and KC values are wrong:
[2022-01-03 Monday] SPY Squeeze Check: BB Upper: 478, BB Lower: 474, KC Upper: 480, KC Lower: 472, Squeeze: True
//Here I am initializing SPY for example.
var equity = AddEquity(ticker, Resolution.Daily);
equity.SetDataNormalizationMode(DataNormalizationMode.Raw);
//Setting up indicators for SPY. All this is happening in Intialize() function
_ema8[ticker] = EMA(ticker, 8, Resolution.Daily);
_ema21[ticker] = EMA(ticker, 21, Resolution.Daily);
_ema34[ticker] = EMA(ticker, 34, Resolution.Daily);
_bollingerBands[ticker] = BB(ticker, 20, 2, MovingAverageType.Simple, Resolution.Daily);
_keltnerChannels[ticker] = KCH(ticker, 20, 1.5m, MovingAverageType.Simple, Resolution.Daily);
Dee Znut
I found out that if I drop the resolution of the equity to Hourly, the indicators which need daily data start working perfectly. Mia needs to calm down, she doesn't give any good answers ever.
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!