Work Around Error 130 with MarketInfo
-
Hi there,
Firstly, thank you so much for this software! I've nearly copied a custom EA I paid £600 for as a test of your software and I'm really happy with what I can do with fxdreema.
I'm trying to find a way to deal with the 'Error 130'. I found a workaround online (http://www.earnforex.com/blog/ordersend ... hat-to-do/) and it looks like it's worth a try. How would I find the MarketInfo data? I've looked at all the drop down menus available but can't see where this information is.
I look forward to your reply.
Thank you,
Steve. -
What block causes this error? This error means that SL or TP are at impossible levels or are too close to the open price (brokers sometimes has limits).
You can also try to work with virtual stops, they are basically horizontal lines, which are constantly checked and when the market price touches them - the trade is closed. Go to "Options -> Current project options" for these settings. -
My EA is a volatility EA which uses ATR in several ways. I enter on a 5min chart based on a custom indicator I had coded. I use a fraction of the ATR value of the daily chart to place stops. I've been testing different methods (tight stops with higher lot sizes vs larger stops with smaller lot sizes) to look at a strategy that gets both gains from smaller moves and also stays with a longer trend.
Anyway, what I would like to do is the following:
- When indicator gives signal, have the EA compare MarketInfo minimum stop with the stop proposed by the EA.
- If EA stop is less than minimum allowed by broker then either change stop (and recalculate lot size to keep risk the same) and then place order at min stop level, OR if I get the Error 130 then close trade immediately.
At the moment a trade is placed every now and then where a stop can't be placed (Error 130) and my trailing stop function then sees no SL and places one but the trailing SL is larger than the initial SL and I end up with the occasional large loss. After seeing this error crop up every now and again there's no way I can let an EA go live without being able to handle errors as I would like.
The other thing that comes to mind is "How are errors handled?" I'd like to have routines in place to work around errors like 130 but perhaps if other error types come up then the trade would be closed immediately.
I'm happy with the logic of my blocks but I just need the MarketInfo data. If you don't provide access to this can I create a custom block myself using MQL code?
Thank you for your prompt response by the way.
Kind regards,
Steve. -
There is small strange problem unfortunately. I wanted to make things so that the EA first to check the minimum possible SL/TP size, and if the requested one is lowest, to put the minimum. But in my MetaTrader there is not information abount the minimum - "Stops level" property is 0, but I can't put SL/TP lower than 1 pip. So I think we can't rely on this MarketInfo property.
Now my next idea is when SL/TP modification fails, the EA to start trying with bigger SL/TP than requested, incrementing the size with 1 pip every time. But this will probably produce big log.
Yes, custom blocks can be made. It should be something like this...
if (MarketInfo(blablabla)) {~next~} else {~inext~}
But first try to see if Stops level works at all.
-
Hi,
I'm trying to use the library to create my custom block for the MarketInfo data but when I open the library I get the following displayed.
Warning: include_once(C:\Program Files\fxDreema\Data\globals\functions\filesystem.php): failed to open stream: Permission denied in C:\Program Files\fxDreema\Data\configuration.php on line 14
Warning: include_once(): Failed opening 'C:\Program Files\fxDreema\Data/globals/functions//FileSystem.php' for inclusion (include_path='.;C:\Users\Steve\AppData\Local\FxDreema{18D1BCB9-84FB-4AA4-9FDE-B7796D37D947};C:\Program Files\fxDreema\Data') in C:\Program Files\fxDreema\Data\configuration.php on line 14
Any idea how I can fix this?
Kind regards,
Steve -
What Windows do you use?
Windows UAC enabled? I can suggest to disable it. At least I don't have this problem on Windows 7
-
I'm using Windows 8. I discovered what the problem was with the 130 error. I was testing data from 2010 and when I opened the chart and attached the ATR indy to check manually I could see that the indy didn't show that far back - that's why the EA was falling over.
Thanks for your help though - much appreciated.