Native Support for Global/Static Variables Feedback

Questions about MultiCharts and user contributed studies.
User avatar
Kate MultiCharts
Posts: 667
Joined: Oct 21 2020
Has thanked: 13 times
Been thanked: 174 times

Jul 05 2024

Dear Customers,

We are currently reviewing the feature request for native support for Global/Static variables (please see the Project Management post here), and we would greatly appreciate your feedback to help us find the optimal solution that fully meets your needs.

If you are using GlobalVariables.dll in your setup, please briefly describe how you use it and any issues you encounter.

Here’s an example:

I use GlobalVariables.dll in all my strategies to dynamically adjust Money Management parameters and to control the opening of long or short positions.

Issues:
  1. Another script can overwrite the data in the slot used by my strategies.
  2. During strategy optimization, only one CPU core is utilized, despite having 16 available.


Your insights are valuable to us as we work towards enhancing our features.
Please feel free to share here, at the Project Management thread or contact us at our support email.

User avatar
rokanten
Posts: 56
Joined: Jul 29 2010
Location: south korea
Has thanked: 18 times

Jul 13 2024

i need it to adjust my long/short positions and to get some result values.

User avatar
Smoky
Posts: 526
Joined: Dec 03 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 125 times

Jul 18 2024

Many thanks to ask us !

the best choice for me should be to use sharedMemory many framwork already existe in C++.

the best of the best sharedmemory with callback function called when the value change ! it will open MC to use IA easyly !

sample:

var: shared double LotNbr(ChangeLot);

LotNbr is a sharedvariable, when LotNbr change value by another tool (third party software, another chart code, ...) the ChangeLot function will be called.

shared memory without callback should be a good start.

(I dont use globalvariables.dll anymore for performance issue)

User avatar
strelow
Posts: 76
Joined: Dec 20 2019
Location: Brazil-SP
Has thanked: 14 times
Been thanked: 3 times

Jul 29 2024

Hello

I am using global variables with some restrition for example

1- When I run a simulation more than one time the previus values make interference I created a counter prefix in the all variable and increase for a new simulation to run well. Do you know any command that clean the value of all global variables ?

2- Optimization result is not possible trust because the global variables when have interactive for optimization happen same problem described in example one . When I want test a value of code I test manual way .

Luto
Posts: 17
Joined: May 18 2022
Has thanked: 4 times
Been thanked: 1 time

Aug 27 2024

As part of this work, I assume that each signal would then have its own namespace and only the Globals would be shared.

Currently, I believe, that any two signals on a chart cannot share a variable name because they will be "shared". I could be wrong, but from my testing that appears to be the case.

So as a precursor, creating a per signal namespace that is private to the signal would be a reasonable partial solution.