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

 
WHRoeder:
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.

Your solution (behind your link I tried but never felt comfortable) fails with Gold and Silver. If you would have a single solution for those symbols like

   If (Gold.Digits == 2 || Silver.Digits == 2) PIP = 0.1;

you would fail again as I now have a broker that has 3 digits for Gold and Silver and a pip would be 100 points and his DAX30 has 2 Digits but a 10-Euro-PIP would be 1000 points.

So either you generate a huge list with brokers and their pips and points or you just start to think what might have been behind the definition and what might be important for you and your risk and strop and target setting.

My solution let you easily define a target of 100 units of your account which would be 10 (of mine) pips.

I think it has a lot more advantages as I am not trading someone else definitions but my money and around 10 bugs is a good base for comparisons.

gooly

 
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



if( Digits%2>0.5 ){
         Points*=0.1;
         Speed*=0.1;
      }
 
Carl Schreiber #:

Your solution (behind your link I tried but never felt comfortable) fails with Gold and Silver. If you would have a single solution for those symbols like

you would fail again as I now have a broker that has 3 digits for Gold and Silver and a pip would be 100 points and his DAX30 has 2 Digits but a 10-Euro-PIP would be 1000 points.

So either you generate a huge list with brokers and their pips and points or you just start to think what might have been behind the definition and what might be important for you and your risk and strop and target setting.

My solution let you easily define a target of 100 units of your account which would be 10 (of mine) pips.

I think it has a lot more advantages as I am not trading someone else definitions but my money and around 10 bugs is a good base for comparisons.

gooly

i solved like this :

pPIPsStep = ConvertFromOldPoints(PIPsStep,Symbol());

Function for 3 Digits XAUUSD and JPY pairs: 

//перевод из старых пунктов в пункты текущего счёта
int ConvertFromOldPoints(double ePoints, string eSymbol)
   {
   int eFactor;
   int eDigits=(int)SymbolInfoInteger(eSymbol,SYMBOL_DIGITS);
   //если это форекс и количество знаков после запятой нечётное, тогда домножаем на 10
   #ifdef __MQL4__
      eFactor=(MarketInfo(eSymbol,MODE_MARGINCALCMODE)==0 && MarketInfo(eSymbol,MODE_PROFITCALCMODE)==0 && eDigits%2==1)?100:1;
   #else
      eFactor=((SymbolInfoInteger(eSymbol,SYMBOL_TRADE_CALC_MODE)==SYMBOL_CALC_MODE_FOREX || SymbolInfoInteger(eSymbol,SYMBOL_TRADE_CALC_MODE)==SYMBOL_CALC_MODE_FOREX_NO_LEVERAGE) && eDigits%2==1)?100:1;
   #endif 
   return((int)(ePoints*eFactor+0.5));
   }