Global Variables: Difference between revisions
Tags: Mobile edit Mobile web edit |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
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. 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. | The information is stored in a shared memory space. External processes can access the data in the memory for further operations. | ||
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. | |||
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). | 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: | Thus, it is possible to pass values between: | ||
* MultiCharts 64-bit and MultiCharts 64-bit | |||
* MultiCharts .NET 64-bit and MultiCharts 64-bit | |||
== Example == | == Example == | ||
Line 25: | Line 26: | ||
AccuracySetNamedInt("Int_VariableName", 50);</syntaxhighlight> | AccuracySetNamedInt("Int_VariableName", 50);</syntaxhighlight> | ||
== Additional | == Additional Info == | ||
* | * Our discussion forum: 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> | |||
Global variables can be used in backtesting only in Portfolio Trader, for more info check [[Spread_and_Pair_Trading#Pair_Trading_in_Backtesting|'''this page''']]. | Global variables can be used in backtesting only in Portfolio Trader, for more info check [[Spread_and_Pair_Trading#Pair_Trading_in_Backtesting|'''this page''']]. | ||
[[Category:PowerLanguage]] | [[Category:PowerLanguage]] |
Latest revision as of 13:55, 26 July 2024
Understanding Global Variables
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.
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.
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:
- MultiCharts 64-bit and MultiCharts 64-bit
- MultiCharts .NET 64-bit and MultiCharts 64-bit
Example
From MultiCharts, the Global Variables functionality is accessed by PowerLanguage functions:
AccuracyGetNamedDouble
AccuracyGetNamedInt
AccuracySetNamedDouble
AccuracySetNamedInt
All global variables use the same principle – it is required to specify the name that is attached to a value to get this value.
The second parameter defines the error code that the function will return.
value1 = AccuracyGetNamedDouble("Double_VariableName", -1);
value2 = AccuracyGetNamedInt("Int_VariableName", -1);
In order to remember a value, one needs to assign a name and associate the value with this name:
AccuracySetNamedDouble("Double_VariableName", 0.05);
AccuracySetNamedInt("Int_VariableName", 50);
Additional Info
- Our discussion forum: http://www.multicharts.com/discussion/viewtopic.php?f=5&t=9870
- Futures.io discussion forum: https://futures.io/easylanguage-programming/3502-global-variables-gv-easylanguage-tradestation-multicharts.html
Global variables can be used in backtesting only in Portfolio Trader, for more info check this page.