Hi, I am a long time TOS client and use a Fractal based Strategy for the core of my work. The strategy study is lengthy, and I run a watch list of 98 names. Currently I must run the strategy on each name separately and note the direction and date manually.
Would it be possible to edit the strategy script to produce a column notation for the last date triggered and the direction triggered?
if a study is long and complicated, there is a chance that it may not work as a column study.
how i convert a chart study to be a column study. i make a temporary lower study, so i can see what it is doing, while i convert it and debug it.
when it seems to work, i paste it into a column study.
. create a copy of chart study
. copy the code, ctrl-A , ctrl-C
. create a new study and paste in the code , ctrl-V
. add declare lower; to make it a lower study.
.
. disable chartbubbles
. disable addlabels
. replace all of the plot functions with def
. disable plot parameters, color, dashes,..
.
. add ONE new output function.
plot (1 number)
OR
addlabel ( 1+ variable)
by disable, i mean add # in front of the code line, or change the visible paramerer to 0.
(some of these steps may not be needed, but it's how i do it).
if there are more than one output function in a column study, what is displayed may not be as expected or it may go by the 1st output function in the code.
you mentioned displaying 2 things,
trigger date and direction. so addlabel should work.
an example,
addlabel(1, date1 + "|" + dir1, color.cyan);
In a column study, the color in addlabel is the font color, not the background color.
you may want to change the color of the cell background in the column. Use something like this,
assignbackgroundcolor( if cond1 then color.green else if cond2 then color.red else color.gray );
note: it may take several minutes for a watchlist study to update.
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddLabel
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AssignBackgroundColor
hal_col