Reference: Buy
Opens a long position with specified parameters.
bool Buy( double volume, // position volume const string symbol=NULL, // symbol double price=0.0, // execution price double sl=0.0, // stop loss price double tp=0.0, // take profit price const string comment="" // comment )
You need to add these three parameters: price, sl and tp

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
Here you are my Main code:
And the code copied from this article: https://www.mql5.com/en/articles/481
It works, but whithout TP and SL. Where I can put there?
Also this piece of code works (of course whithout SL and TP), but I will not able to insert the PRICE of SL and TP
I know the TP and SL must be a PRICE and not a number, but I was unable to do it
Also I read manual (https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradebuy) but nothing. Yes, I think to be silly :-(
Previously I used MQL_Easy, but after MT5 update it isn't works.