Point, Pips, Digits and different 4-Digits, 5-Digit and even more-digts Brokers..

 

Hi,

it's an old problem but still not really solved.

Recently I was in trouble with a new broker and its Gold-price: 1234.340!

For a 5-digit-broker 1 Gold-pip should be 0.1 = 10 Points now here 1 Gold-pip is 100 Point - sigh!!

So I thought to calculate a pip (and digits) from the value of the lotsize.

Instead of using what I found in the internet: pip = 0.0001 and a point has 1 more digit. That gets into troubles with gold and other new symbols like in my case DAX30.

I would like to calculate 1 pip and its digit-numbers from the base-price of 1 lot (MarketInfo(sym,MODE_LOTSIZE) so that 1 pip = 10 base-curr.-units:

string cmt;
void OnStart() {
      getPIP("EURUSD");
      getPIP("XAUUSD");
      getPIP(".DE30Cash");
}

double getPIP(string sym){

      int       dig  =  (int)MarketInfo(sym,MODE_DIGITS);
      double 
                loS  =  MarketInfo(sym,MODE_LOTSIZE), // "LotSize",
                tiS  =  MarketInfo(sym,MODE_TICKSIZE),
                hmm  =  ((int)MathLog10(loS)-1),
                pip  =  MathPow(10.0, (-hmm));
         
      cmt = cmt+"\n\n"+sym+"  Digits: "+(string)dig+"  TickValue (Acct.-Curr): "+DoubleToStr(MarketInfo(sym,MODE_TICKVALUE),3)+
                         "  TickSize: "+DoubleToStr(tiS,dig)+"  LotSize: "+DoubleToStr(loS,2)+" BaseCurr\n";
      cmt = cmt+" Log (=Digits): "+(string)hmm+"  PIP: "+DoubleToStr(pip,dig);
      Comment(cmt);
      return(pip);

}

 in my case I see on the chart (on a EUR-Account!):


Has anybody arguments against this approach? 

I am a little bit astonished as this very nasty problem could be solved so easily but why can't I find this in the internet?

Regards,

Gooly

 

You can always have an input Pip_Decimal

That way, the user can input 0.1 for Gold and whatever else they consider to be a pip for the chart symbol. 

 
GumRai:

You can always have an input Pip_Decimal

That way, the user can input 0.1 for Gold and whatever else they consider to be a pip for the chart symbol. 


1) Why do I have a computer if I (have to) do everything my self manually again and again?

2) If you have multi-currency-EAs you have to set many inputs and that may cause errors, I trust a tested program more that manual manipulations.

My concerns are mainly about symbols with 'exotic' lotsizes: not a power of 10.

 
gooly:

Hi,

it's an old problem but still not really solved.

Recently I was in trouble with a new broker and its Gold-price: 1234.340!

For a 5-digit-broker 1 Gold-pip should be 0.1 = 10 Points now here 1 Gold-pip is 100 Point - sigh!!

So I thought to calculate a pip (and digits) from the value of the lotsize.

Instead of using what I found in the internet: pip = 0.0001 and a point has 1 more digit. That gets into troubles with gold and other new symbols like in my case DAX30.

I would like to calculate 1 pip and its digit-numbers from the base-price of 1 lot (MarketInfo(sym,MODE_LOTSIZE) so that 1 pip = 10 base-curr.-units:

 in my case I see on the chart (on a EUR-Account!):


Has anybody arguments against this approach? 

I am a little bit astonished as this very nasty problem could be solved so easily but why can't I find this in the internet?

Regards,

Gooly


Your calculation of a pip based on lotsize is  wrong. A pip is a pip, nothing to do with lotsize. Your result is pure coincidence.

For example on a mini-account lotsize for EURUSD is 10,000, you will get a pip=0.001

 
angevoyageur:

Your calculation of a pip based on lotsize is  wrong. A pip is a pip, nothing to do with lotsize. Your result is pure coincidence.

For example on a mini-account lotsize for EURUSD is 10,000, you will get a pip=0.001


hmm?

If a broker offers e.g. a mini-lot-account he offers the option to trade 0.01 standard lots as lowest and of course multiples of that.

This wouldn't void my calculation!

I have never seen a broker offering a mini-account with only 'whole' lots 1,2,3,... to trade but of a non standard lotsize of 1'000$

Gooly
 
gooly:

hmm?

If a broker offers e.g. a mini-lot-account he offers the option to trade 0.01 standard lots as lowest and of course multiples of that.

This wouldn't void my calculation!

I have never seen a broker offering a mini-account with only 'whole' lots 1,2,3,... to trade but of a non standard lotsize of 1'000$

Gooly

No offense, but what you wrote is non sense.

A pip has nothing to do with lot size. In any case. 

 
angevoyageur:

No offense, but what you wrote is non sense.

A pip has nothing to do with lot size. In any case. 

I think it has:

Originally the smallest quote-difference was one pip which was (is) 10,- units of the base currency (4-digit-broker).

But the banks wanted 'more' and so they added 1 decimal and so we got the Point. And now again some broker started to add another decimal.

And that makes it difficult to calculate the pip from the bottom (from the point).

 

gooly:

. . . 

And that makes it difficult to calculate the pip from the bottom (from the point).


My advice is: forget about using pips and use points instead.  TickSize is a multiple of Point, and TickValue is the value of TickSize in deposit currency.  Why spend time/energy to try to calculate/convert to pips?
 
Thirteen: My advice is: forget about using pips and use points instead.  Why spend time/energy to try to calculate/convert to pips?
Because if you set your SL to OOP-x, and change brokers (or the broker goes from 4 to 5 digits) your SL has now, suddenly, changed by 1/10 and you're loosing money. If you have a good EA, and put it on another broker and forget to divide your SL value by 10 because it's a 4 digit broker your EA has now changed, you won't be hitting your SL and you're loosing money.
A Pip is a defined unit. A point is not. Just adjust
 

I found the problem of my a.m. mentioned function getPIP: It fails to caculate the JPY-3-Digit-Pairs.

So I went over it and now I feel very well with this solution: 1 PIP (-change) is the closest to (refValue) 10,- 'bugs' of my account-currency.

double PIP; // global value
int DIG;    // global value

void setPIP(string sym, double refValue = 10.0){

      int       dig  =  (int)MarketInfo(sym,MODE_DIGITS),
                        xp   =  9, XP=0;
      double    tiV  =  MarketInfo(sym,MODE_TICKVALUE),
                bst  =  9999999999;
                         
      while(xp>-9){
                double m = pow(10,xp);
                double p = m*tiV;
                double d = fabs(p-refValue);
                if ( d < bst ) {
                       XP = xp;
                       bst= d;
                }
                if (d>bst) break;
                xp--;
      }               
      DIG = dig - XP;
      PIP = pow(10,-DIG);
}

Now no matter what are the broker settings of any symbol 1 PIP will always have approximately the same size for me.

 
gooly: Now no matter what are the broker settings of any symbol 1 PIP will always have approximately the same size for me.
On EURUSD a pip is 0.00010
On USDJPY a pip is 0.01000
There is no 'approximately'. There is only the actual value.
Your code is wrong. It looks like total babble to me.

Use mine.

Reason: