Thank you Howard.
DaysLoaded needs DaysRequired also.
For the MACD, ADX, etc indicators, I dont know what the minimum number of periods are needed to get the job done. But I have used 100 as a default.
The following is a example that should help when it comes to this regard - especially when you want to get IPO stocks or ones who have recently been added to the database.
------------------------------------------------------- DaysToLoad = 100; // set to the min # of periods needed in // your analysis DaysRequired=1; // at least one to get IPOs // DaysLoaded requires this to be set
if daysLoaded > 0 then // do all basic analysis here print Symbol; print ","; print Description; print ","; print IndustryGroup; print ","; print IndustrySector; print ","; print close(0); print ","; print Vol(0); print ","; print InstHold; print ","; print beta;
// etc. endif;
if daysLoaded > 10 then // do all 1 to 10 day analysis here print AvgVol(0, -9); print ","; endif;
if daysLoaded > 100 then // do all 1 to 100 day analysis here print MACD(0):8:0; print ","; print ADX(0):8:0;
// etc endif;
println;
If you dont section your code off this way, QP will toss out the symbol entirely if there are not enough data points available by default. This way, you can still obtain data for what is available.
Thanks for you help. |