Ok,
can I already modify the order, after it is placed, or only, if the order got filled?
Does this matter with backtesting? Because some of my orders worked and some not?
Thanks for your help!
Ok,
can I already modify the order, after it is placed, or only, if the order got filled?
Does this matter with backtesting? Because some of my orders worked and some not?
Thanks for your help!
Ok, I understand, but than we are back to my initial question ;)
Why do I get the error 130 - with most of the test data it does work, but a few orders deliver this error :(
Ah, I should have read your post rather than just following on from deVries I suspect your issue is most likely due to your SL being too close . . you can send SL and TP with a Pending order with an ECN Broker, just not with a Market Order.
There is good info here: Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial there was also a good thread that I contributed to a little, it might be worth a read, it's not specifically about Pending orders but is a good discussion about Stop and Freeze levels: https://www.mql5.com/en/forum/135633
Ah, I should have read your post rather than just following on from deVries I suspect your issue is most likely due to your SL being too close . . you can send SL and TP with a Pending order with an ECN Broker, just not with a Market Order.
There is good info here: Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial there was also a good thread that I contributed to a little, it might be worth a read, it's not specifically about Pending orders but is a good discussion about Stop and Freeze levels: https://www.mql5.com/en/forum/135633
Thanks for correcting buystop I was wrong deleted the post
//++++ These are adjusted for 5 digit brokers. int pips2points; // slippage 3 pips 3=points 30=points double pips2dbl; // Stoploss 15 pips 0.015 0.0150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ OptParameters(); if (Digits % 2 == 1){ // DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262 pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl //---- These are adjusted for 5 digit brokers. /* On ECN brokers you must open first and THEN set stops int ticket = OrderSend(..., 0,0,...) if (ticket < 0) Alert("OrderSend failed: ", GetLastError()); else if (!OrderSelect(ticket, SELECT_BY_TICKET)) Alert("OrderSelect failed: ", GetLastError()); else if (!OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0) Alert("OrderModify failed: ", GetLastError()); */Drop the normalizeDouble, it is NEVER necessary.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I googled and searched this forum, but was not able to solve my problem. I know, that error 130 occours if stop losses or take profits are set false. But I am pretty sure, that that's not my problem ;). Maybe someone had the same problem...
I have a demo account at TradingPoint. They state, that stop losses and take profits and orders can be set at ask +/- the spread. But when backtesting my EA, sometimes the error 130 occours.
Here the relevant code:
dHigh, is the High from the previous bar and dLow is the Low from the previous bar
If I run the EA, some orders are processed and others generate this error. I'm messing around with this since 3 days. If someone could help, i would relly appreciate it!
Here is the output i get:
Thanks for your help,
Regards, maecky