AccuracySetNamedDouble / AccuracyGetNamedDouble  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
Riembaus
Posts: 19
Joined: 28 May 2021
Been thanked: 2 times

AccuracySetNamedDouble / AccuracyGetNamedDouble

Postby Riembaus » 03 May 2023

Hi

I am trying to pass values from my signal to an indicator, using the Global Variables.

In the signal i setup:

Code: Select all

AccuracySetNamedDouble("ema1", emaS);
To retrieve the the value in use the following line in the indicator:

Code: Select all

value1 = AccuracyGetNamedDouble("ema1");
While compiling the signal, everything is fine. However trying to compile the indicator the following error is thrown. The error is easy enough to understand, however it doesn't make sense as the retrieval of Global Variables do NOT require 2 parameters accoring to the documentation.

Code: Select all

------ Compiled with error(s): ------ Invalid number of parameters. 2 parameter(s) expected line 2, column 9
Line 2 is where the aforementioned code is placed.

Any and all input is welcome.

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: AccuracySetNamedDouble / AccuracyGetNamedDouble  [SOLVED]

Postby Vlada MultiCharts » 03 May 2023

Hello Riembaus,

The function AccuracyGetNamedDouble requires two parameters, as well as AccuracyGetNamedInt. We will make corresponding changes in our documentation.

The second parameter stands for the error code that function will return. For example:

AccuracyGetNamedDouble("string", 1111);

If something goes wrong, the function will return 1111, otherwise it will return the expected value.

User avatar
Riembaus
Posts: 19
Joined: 28 May 2021
Been thanked: 2 times

Re: AccuracySetNamedDouble / AccuracyGetNamedDouble

Postby Riembaus » 05 May 2023

Thank you, that clears up the error.

Next thing to deal with is that the value does not update. It is an EMA value, which is calculated on every bar in the signal and passed to the global variable.

The value is updated in the signal, but not in the indicator, resulting a single straight line.

If I call the global variable from the signal, the value does up, but not in the indicator.

User avatar
Riembaus
Posts: 19
Joined: 28 May 2021
Been thanked: 2 times

Re: AccuracySetNamedDouble / AccuracyGetNamedDouble

Postby Riembaus » 05 May 2023

Fixed it.

Seems like the variable to stuck in memory or something, restart of Multicharts fixed things.

Thank you for the assistance.


Return to “MultiCharts”