String Global Variable

 

The function GlobalVariableSet needs a double parameter.

I'd like to store a string value like "ABC" as a global.

Is this possible?? Thanks.

 
michaelMNB:

The function GlobalVariableSet needs a double parameter.

I'd like to store a string value like "ABC" as a global.

Is this possible?? Thanks.

possible with your own custom solution..

create array of string in include file, include the file in any of your mql file and use the double value taken from global variable, cast to integer as index reference to the string array

 
michaelMNB:

The function GlobalVariableSet needs a double parameter.

I'd like to store a string value like "ABC" as a global.

Is this possible?? Thanks.

This could work:

  • Use GlobalVariable to store a number. Create a file with such number. Write text to file.
  • Read GV vaule, read the corresponding file
  • If GV is deleted, also delete the file
 
michaelMNB:

The function GlobalVariableSet needs a double parameter.

I'd like to store a string value like "ABC" as a global.

  1. Do you understand the terminal variables (GlobalVariableSet) are accessable to all code? Are you really trying to share data with other code?
  2. GVS requires two parameters, a double value and a string name. Make the name a prefix+"ABC". Then you can go through the list, filter by prefix and read your string.
Reason: