Scripts: LOCLinePipsAgile a Script to display distance in pips from horizontal lines to current market price

 

LOCLinePipsAgile a Script to display distance in pips from horizontal lines to current market price:

This script is useful when you drop lines on chart and want to see the distance to current market price. You can drag line and see the distance in pips.

Author: mikhail

 
The stated purpose is to display the "distance in pips" But what it does is display the distance in points. A pip is NOT a point on 5 digit brokers.
//++++ These are adjusted for 5 digit brokers.
int     pips2points;    // slippage  3 pips    3=points    30=points
double  pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int     init(){
    if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
}
string  DeltaToPips(double d){
    if (d > 0)  string sign = "+";  else    sign = "";
    double pips = d / pips2dbl;
    string dPip = sign + DoubleToStr(pips, 0);  if(Digits.pips==0) return(dPip);
    string dFrc = sign + DoubleToStr(pips, Digits.pips);
    if (dPip+".0" == dFrc)      return(dPip);           return(dFrc);          }
========
// DoubleToStr(MathAbs((Bid-price)/Point)
   DeltaToPips(MathAbs(Bid-price))
 
WHRoeder:
The stated purpose is to display the "distance in pips" But what it does is display the distance in points. A pip is NOT a point on 5 digit brokers.

For 5 digit account it displays Fractional pips distance. I think this script should show it. No reason to hide
 
WHRoeder:
The stated purpose is to display the "distance in pips" But what it does is display the distance in points. A pip is NOT a point on 5 digit brokers.
cala Pip 10 points if you say 1/100000 is not a pip, just a multiple of 10
 
Can you please modify the location of the distance value to a bit right so that when the price goes up/down from the line ,we still can see the figure.
 

Hi Landofcash I'm a newbie who is looking for something along these lines--would prefer something to calculate pip value to $ value however this looks great. My provider is a 5 digit broker however i don't trade in micros, does this script still calculate the 4th digit.

As i,m a newbie do I pay you to download the script, obviously happy to do so or if you have a script to calculate pip $ value even better

Kindest Regards


Monty

 
Is that something wrong? I can not run it on my mt4 platform. Please help.
Files:
ERROR.jpg  233 kb