Is this how to initialise the struct in mql5?
Per: https://www.mql5.com/en/docs/basis/variables/initialization
//--- initialization of all fields of the structure with zero values MqlTradeRequest request={0};
but why leave out the "{0}" or put it in for both examples?
The documentation is rather voluminous and perhaps written by many people at different times.
samjesse:
Hi
Reading code examples in the Documentations, why there are times when this line is used for opening positions
but other times, this line is used for closing positions
Is this how to initialize the struct in mql5? but why leave out the "{0}" or put it in for both examples?
Thanks
MqlTradeRequest request={0}; MqlTradeRequest EmptyTradeRequest={0} request.action = TRADE_ACTION_DEAL; request = EmptyTradeRequest;Just create an empty trade request and use it to clean ups.
Arthur Albano:
Just create an empty trade request and use it to clean ups.
Just create an empty trade request and use it to clean ups.
Or, perhaps, you could try:
ZeroMemory(request);
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
Hi
Reading code examples in the Documentations, why there are times when this line is used for opening positions
but other times, this line is used for closing positions
MqlTradeRequest request;
Is this how to initialise the struct in mql5? but why leave out the "{0}" or put it in for both examples?
Thanks