if(((Bid-OrderStopLoss())/Point)>trailamount) { OrderModify(Tnum,OrderOpenPrice(),(Bid-(trailamount*Point)),OrderOpenPrice()-(eltakeprofit*Point),0,Blue); }
the minus should be a plus?
Please post mql4 topics in the correct section.
I will move your post
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
This is a trailing code, if price reaches 50% of profit then it trails trailamount (btw trailamount=200 for example). It works perfeclty for sell orders but for some reason it doesnt trail for buy orders. Probably Im missing some dumb mistake. Please help.
I have even printed the (Bid-(trailamount*Point) price and it shows the right price to modify but still shows error 130. ONLY FOR BUY ORDERS! SELL ORDERS WORK OK!
eltakeprofit = 1200