Pip Value code

There is necessity to improve this part of the code about pipVAlue multiplier:



 double pipValue = 10.0;
   if(StringFind(Symbol(), "XA") >= 0) {
      // it is gold or metal
      pipValue = 1.0;
   }


The pip value will vary according with digits of the broker. For example, Dukascopy has XAUUSD with 3 digits instead of 2 digits. So, The pipvalue multiplier for dukascopy is wrong for XAUUSD. The logic of the code above will set the pipvalue equal 1, but for dukascopy the right pipvalue is 10 due third digit.

Attachments
No attachments
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority High

History

FB
#1

lumbrjack

17.12.2017 15:39

Task created

t
#2

tnickel

17.12.2017 21:41
Is the pip/value correct for BTCUSD ?
FB
#3

lumbrjack

19.12.2017 01:22
I don´t have BTCUSD on my broker. But you could test if the value is right. For example, open an Order risking 1% and see if the stoploss match 1% account loss. If don´t match, could be a wrong pipvalue.
FB
#4

lumbrjack

23.01.2018 23:47
I remember a simple solution for pipvalue that works for forex and metals. I don´t investigate if it work for other markets:


 double pipValue = 10.0;


   if(Digits == 4 || Digits == 2)

//Symbols with 4 digits (4 digits brokers) and 2 digits (GOLD and JPY 2 digits brokers) will multiplied by 1

pipValue = 1.0;


g
#5

geektrader

18.04.2018 10:35
You can´t calculate the pip value like that, it is not always 1 or 10, as this depends on the denominated currency of the pair that is being traded and the base currency of the account of the trader. To correctly calculate the real pip value, you have to use:


(MarketInfo(Symbol(),MODE_TICKVALUE)*MarketInfo(Symbol(),MODE_POINT)) / MarketInfo(Symbol(),MODE_TICKSIZE);

FB
#6

lumbrjack

18.04.2018 12:51
I´m referring to variable "pipvalue" declared in mql4 code. This variable is used as factor adjuster for number of digits from a broker. The variable that calculates the Pip value is "CurrencyAdjuster" that is stated below:


// adjust money management for non-US currencies

   double CurrencyAdjuster=1;

   if (MarketInfo(Symbol(),MODE_TICKSIZE)!=0) CurrencyAdjuster=MarketInfo(Symbol(),MODE_TICKVALUE) * (MarketInfo(Symbol(),MODE_POINT) / MarketInfo(Symbol(),MODE_TICKSIZE));


TB
#7

Tomas Brynda

15.11.2018 11:12

Status changed from New to Fixed

The pip values handling has been improved in SQX. For some problematic markets, it is possible to set tickSize manually in EA parameters.

Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please