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
What function, classes/method are you using to send/modify your orders ?
OrderSend() after setting up the MqlTradeRequest
Have you see this (from OrderSend doc) ?
It should be noted that the successful completion of the OrderSend() method operation does not always mean a successful deal completion when placing a market order. Check the retcode value containing trade server return code, and values of deal or order field depending on the type of operation in the returned result.
It would be easier to help in seeing the code.
Have you see this (from OrderSend doc) ?
It would be easier to help in seeing the code.
I check the returned result and only try to place the SL & TP if it returns TRADE_RETCODE_PLACED or TRADE_RETCODE_DONE
I check the returned result and only try to place the SL & TP if it returns TRADE_RETCODE_PLACED or TRADE_RETCODE_DONE
It should be noted that the successful completion of the OrderSend() method operation does not always mean a successful deal completion when placing a market order. Check the retcode value containing trade server return code, and values of deal or order field depending on the type of operation in the returned result.
You have to check deal ticket number :
This isn't last word, if your deal ticket is 0, your modification of SL/TP will not execute anyway. Still searching...
You have to check deal ticket number :
This isn't last word, if your deal ticket is 0, your modification of SL/TP will not execute anyway. Still searching...
I can do that but the issue is that the trade was successful and the position was opened . . yet when I tried to add the SL & TP it failed with Invalid Stops even though they weren't invalid. It seems that I have to wait for something to happen before I can send the request to set the TP & SL . . . but I don't really know what is the official, documented thing that I should be waiting for.
Thanks for the reply :-)
I can do that but the issue is that the trade was successful and the position was opened . . yet when I tried to add the SL & TP it failed with Invalid Stops even though they weren't invalid. It seems that I have to wait for something to happen before I can send the request to set the TP & SL . . . but I don't really know what is the official, documented thing that I should be waiting for.
Thanks for the reply :-)
I know. I am checking all mql5 site to find a response :-D
Edit:
There is absolutely nothing on this site showing how to put a sl / tp with a trade execution type of market.
Actually I have same problem but using PositionOpen in place of OrderSend, I can also do it manually.
I know. I am checking all mql5 site to find a response :-D
Edit:
There is absolutely nothing on this site showing how to put a sl / tp with a trade execution type of market.
Actually I have same problem but using PositionOpen in place of OrderSend, I can also do it manually.
I have found. It's a problem of synchronisation between your EA and trade server. You have to use event handler OnTradeTransaction().
The result of executing the trade request on a server sent by OrderSend() function can be tracked by OnTradeTransaction handler. It should be noted that OnTradeTransaction handler will be called several times when executing one trade request.
For example, when sending a market buy order, it is handled, an appropriate buy order is created for the account, the order is then executed and removed from the list of the open ones, then it is added to the orders history, an appropriate deal is added to the history and a new position is created. OnTradeTransaction function will be called for each of these events.
I have found. It's a problem of synchronisation between your EA and trade server. You have to use event handler OnTradeTransaction().
RTFM ;-) Give it a try...tomorow for me.Ahhhh, thanks, will have a look. :-)
My EA is bringing u weird errors with build 778. The volume of 0.1 is normalized and clearly not invalid.
2013.03.12 07:29:57 pivots (SILVER,M5) SILVER failed ORDER_TYPE_SELL_STOP with volume 0.10; err# 4756 check code: 10014 comments: Invalid volume
2013.03.12 07:20:00 pivots (SILVER,M5) SILVER failed ORDER_TYPE_SELL_STOP with volume 0.10; err# 4756 returned code: 10014, broker comments: Invalid volume
Here is the code that brings it up