Help with 5 digit pricing - page 2

 

Coder needed for simple job

I need a a coder to get my ea working with a 5 digit broker,it works fine with fxdd demo ac, tried to run on my live ac with fxcm bt ac, and it coming up with ''error order send 130'' and as the tp's sl's are far enough away from the price I'm guessing it may be that it's not coded to work with a five digit broker?

any idea's?

by the way the ea is the Phoenix_v5_6_03 it has made good gains on my demo ac so feel free to go trial it and see how it works for you.

 

...

Here you go (the 5 digit issue)

Also changed the way defaults are set for certain symbols, so now it can recognize any "prefix", "suffix", ... in a symbol for those symbols (in the init section)

If it still causes that ''error order send 130'' on your live account, than your live broker does not allow placing stop loss and take profit along with opening a trade, and then it needs additional coding (those are ECN or STP rules for trades)

regards

mladen

mallet52:
I need a a coder to get my ea working with a 5 digit broker,it works fine with fxdd demo ac, tried to run on my live ac with fxcm bt ac, and it coming up with ''error order send 130'' and as the tp's sl's are far enough away from the price I'm guessing it may be that it's not coded to work with a five digit broker?

any idea's?

by the way the ea is the Phoenix_v5_6_03 it has made good gains on my demo ac so feel free to go trial it and see how it works for you.
Files:
 

Thankyou,mladen very much appricated

Thankyou very much for your time and effort,can't till monday to give it a try out.

On my demo ac, this ea produced so very good results on the eur/jpy and the gpb/jpy

will keep posted on how it go's on the live ac

Cheers

mladen:
Here you go (the 5 digit issue)

Also changed the way defaults are set for certain symbols, so now it can recognize any "prefix", "suffix", ... in a symbol for those symbols (in the init section)

If it still causes that ''error order send 130'' on your live account, than your live broker does not allow placing stop loss and take profit along with opening a trade, and then it needs additional coding (those are ECN or STP rules for trades)

regards

mladen
 

still need help

Hey guys,

I still haveing trouble getting my ea to work with fxcm bt,they tell me that I have a problem with the ea placing sl ant tp at the same time it puts in a market order,

Mladen kindly recoded this ea for so it would accept the 5 digit pricing and now this problem came up,

It would be great if somone could code the delay in to the ea that is needed for me,or explain it in great detail ( as I have no knowalge on how to code) and I will have a go at it myself, so I don't have to keep bothering everyone else.

thankyou in advance

and to all those who have helped me in the past

Files:
 

[Ask]How to Make Indicator from 4 Digit's Broker Work for 5 Digit's Broker ?

Hello. all.

First of all, I am new in programming mq4. Recently, I changed my broker from 4 digits to the one with 5 digits. What I didn't anticipate was : all indicators didn't work in this new broker.

Does anyone know how to make all the indicators work ? Like a code or something that I can put in the indicators ?

Can someone here do something about it ?

Thanks in advance

 

How to use/customize EA if broker added one more digit?

Hi all,

My broker MIG INVESTMENTS added recently one more digit on price and most of my EA which worked before without problem now report to me error 130 which is problem with stop loss value. It works fine if I remove sl value and put 0 and later on check profit and close position. But can I somehow to fix it in EA/MQL? If my sl was 20 pips - do I need now to do 200 pips or what?

Thanks in advance

 

Try This

When you send an order you have to set the SL as a price not the number of pips so your suggestion won't work. The way I do it works for both 4 and 5 digit brokers. I declare a static double variable called pf and then I calculate its value using the code in the Init function. Whenever there is a value in pips, I multiply or divide it by pf as required.

double pips = MarketInfo(Symbol(), MODE_TICKSIZE);

if (Digits < 4)

{

pf = (0.01/pips); // 10 or 1

}

if (Digits > 3)

{

pf = (0.0001/pips); // 10 or 1

}

 

How I calculate

If SL was before for example 20 pips:

If LONG I calculate SL:

NormalizeDouble(Bid - 20*Point,MarketInfo(Symbol(), MODE_DIGITS))

If SHORT I calculate SL:

NormalizeDouble(Ask + 20*Point,MarketInfo(Symbol(), MODE_DIGITS))

So like that I add 20 pips and 'round' value on number of digits which is for that currency pair. Is this correct?

 

Hi,

I'd like to share a bit of my own experience I gained working with 5-digit brokers.

First, and most important. Why 5 digits (its not 6, its 5, amount of numbers after ".") instead of 4 (its not 5, its 4)?

Because spread is an integer.

What does that mean?

Spread of 2.x pips can not exist in MT4. Only 2 or 3. Its a limitation of MT4, can't be avoided. So brokers invented 5-th (3-rd) digit! Now spread becomes 2x (like 23, 28, 34) instead of 2.x. With this comes a bunch of problems for MQL4 programmers, like "Error 130 invalid stops" because your point is now not 0.0001 but 0.00001 and TP becomes 5 pips instead of 50 ect. Wonderful, isn't it? Normal users won't notice it because price moves in 10-pip steps (or so it seems on my EAs, I don't trade manually - tend to panic too soon).

How did I avoid errors in my EAs?

Simple!!! I add variables for point, digits and other stuff I'm going to use this way:

int dig=Digits,d=0;

double p=0,spread=0;

if(dig==4||dig==5) d=4;

if(dig==2||dig==3) d=2;

if(d==0) d=dig; // in case of unexpected digits value

p=NormalizeDouble(1/MathPow(10,d),d);

if(p==0) p=NormalizeDouble(Point,Digits);

spread=NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD)*p,d);

if(spread==0) spread=NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD)*Point,Digits);

Please correct me if you see any mistakes! Please note: spread is already converted into a double value.

And when I need to normalize anything I use "d" for digits and "p" for point. Seems to work great with both 4-digit brokers and 5-digit brokers.

I also normalize both Bid and Ask when I use them.

Please remember:

- use at your own risk!

- price might constantly change on a broker with 5-th digit, normalize price and make a smallest possible modification no smaller than 1 full digit. Or 2.

- you might need to use "not normalized" ask and bid (normalized with Point instead of p, Digits instead of d) for opening market orders or you will receive an error.

- you might want to add a separate global external variable for your Spread and/or digits, point ect.

- if you multiply a TP of 50 by Point on a 5-digit broker, you'll get 5 pips instead of 50 (it becomes 0.00050 instead of 0.0050). You need to multiply every value (or point) by 10. Or use formulas I provided.

Hope this helps!

PS: my conclusion on 5 digits and spread comes from the fact spread is an integer, so it can't be larger than 2 and smaller than 3 at the same time. I didn't hear it from brokers, didn't read it anywhere. I made it up PPS: if you want an EA adopted to 5-digit brokers, be ready to either learn MQL4 and re-code it yourself, test it for a while, think of every possible variant and fix every error you get, or pay $$ (or even $$$) to a programmer to do the job for you.

-added-

ljuba973

That piece of code should work fine on a 4-digit broker but on 5-digit one you'll end up with SL of 2 instead of 20. This was covered in my post, but just in case

 

problems with 4 digit and 5 digit with EA working

hi guys ,

i've got a real problem and am not capable to understand why the ea that i wrote on a 4digit broker do not work correctly on a 5digit broker.

On the 4 digit broker it works perfectly does all the things correct so i have a backtest file that works fine and a ea for live trading that works correctly, when i put them on a 5digit broker the ea backtest do not work correctly aswell the live ea , (ex. it does not anymore trade long and the trailing stop do not work , i really do not know what happen on the 4 digit it works ok ).

could please someone help me out of this ? please

ps i know that for 5 digit i gotta change the stop or target slippage and all the other stuf adding a poit so for 5 pip stop on a 4 digit i use 5 and on the 5digit i use 50 so that schould be ok

please halp me out i m getting crazy !!!!!

i t is not possible that the 4 digit is ok and the 5 digit is not

the exact problem is that on the 4 Digit it trades long and short correclty , in

thanks in advance for any kind of help

Reason: