if((Bid-SMA50)/Point<20) OrderModify(....);
I decided instead of modifying the order over time I simply added a while loop, so while the price is below the SMA50 line it will run another function to check if two consecutive bars have formed below the line. If this happens it performs an OrderClose

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
I'm using the following code to track the SMA50 line:
double SMA50;
SMA50=iMA(NULL,0,50,0,MODE_SMA,PRICE_CLOSE,0);Print(SMA50);
How can I modify an order so that it remains 20 pips below the SMA50 line?