Guys I am in some trouble here,
I have a strategy that needs a minute res in the initialize function but I cannot for the life of me figure out how to be able to get the 14 day ATR every single day. I am getting something to do with the minute res every single time.
Does anyone know the answer to this?
Here is the code I was working with!
Thank you!
Nico Xenox
Hey Jesse Fleming
I added a few lines of code:
Also if you have so much data to print it would be smarter to just Plot it:
So you dont have to worry about hitting the log limit, hope it helps! ;)
Jesse Fleming
Hey Nico Xenox,
Thank you so much for your response, I backtested the code you have provided for me and it gave me the same answers as before!
They are all ATR's on a minute resolution for some reason.
I am having trouble being able to document the 14 day ATR every single day!
Best,
Jesse
Nico Xenox
Hey Jesse Fleming
Sry about that, it should work now. If it still doesnt print the needed values let me know ;)
Jesse Fleming
Hey Nico!
I need your guidance.
Still having some issues with the discrepancies between TradingView and Quant. Please help! I do not know what I am doing wrong to get these massive numbers.
Thank you so much for helping me out and thank you for your time!
Jesse
Nico Xenox
Hey Jesse Fleming
There are a few things that might bring you closer to your objective, note that QC and Tradingview probably use different data vendors and also compile them differently so you wont get the exact same data.
Either way this is what I did to get nearly the exact same data as TradingView:
This way you receive the same numbers with a deviation of 0.0X.
Data compared: 2022, 8, 1 - 2022, 9, 1 (QC with TradingView) nearly identical
Jesse Fleming
Hey Nico Xenox,
We have ensured all the correct settings.
Yes, the ATR from your selected time frame compared to TradingView are quite close. However, Sept.1, 2020 - Oct.1, 2020, the discrepancies are still enormous. As well as many other time frames, this one just seems to be the biggest for some reason. The problem is, we need to backtest over long periods of time and if all the numbers aren't accurate, our entries and exits will also not be. Is there something we are doing wrong? Or can we not confidently use ATR in Quant.
Nico Xenox
Hey Jesse Fleming
I played around a little bit more and tried different data normalization modes. TotalReturn throws around the date that you guys are testing better results. When changing the data nromalization mode you also should consider playing around with the smoothing of TradingView. Changing the data mode worked best with “RMA” on TradingView. You should probably play around a little bit more and look which ones fits the best for your case.
It might also help to raise the warm up period by 5 times of the Indicator value. (Just some thoughts)
Hope it helps ;)
Jesse Fleming
Nico Xenox Thank you for all your help Nico. I really appreciate it.
If you do not hate me already, I have one more question for you.
This is my attempt at manually creating an ATR calculation. I have a hunch that this question will be very easy for you to answer as you have been answering much more difficult ones.
I have calculated 14 day ATR and just need to be able to grab the previous day's ATR value, so that I can use a smoothing factor. How can I do this? Here is some code to help understand what I am getting at.
Also, what would I do with the smoothing factor once it is calculated? Do I multiply it by the ATR?
Nico Xenox
Hey Jesse Fleming
I usally dont produce my own indicators, I make use of the ones that QC has to offer. After reading your question I would say there are two possible ways I came up with.
For the second question, I cant answer you as I dont produce my own indicators. Someone else will have to help you with that.
Jesse Fleming
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!