Global Variables: Difference between revisions
From MultiCharts
→Understanding Global Variables
Line 3: | Line 3: | ||
Global Variables is an external .dll file that can be used to pass values between strategies on separate charts and third party applications. | Global Variables is an external .dll file that can be used to pass values between strategies on separate charts and third party applications. | ||
The information is stored in a shared memory space. External processes can access the data in the memory for further operations.<br> | The information is stored in a shared memory space. External processes can access the data in the memory for further operations.<br> | ||
When a customer uses Global Variables it is important to determine the read-write action time because the actions are performed in the script calculation. | |||
<br> | |||
Global Variables work between different MultiCharts processes of the same bitness if they use the same GlobalVariable.dll (that is stored in the same place). | |||
Thus, it is possible to pass values between: | |||
<br>MultiCharts 32bit and MultiCharts 32bit | |||
<br>MultiCharts 64bit and MultiCharts 64bit | |||
<br>MultiCharts .NET 32bit and MultiCharts 32bit | |||
<br>MultiCharts .NET 64bit and MultiCharts 64bit | |||
== Example == | |||
From MultiCharts, the Global Variables functionality is accessed by PowerLanguage functions: | From MultiCharts, the Global Variables functionality is accessed by PowerLanguage functions: | ||
<syntaxhighlight>AccuracyGetNamedDouble | <syntaxhighlight>AccuracyGetNamedDouble | ||
Line 9: | Line 17: | ||
AccuracySetNamedDouble | AccuracySetNamedDouble | ||
AccuracySetNamedInt</syntaxhighlight> | AccuracySetNamedInt</syntaxhighlight> | ||
All global variables use the same principle – it is required to specify the name that is attached to a value to get this value.<br> | All global variables use the same principle – it is required to specify the name that is attached to a value to get this value.<br> | ||
<syntaxhighlight>value1 = AccuracyGetNamedDouble("Double_VariableName"); | <syntaxhighlight>value1 = AccuracyGetNamedDouble("Double_VariableName"); | ||
Line 16: | Line 23: | ||
<syntaxhighlight>AccuracySetNamedDouble("Double_VariableName", 0.05); | <syntaxhighlight>AccuracySetNamedDouble("Double_VariableName", 0.05); | ||
AccuracySetNamedInt("Int_VariableName", 50);</syntaxhighlight> | AccuracySetNamedInt("Int_VariableName", 50);</syntaxhighlight> | ||
== Additional info == | |||
Additional info | |||
* our discussion forum: | * our discussion forum: | ||
MultiCharts 32-bit - http://www.multicharts.com/discussion/viewtopic.php?t=2483 <br> | MultiCharts 32-bit - http://www.multicharts.com/discussion/viewtopic.php?t=2483 <br> | ||
MultiCharts 64-bit - http://www.multicharts.com/discussion/viewtopic.php?f=5&t=9870 <br> | MultiCharts 64-bit - http://www.multicharts.com/discussion/viewtopic.php?f=5&t=9870 <br> | ||
* Futures.io discussion forum: https://futures.io/easylanguage-programming/3502-global-variables-gv-easylanguage-tradestation-multicharts.html <br> | * Futures.io discussion forum: https://futures.io/easylanguage-programming/3502-global-variables-gv-easylanguage-tradestation-multicharts.html <br> | ||