Discussion of article "Backpropagation Neural Networks using MQL5 Matrices" - page 3 123 New comment Stanislav Korotky 2024.04.16 17:34 #21 To work on netting accounts, it is necessary to add an explicit symbol indication to the ClosePosition function: bool ClosePosition() { // define an empty structure MqlTradeRequest request = {}; ... // fill in the required fields request.action = TRADE_ACTION_DEAL; request.position = PositionGetInteger(POSITION_TICKET); request.symbol = _Symbol; const ENUM_ORDER_TYPE type = (ENUM_ORDER_TYPE)(PositionGetInteger(POSITION_TYPE) ^ 1); request.type = type; request.price = SymbolInfoDouble(_Symbol, type == ORDER_TYPE_BUY ? SYMBOL_ASK : SYMBOL_BID); request.volume = PositionGetDouble(POSITION_VOLUME); ... // send the request ... } Stanislav Korotky 2024.04.16 17:38 #22 Forum on trading, automated trading systems and testing trading strategies Discussion of the article "Back propagation neural networks on MQL5 matrices" Stanislav Korotky , 2024.04.16 17:34 To work on netting accounts, you need to specify symbol explicitly in the ClosePosition function: bool ClosePosition() { // define empty struct MqlTradeRequest request = {}; ... // fill in required fields request.action = TRADE_ACTION_DEAL; request.position = PositionGetInteger(POSITION_TICKET); request.symbol = _Symbol; const ENUM_ORDER_TYPE type = (ENUM_ORDER_TYPE)(PositionGetInteger(POSITION_TYPE) ^ 1); request.type = type; request.price = SymbolInfoDouble(_Symbol, type == ORDER_TYPE_BUY ? SYMBOL_ASK : SYMBOL_BID); request.volume = PositionGetDouble(POSITION_VOLUME); ... // send the request ... } Discussing the article: "Gain PositionGetDouble(POSITION_PROFIT) - which currency? Features of the mql5 Renat Akhtyamov 2024.04.16 20:36 #23 An article well worth reading. Thank you! Andrey Dik 2024.04.16 21:16 #24 Thank you, very good article! For some reason I had overlooked it. 123 New comment
To work on netting accounts, it is necessary to add an explicit symbol indication to the ClosePosition function:
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "Back propagation neural networks on MQL5 matrices"
Stanislav Korotky , 2024.04.16 17:34
To work on netting accounts, you need to specify symbol explicitly in the ClosePosition function:
An article well worth reading.
Thank you!
Thank you, very good article!
For some reason I had overlooked it.