declare and initialize the trade request and result
Per: https://www.mql5.com/en/docs/basis/variables/initialization
//--- initialization of all fields of the structure with zero values MqlTradeRequest request={0};
The documentation is rather voluminous and perhaps written by many people at different times.
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.
Just create an empty trade request and use it to clean ups.
Or, perhaps, you could try:
ZeroMemory(request);
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