-
Play videoPlease edit your post.
For large amounts of code, attach it. - Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- Print out your variables, and find out
why.

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
Hello,
I tried to use the following line, to create a stop at a certain gain level and (at the same time) a takeprofit modification, but I probably made a mistake, since
the modification is not executed (the alert-sound is played sometimes):
extern int TicketBuy,TicketSell;
extern double TrailingStopUp1;
extern double TrailingStopLevelUp1;
extern double TakeprofitUp1;
if(
(OrderSelect(TicketBuy, SELECT_BY_TICKET)==true) { OrderSelect(TicketBuy, SELECT_BY_TICKET); if(Bid>= TrailingStopUp1) {OrderModify(TicketBuy,Bid,TrailingStopLevelUp1,TakeprofitUp1,"Buy1Comment",Blue); PlaySound("1wav.wav");}
maybe the distance of the TP levels etc.(while testing..) were to close to the present Bid, I was wondering.
If anybody has hints, thanks in advance
Mike