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 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
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
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- 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