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.
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.
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?
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.
//перевод из старых пунктов в пункты текущего счёта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));
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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
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
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 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: