♥ 0 |
Hello Sir, I want to say thank you for all you do. I really love this Vidya indicator and I’m trying to build the scan but it always returns no results. I want to get the scan results of the vidya1 crosses above the vidya2. My script for the scan. Ray_Vidya2().”pVidya1″ crosses above Ray_Vidya2().”pVidya2″ within 10 bars
Marked as spam
|
Private answer
You really want to avoid trying to reference the name of a custom study. To many things can prevent that from work correctly. There are some tools on Thinkorswim for which this will not work at all. So for mission critical solutions it's always best to use the entire code rather than reference the name of a study, even if the study is one of the built-in studies. I reduced your code down to the bare essentials required to produce a scan and this is what is left:
Now I also see that in your suggested scan code you included a condition that checks if the crossover signal was true within the last ten bars. I can provide a couple of additional scan statements that will cover that too:
Those four lines of code can be used in place of the last four lines of code in the solution I provided above. Marked as spam
|
|||||
Private answer
This is an update to my previous answer. I am only adding a new answer to this question so that I can provide screenshots to support the explanation below. Your chart needs to have more than 3 months of data to fully compute these lines. On the daily time frame the scan is using approximately 2 years of data: https://toslc.thinkorswim.com/center/howToTos/thinkManual/Scan/Stock-Hacker/studyfilters When I load 1 year of data on the chart the values appear to be fully computed. When I load 6 months of data it also fully computes the values (see screenshot below). It seems that something less than 6 months of historical data is where this fails to properly compute. Want to know what is happening here and why the amount of data loaded on your chart is impacting the computation of these lines? https://www.hahn-tech.com/moving-averages-exponential-problems/ Your code is computing the standard deviation for 20 periods. It then takes that average and folds it inside a moving average. It then divides that standard deviation by the average. The end result is code for which Thinkorswim is unable to prefetch sufficient historical data to fully compute the values. One way you may provide a more robust computation is to use a CompoundValue() statement to initialize each line at the value of the close for the first bar on the chart. This should help to reduce the number of historical bars required to fully compute these values. In plain English? The code is poorly written. See the second screenshot below for the graphical explanation. Marked as spam
|
Please log in to post questions.