♥ 0 |
Hello, As part of a larger scan that I’m running in Thinkorswim, I screen for stocks above their 200-day moving average. An issue that is occurring is the removal of stocks that meet all the other criteria but don’t have 200 days of trading data. I’m trying to resolve the issue by using barnumber() in the script. However it still reverts to using the 200 day. Below is the code that I created. Any help in fixing the issue would be greatly appreciated. def MovingAvgcount=if barnumber() < 200 then average(close,50) else average(close,200); Thanks
Marked as spam
|
Please log in to post questions.