I try to open order with OrderSend function. But it makes error code 136
Code that i use
//---/--- get minimum stop level
Print("Minimum Stop Level=",minstoplevel," points");
//--- calculated SL and TP prices must be normalized
Print("price ", price);
Print("stoploss ", stoploss);
Print("takeprof ", takeprofit);
Print("Bid ", Bid);
//--- place market order to buy 1 lot
int ticket=OrderSend("USDCHF",OP_BUY,1,price,1000,stoploss,takeprofit,"My order",16384,0,clrGreen);
Print("ticket ", ticket);
Print("OrderSend failed with error #",GetLastError());
Print("OrderSend placed successfully");
Any assistance will be appriciated
1) use the SRC-button to post code (beside the camera!)
2) Do you know what error 136 means. It tells you where to search for a correction! (Look it up in the MQL4 Reference)
Read the book or the Documentation (links at the top!).
Look for the examples of opening orders.
Study the sample EAs in the Expert folder how they set their prices for OrderSend(..)
Search for other examples...
// int ticket=OrderSend("USDCHF",OP_BUY,1,price, ...
int ticket=OrderSend(NULL, OP_BUY,1,price,
To add comments, please log in or register