PAPDoug:
I have coded quite a lot of things in mql4 and I am struggling to grasp simple concepts in mql5.
I am looking for a script that will simply move or create all stop losses @ user's input choice.
I have coded quite a lot of things in mql4 and I am struggling to grasp simple concepts in mql5.
I am looking for a script that will simply move or create all stop losses @ user's input choice.
input uint InpStoploss = 0; //StopLoss Pips input uint InpTakeProfit = 0; //TakeProfit Pips #include <MT4Orders.mqh> // https://www.mql5.com/en/code/16006 void OnStart() { for (int i = OrdersTotal() - 1; i >= 0; i--) if (OrderSelect(i, SELECT_BY_POS) && (OrderType() <= OP_SELL)) { const double point = OrderType() ? -SymbolInfoDouble(OrderSymbol(), SYMBOL_POINT) : SymbolInfoDouble(OrderSymbol(), SYMBOL_POINT); OrderModify(OrderTicket(), OrderOpenPrice(), InpStoploss ? OrderOpenPrice() - InpStoploss * point : 0, InpTakeProfit ? OrderOpenPrice() + InpTakeProfit * point : 0, 0); } }
fxsaber:
Thank you! Will I be able to do fractions of Pips with this ? instead of 1 be able to do decimals like .2 ?
PAPDoug:
Thank you! Will I be able to do fractions of Pips with this ? instead of 1 be able to do decimals like .2 ?
One pip is the minimum price change. Therefore, items can only be integers.
For example, EURUSD 1pip = 0.00001.

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 have coded quite a lot of things in mql4 and I am struggling to grasp simple concepts in mql5.
I am looking for a script that will simply move or create all stop losses @ user's input choice.
For instance I have 5 open trades that are all 10 pips in profit. I then use the script to create a stop loss that's .2 pips past my entry in profit creating a break even scenario if price were to come back.
Any help if you have a script that can do this to share or other code that can help me accomplish this goal would be great.
The closest I got was a script from another person that creates the stop loss / tp to where the current BID / ASK price is not my position placement.