Page 1 of 1

Native Support for Global/Static Variables Feedback

Posted: Jul 05 2024
by Kate MultiCharts
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.

Re: Native Support for Global/Static Variables Feedback

Posted: Jul 13 2024
by rokanten
i need it to adjust my long/short positions and to get some result values.

Re: Native Support for Global/Static Variables Feedback

Posted: Jul 18 2024
by Smoky
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)

Re: Native Support for Global/Static Variables Feedback

Posted: Jul 29 2024
by strelow
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 .

Re: Native Support for Global/Static Variables Feedback

Posted: Aug 27 2024
by Luto
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.