The post got sent before I finished...
I don't understand why the script doesn't return true in the first if statement : if(price_diff >= stop_level)
if stop_level=0.0003 and price_diff=0.0003000
and then why do I still get error 130 if I change the enter price to Ask + stop_level
any ideas?
Thanks
What is the value of takeprofit?
sa1221: BUYSTOP order but get error 130 even though I follow the StopLevel Minimum Distance Limitation. | Error 130 Pain - MQL4 forum 7A |
GumRai:
What is the value of takeprofit?
What is the value of takeprofit?
No takeprofit.
takeprofit = 0;
WHRoeder:
I've opened a lot of orders with the same code. The error happens only in this specific case when price_diff=0.0003 (and stop_level=0.0003), so I don't think it's because of the TP/SL... but I'll try
sa1221: BUYSTOP order but get error 130 even though I follow the StopLevel Minimum Distance Limitation. | Error 130 Pain - MQL4 forum 7A |
if ( price_diff==0.0003 && stop_level==0.0003) stop_level = stop_level + 0.0001;Well, something like that.
I've printed the price_diff without DoubleToStr and found it is actually: 0.000299999999999967
so I've added this code to fix this:
double compare_to_stop_level = stop_level - price_diff;
... if(compare_to_stop_level < tenth_of_pip){ Print("enter price is almost exactly " , stop_level , " pips away - enter in pending"); order_type = OP_BUYSTOP; enter_price = Ask + stop_level + tenth_of_pip; }
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'm trying to open a BUYSTOP order but get error 130 even though I follow the StopLevel Minimum Distance Limitation.
The output is: