struct slow_strategy { string symbol = "USDCHF"; //int stuff1; //double stuff2; //double stuff3[100]; }This works with me
You can do it like that, but don't but the {} around the string:
struct slow_strategy {string symbol = "USDCHF"};
You can do it like that, but don't but the {} around the string:
thanks all of you
i find out that {} is use for set all the structure_name member to "USDCHF" , does it?
like
FILETIME access_ft = {0};
SYSTEMTIME access_st = {0};
You would use {} if you were trying to fill up an array on construction:
char name[] = {'U', 'S', 'D', 'C', 'H', 'F'};
You can do it like that, but don't but the {} around the string:
the code you mention still have compile error: '=' - variable is expected
at line 2
struct slow_strategy {string symbol = "USDCHF"};
how to solve?
thanks
the code you mention still have compile error: '=' - variable is expected
at line 2
how to solve?
thanks
struct slow_strategy { string symbol; }; //... slow_strategy ss; ss.symbol = "USDCHF"; //...
well then just declare it first, and then give symbol the value USDCHF
thanks ifmihai, it works now
i turn out that i have declare ss as a object to structure (slow_strategy )
ss= object
thanks ifmihai, it works now
i turn out that i have declare ss as a object to structure (slow_strategy )
ss= object
I am not familiar with objects in mql5...yet.
but it's good you worked it out:)
thanks ifmihai, it works now
i turn out that i have declare ss as a object to structure (slow_strategy )
ss= object
I turn out that the problem come from have not declare ss as a object to structure (slow_strategy )
that is
slow_strategy ss;
is missing in my .mq5 file
Thankyou to all of you
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
struct slow_strategy
{string symbol = {"USDCHF"} };
can i write like this ?
that is the first time i use data struct
thanks