Luandre Ezra:
Hi guys I'm new at mql5 programming language and I'm trying to learn it from youtube. I find the video (below) and try to copy the coding into metaeditor. When I compile the code there's a error message unexpected token on Ctrade line. Anyone can help me why I got the error message while the video is fine?
Should be:
trade.bBuy{( 0.01, //volume 0.01 lot NULL, //current symbol on chart Ask, //buy price Ask-20*_Point, //adding stop loss 20 pips Ask+40*_Point, //adding take profit 40 pips NULL //Comment });And it's not pips... looks more like points...
Seng Joo Thio:
Thank I already fix it. I think I should be more careful with every code. Thanks!Should be:
And it's not pips... looks more like points...and do you have any reference that I can use to learn mql5?
Luandre Ezra:
Thank I already fix it. I think I should be more careful with every code. Thanks!
and do you have any reference that I can use to learn mql5?
Menu --> documentationThank I already fix it. I think I should be more careful with every code. Thanks!
and do you have any reference that I can use to learn mql5?
All you need is there.
Ask, //buy price Ask-20*_Point, //adding stop loss 20 pips Ask+40*_Point, //adding take profit 40 pipsYou buy at the Ask and sell at the Bid. So for buy orders you pay the spread on open. For sell orders you pay the spread on close.
- Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid reaches it. Not the Ask. Your SL is shorter by the spread and your TP would be longer. Don't you want the same/specified amount for either direction?
- Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask reaches it. To
trigger at a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25 - The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (Control-O) → charts → Show ask line.)

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 guys I'm new at mql5 programming language and I'm trying to learn it from youtube. I find the video (below) and try to copy the coding into metaeditor. When I compile the code there's a error message unexpected token on Ctrade line. Anyone can help me why I got the error message while the video is fine?