I always thought “Raw” prices display the actual price one can see in charts, however, looking at raw vs adjusted prices during coarse Universe selection, it seems as if the adjusted price is more accurate? Take a look at the example in the backtest. During universe selection, I debug print the raw (stock.Price) and adjusted (stock.AdjustedPrice). The raw price is way off the actual closing value of ZSAN on 2022-04-11. The second debug print is a random price check at 09:30 2022-04-12. Should I use adjusted price in universe selection? If so, is it best to set DataNormalization to Raw in SetSecurityInitializer? I want the price to be the “actual” price you see in traditional charts. Getting the universe price right is important as I want to store yesterday's close.
2022-04-12 00:00:00, TICKER: ZSAN, RAW: 0.1202, Adjusted: 4.207
2022-04-12 09:30:00, TICKER: ZSAN, Price: 3.66
Fred Painchaud
Hi Haakon,
This is mostly about preferences. Some prefer chocolate cakes because it tastes like chocolate. Others prefer vanilla cakes because it tastes like vanilla. 😊 I chatted with people who attributed some advantages to using raw data because, you know, it is the raw data 😊 (untouched? pure? dunno). Others prefer adjusted data because, you know, it's been adjusted so it is better!
You get the idea…
Adjusted data has been adjusted to splits and dividends but also, and I would say most importantly, sometimes adjusted because it was incorrect. So I like to use adjusted data.
But in my mind, the most important factor re data correctness in an algo is to be ductile/robust to sudden and short-lived incorrect data (or no data at all). In other words, to be able to filter out outliers. They should not be frequent and they should not be long-lived (like long streaks of outliers), but they certainly exist and there's nothing you can do to 100% avoid them. So I try thinking:" What happens with my algo if all of a sudden, say for example, I get a bar with a closing price of 4$ and I was dealing with 100$ the bar before? Which resolution am I at? Is it so important at that resolution to react instantly to that 4$? " etc….. Of course, I first design the usual use cases of the algo but once it looks good on good data, I try to investigate on what to do when (not if) bad data ships in…. Just like scenarios around no data. What if fillforward is true and in fact, there is no data. Do I get the same bar over and over again? Does the algo detect that? If fillforward is false and I do not get any data, what's the algo reaction? etc….. corner cases, basically. They will happen anyway….
My 2 cents.
Fred
Haakon
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!