RULE #1 - When in doubt always check the documentation!
Your "comment" is in the wrong place. It should be the 8th parameter (just after "takeprofit") and not the 10th as you have it, which is the parameter "expiration" (datetime); hence the error.
int OpenLong=OrderSend(Symbol(),OP_BUY,lot,price,Slippage,StopLoss,TakeProfit,NULL,Magic_No,comment,Blue);// returns implicit conversion from 'string' to number' int OpenLong=OrderSend(Symbol(),OP_BUY,lot,price,Slippage,StopLoss,TakeProfit,comment,Magic_No,0,Blue); // now it is in the correct position
OrderSend
int OrderSend( 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 );
Thank you once again for helping out.

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
Hi all
I am running the below code in an EA, the idea is to copy the pattern created inside the bot as a comment on my order. But I get the above error. What have I done wrong?