2 Symbols Plotted One Over The Other With Different Studies Applied To Each


Category:
0
0

Hi Peter,

Is it possible to plot 2 different symbols on a chart, one atop the other (meaning 2 separate graphs) with different studies applied to each? The tech support at Thinkorswim says no but I find it hard to believe it can’t be done particularly as free resources such as stockcharts.com provide this capacity. Thank you for any response.

RESOLVED
Marked as spam
Posted by (Questions: 3, Answers: 8)
Asked on March 8, 2020 9:34 am
140 views
0
Private answer

You will need to post this again and this time include a screenshot from stockcharts.com so we can see what this looks like. Because from your technical description this is no different than plotting two separate charts on a chart grid "(meaning 2 separate graphs)". One on top and the other on the bottom.

Edit: After the screenshot was provided in the comments section below this answer I have something to add to this answer:

Yes, it is possible to do something like this with a custom chart study. But it will plot the alternate ticker symbol in the lower subgraph, just like any chart study you might add to the chart. There is no way to do this without writing a custom chart study. Any chart studies you want to add to this alternate ticker symbol will need to be hard coded into the custom chart study that plots the alternate ticker symbol. So basically, there is not way to to do this using any chart settings.

To plot the VIX as a single line in the lower subgraph it only takes two lines of code:

declare lower;
plot data = close("VIX");

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 8, 2020 10:10 am
0
Hi Peter, Is it possible to plot 2 different symbols on a chart, one atop the other (meaning 2 separate graphs) with different studies applied to each? The tech support at Thinkorswim says no but I find it hard to believe it can’t be done particularly as free resources such as stockcharts.com provide this capacity. Thank you for any response. Here is an example using VIX and the SPX: http://schrts.co/RvVfqHqv
( at March 8, 2020 12:50 pm)
0

I have updated my answer to provide a partial solution and explain what is possible on Thinkorswim. The example code I provided will plot the close of VIX as a signal line on the lower subgraph. Change the ticker symbol to whatever you want to display there.

( at March 8, 2020 1:01 pm)
0
Hi Peter, thank you for thoughtfully including the bit of code. It sounds like it is unfeasible to apply studies to the lower symbol (VIX, in this case)--say a couple of moving averages?
( at March 8, 2020 1:09 pm)
0

It is possible to apply virtually any chart study you want. However this cannot be down by simply adding an existing chart study to the chart. You can only do this by including the full code to compute the custom chart study within the same code that plots the alternate symbol.

Here is an example of that same chart study with a single moving average included:

declare lower;
plot data = close("VIX");
plot maOne = MovingAverage(AverageType.SIMPLE, data, 21);

( at March 8, 2020 4:40 pm)
0
Wow, that's interesting and a bit pathetic that tech support on Thinkorswim is not aware of that! Is it possible to do this with a Hull moving average also (i.e.do I just change the "AverageType" above to "AverageTYpe.HULL, data, 21"?
( at March 8, 2020 4:59 pm)
0
Yep, you got it.
( at March 8, 2020 5:59 pm)
0
Is it possible to display the HUll so it is green when it turns upwards and pink when it turns downwards?
( at March 8, 2020 7:48 pm)
0
Yes, you can copy the code that does this from the built-in study that comes with Thinkorswim. The study is named HullMovingAvg.
( at March 8, 2020 8:17 pm)
0
Thank you. How do I juxtapose that with the code you thoughtfully provided?
( at March 8, 2020 8:36 pm)