What do you think "already defind" means?
Select the Statement and press "F1".
eddie:
What do you think "already defind" means?
Select the Statement and press "F1".
I see that already defined means I have declared MqlDateTime as a struct data type and so I cant declare it again. But, how come for example in the following code i can assign a struct data type as tradeSettings and then define this object as trade which then allows me to access the member variable of the structure
to create the slippage object. But, in the above code it doesn't let me define a new object as time using the declared MqlDateTime object? I've taken this all from the MQL4 reference and doesn't appear to work for me.
void OnInit() { struct tradeSettings { ulong slippage; double price; double stopLoss; double takeProfit; string comment; }; tradeSettings trade; ulong slippage = trade.slippage = 50; Print(slippage);
renzbub: I have declared MqlDateTime as a struct data type and so I cant declare it again.
Wrong, you have declared it as a struct; that is the second declaration. Compare your code with the example MqlDateTime - MQL4 Documentation
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In the following code i always see error 'MqlDateTime' - struct or class already defined
I cant see why?
struct MqlDateTime