Help with Global Variables  [SOLVED]

Questions about MultiCharts and user contributed studies.
kagein
Posts: 55
Joined: 12 Oct 2017
Has thanked: 16 times
Been thanked: 10 times

Help with Global Variables

Postby kagein » 04 Jun 2019

When i try the code below i get a value of 1500 instead of the close[1] + open[1], where am i going wrong?

Code: Select all

vars: irtnval(0); iRtnVal = GVSetDouble( 1500, Close[1] + Open[1] ); print(irtnval);

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Help with Global Variables

Postby ABC » 05 Jun 2019

kagein,

the return value of GVSetDouble is the element location and not the value you stored.

Regards,

ABC

kagein
Posts: 55
Joined: 12 Oct 2017
Has thanked: 16 times
Been thanked: 10 times

Re: Help with Global Variables

Postby kagein » 05 Jun 2019

How do i go about checking if the stored value is what i want it to be?

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Help with Global Variables  [SOLVED]

Postby ABC » 05 Jun 2019

kagein,

if GVSetDouble returns the element location the value was stored. Otherwise it would return -1. To retrieve a value at an specific location you can use the corresponding GVGet... functions.

You might find the Global Variable documentation and examples helpful (it should be available here in the forum).

Regards,

ABC


Return to “MultiCharts”