OrderSend error 130

Hello all,

When I try to run scripts I keep getting this. OrderSend error 130, in my Meta 4 platform. I have no clue where to fix this, I was told that my stop loss or take profit are to close. Any help would be appreciated.

Thanks,
Rob

Yup, that’s what it means…your t/p & s/l can’t be less than 10 pips usually.

:slight_smile:

Thanks for the reply, but I actually needed direction on where to go to change it. :slight_smile:

Hopefully it’s a parameters/properties you can change without having to go into the code itself, cause that may be harder to explain depending on how the script is constructed to tell the “ordersend” function what the pip value is.

Just like an indicator, scripts & ea’s have user inputs. Look to see if there is a take profit input box and if it’s less than 10, then just type in 10 or more.

Sorry, I don’t have mt4 here at work otherwise I’d post a pictoral example.

Is it a script that came with MT4?

No, its a script I found on the net. I went into expert properties and I changed it to higher number but that didnt help either. I have found that I get this ALOT when I try to back test different EA’s. Let me know if I can attach it. Thanks for the help

How much do you know about MetaEditor & coding? LOL

You can upload the file here and I can look at it if you like. :slight_smile:

Its giving me an “invalid file” when I try to upload it. The file name is 100 pips v3.mq4 do I need to change anything?

You’ll either need to zip it, or change the extension to txt instead of mq4, and then upload. Babypips has restrictions on valid file types.

Actually, I think I found it on forex-tsd…having a look …

I was just going to ask if I could post a link. Let me know what you think. It seems to work well, then at the end it loses everything. I added the indicator to the correct file but now its giving me a “error modifying order”

Ok, there are some parameters that need to be changed…if this is the correct file that is…

extern double stopLoss = 50;
extern double lTakeProfit = 20;
extern double sTakeProfit = 5; needs to be min 10
extern double lTrailingStop = 0; needs to be min 10
extern double sTrailingStop = 0; needs to be min 10

The l or s in front of the take profit & trailing stop I think probably stands for long and short.

So change those in the input parameters. You’d have to change them for every chart you attach it to.

Thanks for all your help. Here is whats in the journal at the end of a back test. I changed everything that you told me to. I have found that a lot of EA’s I test lose everything at the end of a test, like they are making profit then at the end it drops straight down on the graph. Whats that mean.

2008.11.06 18:36:01 2008.10.28 18:30 100 pips v3 EURUSD,M5: OrderModify error 130

Where do I adjust for this error?

OrderModify is trying to set the trailing stop, but again something is incorrect about the values for the s/l and/or t/p. Yes, when the strategy tester reaches current time, it has no choice but to close the trade at whatever profit/loss it’s in. Did you read all the posts on it at forex-tsd?

That’s all I can do for now until I get home in a few hours. Can you check the testers journal tab and see if it’s only buys or sells, or both, that it happens on?

Aren’t you by chance using an Alpari (UK) demo account? They’ve recently switched to using 5 decimals where they previously used 4 (like EURUSD, GBPUSD, etc.) and 3 decimals instead of 2 (USDJPY, EURJPY, etc.).

If this is the case, a 10 pips stop with 5 decimals is equivalent to a 1 pip stop with 4 decimals! Most of the indicators and EA that you can download will need to be recoded to properly take into account this change, by examining the Digits variable or the MarketInfo() function.

I had recently considered opening a live account at Alpari, but this change irritates me so much that I won’t anymore.

Yes and no. I tried it on Alpari US and Forex.com, neither one would work. It was just a freebie EA I downloaded, no biggie. I just don’t like being beaten. I ended up getting the WWS last night and it’s been doing awesome so far. I guess it goes to show that “you get what you pay for”. Thanks for all the help.