can someone help me out on this following question?
I like to create a new thinkscript indicator adding a reference to one of my custom indicator. can you show me how to do that if thinkorswim allow me to do so?
Referencing Pre-Defined Studies
thinkScript allows you to reference studies that are already available on the Charts tab in your code. You use the reference keyword to do this.
plot SMA = reference simplemovingavg;
plot SMA = simplemovingavg();
will plot a simple moving average with the default parameters of that study. So long as the study name is followed by parentheses, you don't need to include the word 'reference'. You can change the parameters of the study within reference by inputting them between parentheses.
plot SMA = simplemovingavg(price = volume, length = 20);
will plot a 20 day moving average of the volume. To see the input parameters of a particular study, click on that study in the 'Edit Studies' section of the Charts tab. You will see the available parameters listed in the study properties section.
By default, the first plot of a study is always referenced. However, you can specify the plot you want to reference, as well.
plot bear = reference ElderRay."BearPower"
plot bear = ElderRay(length = 6)."BearPower"
Strategy ≥ Money
The following 4 users say Thank You to Massive l for this post: