Hello everyone. My EA successfully sends buy orders but for some reason cannot send sell orders. When I try to send a sell order OrderSend function fails with 4756 error code and MqlTradeResult retcode is 10004. The following is a part of my code that sends orders.
- OrderSend error 4756 Invalid request
- Error 4756 but the order send
- Invalid Stops,can't place an order
mirac baver ozturk:
Hello everyone. My EA successfully sends buy orders but for some reason cannot send sell orders. When I try to send a sell order OrderSend function fails with 4756 error code and MqlTradeResult retcode is 10004. The following is a part of my code that sends orders.
Hello everyone. My EA successfully sends buy orders but for some reason cannot send sell orders. When I try to send a sell order OrderSend function fails with 4756 error code and MqlTradeResult retcode is 10004. The following is a part of my code that sends orders.
Why not use the CTrade class?
#include <Trade\Trade.mqh> CTrade trade; void OnTick(){ //Your logic trade.Buy() //pass parameters in braces trade.Sell() // pass parameters in braces }
mirac baver ozturk:
myRequest.price = NormalizeDouble(givenTick.ask,Digits());
myRequest.price = NormalizeDouble(givenTick.ask,Digits());
You are using:
myRequest.price = NormalizeDouble(givenTick.ask,Digits());
for both sending order Buy and also sending order Sell?
You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit by the Ask.
William Roeder #:
Thank you so much William, I recently started with an EA as well, and doing a course related I was adviced about this but I can not understand this really well. I think I am biased for the brokers as I do not have to worry about that, just putting my order above/bellow price when I want to go short or long but I get really confused with bid and ask price
You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit by the Ask.
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