Calling an indicator from another chart

Questions about MultiCharts and user contributed studies.
scrichley
Posts: 8
Joined: 20 Jul 2022

Calling an indicator from another chart

Postby scrichley » 09 Jul 2023

Good morning,

I'm working on an ETF mean reversion signal in Powerlanguage using daily bars. Basically, I'd like to buy SLV when it's oversold (RSI(2) < 10 for example) AND the S&P 500 (or XLY) is above the 200d moving average. Is there a simple way to code this without calling a separate data series for SPY?

Pattern1 = C > Average(C,200) <-- buying SLV, but I want to buy only when SPY > 200d moving average

Thank you, Shawn

User avatar
TraderGuy
Posts: 28
Joined: 30 Nov 2009
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: Calling an indicator from another chart

Postby TraderGuy » 09 Jul 2023

I don't know of a simpler way than adding SPY as Data 2 and creating the SMA.

viewtopic.php?t=6929#p35429

Something like:

Code: Select all

Var: SMASPY(0, data2 ); SMASPY = Average_FC( Close, 200 ) of data2;

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: Calling an indicator from another chart

Postby sptrader » 11 Jul 2023

You might try using global variables, that should work.


Return to “MultiCharts”