Would someone mind advising please why this error is popping up when it tries to compile the "int buyticket" line of code below?
You have not included a stoploss in the ordersend.
So it is taking NULL to be the take profit and 26082014 as the order comment. As it is expecting a string , but finds a number, you get the warning
int buyticket = OrderSend(Symbol(),OP_BUY,0.01,Ask,3.0,Insert Stoploss here,(Ask +0.10),NULL,26082014,0,Green);
I hope that makes sense
You can look it up yourself by comparing your variables (number and position) in OrderSend() to the requirements of the variables of OrderSend() - just look into the editor's reference:
string symbol, // symbol
int cmd, // operation
double volume, // volume
double price, // price
int slippage, // slippage
double stoploss, // stop loss
double takeprofit, // take profit
string comment=NULL, // comment
int magic=0, // magic number
datetime expiration=0, // pending order expiration
color arrow_color=clrNONE // color
Thankyou for this - my code is now int buyticket = OrderSend(Symbol(),OP_BUY,0.01,Ask,3.0,9,(Ask +0.10),NULL,26082014,0,Green); so in effect this gives me a stop loss of 9 pips.
I dont want to badger you as the weekend is coming up, but i have one more error repeated a few times in my next piece of code - namely "return value of 'Order Select' should be checked.
As an example it gets generated here: OrderSelect (result,SELECT_BY_TICKET);
Using your analysis above, i assume I now have to specify a result ? Sorry for being vague but I've only been learning MQL4 for a day or 2, whereas you guys have such deep knowledge it must have taken you years of study to master? I really appreciate you taking the time to help me :)
Have a read here and all should become clear.
Basically, it is a warning not an error saying, "don't you want to make sure this worked?"
To add comments, please log in or register