For example, I'd like the top panel to show the chart for SPY, while the lower panel to add a study to show the onblancevolume for another ticker QQQ.
I tried to incorporate the code for onbalancevolume as follows, and it doesn't work:
declare lower;
plot data = totalsum(Sign(close("QQQ") - close("QQQ")[1]) * volume("QQQ"));
However, when I get rid of the totalsum part, and only run the code for the signed volume, it works:
declare lower;
plot data = Sign(close("QQQ") - close("QQQ")[1]) * volume("QQQ");
I am new to thinkcript and am not sure how to fix it. Would appreciate it if you have any suggestions!
I tried to incorporate the code for onbalancevolume as follows, and it doesn't work:
declare lower;
plot data = totalsum(Sign(close("QQQ") - close("QQQ")[1]) * volume("QQQ"));
However, when I get rid of the totalsum part, and only run the code for the signed volume, it works:
declare lower;
plot data = Sign(close("QQQ") - close("QQQ")[1]) * volume("QQQ");
I am new to thinkcript and am not sure how to fix it. Would appreciate it if you have any suggestions!