Hi,
I want to use the
Order_modify()
function in my post above. It doesn't work when I have many orders open and the order on the first position has changed the SL and TP
because of this line
if(OrderStopLoss()!=0) return;
so I tought...
but the strange thing is, that I get for every order than the first one an order error 130.
Can anybody tell me how I have to change this function for a multiordersystem??
What is the value of PointX()*Long_SL-spread ? does OrderOpenPrice()-PointX()*Long_SL-spread need to be Normalized ? are you on a 4 or 5 digit broker ? if 5 digit have you taken this into account ?
- it does NOT need to be normalized, normalize is never needed. What is PointX()*long_SL-spread? It must be larger than MarketInfo(Symbol(), MODE_STOPLEVEL)*Point (3 pips or 30 points on IBFX)
for(int i=0;i<=OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
i==OrdersTotal will always fail, drop the =. You must count down when closing/deleting or in the presence of multiple orders and other EAs on other charts. Simplify and use positive logic.for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair.
if(OrderStopLoss()!=0) return;
make the EA incompatible with multiple orders

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
Hi,
I can't understand, what I am doing wrong!
First I send an order without TP and SL.
After that I use this function: