Plot another Symbol Study on Lower Panel


Category:
0
0

Hi Pete.

Simple question here. Is it possible on Thinkscript to plot on one chart a Study from another symbol ?

Not meaning the H/L/C but a more complex study.

An image as an example. I managed to plot your Hi/Low Study Study on the Lower Panel on a zero line. Is it possible to plot several studies from different symbols on the same Panel ? If so pls refer me to an example to use as a base.

I should reference all the code to a specific symbol instead of the active symbol on the chart, but not sure how to do that and if it’s possible.

Tks,

Attachments:
RESOLVED
Marked as spam
Posted by (Questions: 4, Answers: 8)
Asked on April 2, 2020 2:00 am
509 views
0
Private answer

This is how you reference data for a ticker symbol other than the one that is plotted on the chart:

def priceHigh = high(symbol = "SPY");

Let's say you wanted to do that to the close price instead of the high. We'll also apply this to a simple moving average. So that we end up with a plot of a simple moving average that is computed for a ticker symbol other than the one that is plotted on the chart:

def priceClose = close(symbol = "SPY");
def alternateSMA = Average(priceClose, 50);

That gives you the basics. Without seeing your code I am not able to give you a more specific answer than this.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 2, 2020 7:18 am
0
Worked like a charm !!! Tks....I knew it was probably a simple or syntaxis issue The only concern is I plot 4 studies (diff Symbols) on a Lower Panel and can not get to see all of them. It plots 3 on a 0-100% scale, when I wrote in the code to be plotted at lines 0,1,2,3......any ideas why? Should I just group in one study 4 repetitive group of codes one for each symbol? I have an Image but can't add it on the comment section. Thanks so much
( at April 2, 2020 9:53 am)
0
A screenshot would not provide any clues as to what is going on. Need to view the code. There is no "blanket solution". Each case must be worked out independently. Don't bother posting your code here as the solution will likely require far more time to solve than I permit for a free solution in the Q&A forum.
( at April 2, 2020 10:36 am)
0
Tks. U can mark as solved, as I can not w/o sending a Solution, which u sent already.
( at April 5, 2020 9:47 pm)