Is it possible to access indicator values across chart windows and workspaces in MC (PowerLanguage version)

Questions about MultiCharts and user contributed studies.
svfutures24
Posts: 16
Joined: 19 Dec 2023
Has thanked: 1 time

Is it possible to access indicator values across chart windows and workspaces in MC (PowerLanguage version)

Postby svfutures24 » 24 Feb 2024

Hi everyone

I hope you're keeping well.

I suppose this will be the first time posting on a topic properly. I've tried to search the discussion board and can't find anything related to this topic. I could be totally wrong. Please send me to a resource if need be.

I will try to be clear on what I am attempting to do with Multicharts (PowerLanguage version only).

I have 5 different workspaces containing 20 Stock Ticker chart windows each. Total of 100 tickers.

I will try to give a basic example here. Let's suppose I had the following code for argument's sake, and it was an indicator applied to each ticker:

Code: Select all

vars: openP(0), upperPivot(0), pricetradingabove(0); openP = OpenS(0); upperPivot = OpenP + (HighS(1) + LowS(1)); if close crosses above upperPivot then pricetradingabove = 1 else pricetradingabove = 0; plot1(pricetradingabove,"PAbove");

So each chart window will have the indicator applied and will output either a 1 or a 0. I want to create an indicator that can access the values of each ticker across each of the 5 workspaces and tally the number of tickers that had an output = 1 and get a ratio.

I appreciate this may not be the most elegant way of coding such a solution either. If you think there is a mor efficient way in accessing the data i'm all open ears.

Is this even possible to do in Multicharts PowerLanguage version? The example above is simple but the same concept can be applied to a variety of ideas which is why I ask.

Please excuse my ignorance. I have read about Global Variables and the like but unsure if that is what is required here. It's all confusing in honesty.

I would appreciate if anyone can help and guide me to relevant resources.

Much appreciated.

Kind regards,

svfutures

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Is it possible to access indicator values across chart windows and workspaces in MC (PowerLanguage version)

Postby TJ » 25 Feb 2024

Global Variables can help.

You can use the sample codes to see if that would work for you.

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Is it possible to access indicator values across chart windows and workspaces in MC (PowerLanguage version)

Postby TJ » 25 Feb 2024

To transfer data between indicators within the same chart,
you can use

i_getplotvalue
i_setplotvalue


Please see the wiki for details.

svfutures24
Posts: 16
Joined: 19 Dec 2023
Has thanked: 1 time

Re: Is it possible to access indicator values across chart windows and workspaces in MC (PowerLanguage version)

Postby svfutures24 » 26 Feb 2024

Hey

Thanks for your reply TJ. Much appreciated.

I'm unsure if I was clear in my initial. Transfer of data within the same chart is not want I want.

Lets say I have 100 chart windows open across a few different work spaces. Each chart has a unique ticker loaded. And each chart will also have an indicator applied. For arguements sake the indicator outputs a value of 0 or 1. Value of 1 when close is above an upper Pivot and value of 0 if close is below upper pivot.

The master indicator's role is to sum (get the total of) output values = 1. Then get the ratio. For example, if 60 tickers had a close above upper pivot then 60 out of 100 total tickers would have a value of 1, i.e. a ratio of 0.60.

So, I don't think its data transfer within the same chart. Rather across chart windows and workspaces.

Let me know if I am making any sense? Thanks.

svfutures24
Posts: 16
Joined: 19 Dec 2023
Has thanked: 1 time

Re: Is it possible to access indicator values across chart windows and workspaces in MC (PowerLanguage version)

Postby svfutures24 » 26 Feb 2024

Also, it seems GV are applicable for real time information only?


Return to “MultiCharts”