up*
Ong Kean:
up*
up*
You up your post 20 minutes after posting????!!!!!
You do that again and I will delete your topic altogether.
Please edit your post and
use the code button (Alt+S) when pasting code
Why not pump this knowledge up ? :)
There's tons of MQL4 tutorials on youtube which can pump you up from zero to hero!
To answer your question:
https://docs.mql4.com/trading/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 );Meaning that:
// Buy 10 Microlot if (signal=="buy" && OrdersTotal()==0) OrderSend (_Symbol,OP_BUY,0.03,Ask,3,0,Ask+150*_Point,NULL,0,0,Green); // Sell 10 Microlot if (signal=="sell" && OrdersTotal()==0) OrderSend (_Symbol,OP_SELL,0.03,Bid,3,0,Bid-150*_Point,NULL,0,0,Red);these are your stop losses :)
Congratulations! You did set them up! ;)
(0 meaning no stop loss set up btw)
OrderSend - Trade Functions - MQL4 Reference
- docs.mql4.com
Returns number of the ticket assigned to the order by the trade server or -1 if it fails. To get additional error information, one has to call the GetLastError() function. At opening of a market order (OP_SELL or OP_BUY), only the latest prices of Bid (for selling) or Ask (for buying) can be used as open price. If operation is performed with a...
Wow! U r awesome mate! I tried figure out where to is the stoplost omg..
Thanks alot~ this is a new language for me.. is interesting though :D
Sorry Moderator, I didnt mean to do it, I thought my post is lost so I tried "up" it, then realize is in another section in the forum. My apology :)
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 m totally new to EA, and I just copy the code from website but i didnt know how to add in the stop lost for my open order..
Here is the code looks like
Anyone could help? Very appreciated on this, I found EA is wonderful thing but I have zero knowledge in coding :(