SQX 111 - Small change to MQL generated suggested

Hi,



I have trading an EA generated by SQX and I notice the log in MT4 says


"Opening order type BUY with price 1.xxxxxx. Current market prices: 1.yyyyyyyy / 1.zzzzzzzz" in  function sqOpenOrder


But the buy order is never placed.  This is because this log message appears before a check is made whether the trade should be placed:



   Verbose("Opening order type ", OrderTypeToString(orderType)," with price ", price, ". Current market prices: ", ask, " / ", bid);    openingOrdersAllowed = openingOrdersAllowed && sqHandleTradingOptions();        if(!openingOrdersAllowed) return(0);    // check if live order exists    if(sqSelectOrder(magicNumber, symbol, 0, comment) && !allowDuplicateTrades) {       Verbose("Order with these parameters already exists, cannot open another one!");       Verbose("----------------------------------");       return(0);    }





I would suggest moving the yellow highlighted line to after the green highlighted lines so the the "Opening order ... " message only appears if opening orders is currently allowed.


Otherwise it looks like the EA tried to open and order but for some reason MT4 didn't receive the order open.


Thanks,


Mike

Attachments
No attachments
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

m
#1

mikeyc

10.10.2018 18:59

Task created

m
#2

mikeyc

15.10.2018 19:06
Voted for this task.
TB
#3

Tomas Brynda

14.06.2019 15:15

Status changed from New to Fixed

It has been done, thank you for your suggestion.


Best regards,

Tomas


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please