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

Moderator
182378
2011.08.29 10:31
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

14741
2011.08.29 15:02
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))```
57
2011.09.02 20:18
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
16319
2012.12.07 19:39
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`
16319
2013.03.25 02:29
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.
16319
2013.04.24 08:19

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