code 100.0 pips

Back to topics list To post a new topic, please log in or register
avatar
37
Max-Enrik 2016.04.17 23:23
 

Hello,

 

How can I get code for 100.0 pips?

 

Best,

Max 

avatar
Moderator
3404
GumRai 2016.04.17 23:28 #
 
You will have to write your question so that we know what you are asking
avatar
37
Max-Enrik 2016.04.18 00:21 #
 
GumRai:
You will have to write your question so that we know what you are asking

I need to plus 100pips to "openDay"

string lvl_plus100pip = DoubleToStr( dayOpenPrice * 0.01 );

 

Above code for EURUSD but when I use that code for USDJPY it does not work until when I change it like below. 

DoubleToStr( dayOpenPrice * 1.0 );

 

avatar
12983
WHRoeder 2016.04.18 03:25 #
 
Max-Enrik: How can I get code for 100.0 pips?
  1. There is Tick, PIP, and Point. They are all different in general. A tick is the smallest change of price. A Point is the least significant digit quoted. In currencies a pip is defined as 0.0001 (or for JPY 0.01)

    On a 4 digit broker a point (0.0001) = pip (0.0001). [JPY 0.01 == 0.01] On a 5 digit broker a point (0.00001) = 1/10 pip (0.00010/10). Just because you quote an extra digit doesn't change the value of a pip. (0.0001 == 0.00010) EA's must adjust pips to points (for mq4.) In currencies a tick is a point. Price can change by least significant digit (1.23456 -> 1.23457)

    In metals a Tick is still the smallest change but is larger than a point. If price can change from 123.25 to 123.50, you have a TickSize of 0.25 and a point of 0.01. Pip has no meaning.

    This is why you don't use TickValue by itself. Only as a ratio with TickSize. See DeltaValuePerLot()

  2. #define  CHANGE         double      ///< Difference of two prices.
    #define  POINT          int         ///< `CHANGE / _Point`.
    #define  PIP            double      ///< `POINT / PipsPerPOINT`.
    CHANGE   points_to_change(POINT n){          return n * _Point;                }
    POINT    change_to_points(CHANGE c){         return POINT(c / _Point + 0.5);   }
    CHANGE   pips_to_change(PIP n){     return points_to_change(pips_to_points(n));}
    PIP      change_to_pips(CHANGE c){  return points_to_pips(change_to_points(c));}
    POINT    pips_to_points(PIP n){              if( (_Digits&1) == 1)   n *= 10.0;
                                                 return POINT(n);                  }
    PIP      points_to_pips(POINT n){PIP p = n;  if( (_Digits&1) == 1)   p /= 10.0;
                                                 return p;                         }
    // Digits            DE30  EURNOK   USDJPY   EURUSD   USDMXN   USDZAR
    // Digits            1     5        3        5        4        5
    // point             0.1   0.00001  0.001    0.00001  0.00001  0.00001
    // ticksize          0.5   "        "        "        "        "
    // Pip/lot(USD)            1.19     8.23     10.00    0.60     0.73
    // Spread                  214.8    1.9      2.3      351.4    181.7
    // Spread/lot(USD)         256.31   15.64    23.00    211.97   133.33
    
  3. 100.0 pips?
    double SL = OrderOpenPrice() - pips_to_change( 100 );
avatar
37
Max-Enrik 2016.04.18 11:08 #
 
WHRoeder:
  1. There is Tick, PIP, and Point. They are all different in general.

Thanks for your reply @WHRoeder

I will try it soon.

Best,

Max 

avatar
37
Max-Enrik 2016.05.01 00:24 #
 

Hello,

 

Thanks for your time @WHRoeder. 

Really I spend a time for I understand that what you wrote above. For getting 100 pips code for every currencies pair, but I think I cannot write codes for what I want. Also I think that is not for beginner level as I know.

Also if there is possible easy / quick way for I can get 100pips code. If have a time write it how can I do that, please.

 

Anyway thanks.

Max 

avatar
12983
WHRoeder 2016.05.01 14:35 #
 
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
avatar
37
Max-Enrik 2016.05.01 14:37 #
 
WHRoeder:
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.

Thanks for your replies.

I think will try for that.

Best,

Max 

Back to topics list  

To add comments, please log in or register