Reply

How to code manual pip value as input variable

6 replies

RuuddeHeer

Subscriber, bbp_participant, community, 3 replies.

Visit profile

6 years ago #116761

Hi,

 

Thank you for the productdevelopment so far. Currently i need an input variable which can enter a manual pip value. For instance the EUR\USD pip value is 0.00001

 

A pip value for the German30 is 0.5.

 

Is it possible to code an input variable for the pip value which is defined per symbol. Forex are 5 or 3 digit pip values,  Indices pip value differ.

 

Thanks in advance for reading and sharing.

 

Ruud de Heer

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #142840

Hello,

 

you can create an input variayble type double and set to 0.0001 if you need. Let me know your intentions how you need to use this variable I can create an example for Wizard

0

RuuddeHeer

Subscriber, bbp_participant, community, 3 replies.

Visit profile

6 years ago #142868

Hi,

 

Goal is to be certain that the resolution of the symbol in digits is correct. I want to avoid invalid stoploss or take profit levels when the order is modified as soon as a trade is executed.

 

For instance with EUR\USD the resolution is 5 digits. A pip value is 0.00001 A pip value with USD/JPY is 0.001 A pip value on the Dax30 is 0.5. I want to avoid rounding errors or hacking. I believe that a broker or EA can mess things up with setting the correct pip value per symbol.

 

Therefor an input variable for the manual pip value would be excellent. Unfortunately i am unknown how to code this in a strategy, with the correct initalisation and declaration of the correct variables and method.

 

Thanks in advance for the help.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #142972

Hello,

 

you might use ConvertToRealPips function using parameter (1 pip). It will provide correct decimal place for a symbol

0

RuuddeHeer

Subscriber, bbp_participant, community, 3 replies.

Visit profile

6 years ago #143253

Thanks for the reply.

 

I will check the funtion out. I believe the coef and rDigits variable is written for 2 digit and 4 digit assets. With the (MarketInfo(Symbol(),MODE_DIGITS) code the digits are retrieved per symbol. For fractional pips i will test if a double as input variable helps in the default setup.

 

As a newbie in coding i will trace the variables if EA wizard by default is suited for fractional pips.

0

mnlpad

Subscriber, bbp_participant, community, 7 replies.

Visit profile

6 years ago #143270

Hi,

 

My EA do not show results i think that this is affecting. How can i set this to 5 digits asset?

 

 double realDigits = Digits;
   if(realDigits > 0 && realDigits != 2 && realDigits != 4) {
      realDigits -= 1;
   }
 
   gPointPow = MathPow(1, realDigits);
   gPointCoef = 1/gPointPow;

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #143437

Hello,

 

EA should be working with 5 digits. Can you attach the mq4 or send me to [email protected]?

0

Viewing 6 replies - 1 through 6 (of 6 total)