- BUY SELL orders/deals explanation
- i need help about momotum indicator
- Open Buy Code issue.
Please someone help me!!!
I need to write a script for creating a EA. but the problem is that my requests are not accepted by the server. I don't find the reason! Please guide me. When I compile and start the autotrader I always get a rejected answer from the server.Here is the code:
input int MagicNumber=1234567;
myRequest.action=TRADE_ACTION_PENDING;
myRequest.magic=MagicNumber;
myRequest.order=2522322;
myRequest.symbol="mysymbolname";
myRequest.volume=340;
myRequest.price=2996;
myRequest.stoplimit=3200;
myRequest.type=ORDER_TYPE_SELL_LIMIT;
myRequest.type_filling = ORDER_FILLING_RETURN;
myRequest.type_time = ORDER_TIME_DAY;
myRequest.sl=0;
myRequest.deviation=0;
myRequest.tp=0;
MqlTradeCheckResult myResult2;
OrderSend(myRequest,myResult);
if (OrderSend(myRequest,myResult)){
Alert ("Good");
}else{
Alert ("bad");
};
- www.mql5.com
sd2000sd:
...
- Please don't post off-topic, create your own thread if needed.
- You have to use the SRC button when you post code, otherwise it's more difficult to read.
- Did you read the documentation ?
myRequest.symbol="mysymbolname";
- Are you sure this symbol is correct ?
- What is error code returned by the server ?
Please someone help me!!!
I need to write a script for creating a EA. but the problem is that my requests are not accepted by the server. I don't find the reason! Please guide me. When I compile and start the autotrader I always get a rejected answer from the server.Here is the code:
myRequest.order=2522322;
myRequest.type_time = ORDER_TIME_DAY;
You could try to use ORDER_TIME_GTC instead of ORDER_TIME_DAY...
Another possible error is the usage of myRequest.order=2522322 ... You might simply comment (//) this entire line of code, once you don't need to specify the order code...
- www.mql5.com
You could try to use ORDER_TIME_GTC instead of ORDER_TIME_DAY...
Another possible error is the usage of myRequest.order=2522322 ... You might simply comment (//) this entire line of code, once you don't need to specify the order code...
From my experience setting a member not needed for the request type doesn't lead to an error, the will be simply ignored. Same for "myRequest.stoplimit=3200;" which isn't needed for a ORDER_TYPE_SELL_LIMIT.
User have to print the returned value :
}else{ Alert ("bad, error = ", myResult.retcode); };
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use