At the end of the code, add :

Code:
void TLine(string name,datetime T0,double P0,datetime T1,double P1,color clr,bool ray=false){
    #define WINDOW_MAIN 0
    //if (!Show.Objects)  return;
    /**/ 
    if(ObjectMove(name,0,T0,P0))ObjectMove(name,1,T1,P1);
    else if(!ObjectCreate(name,OBJ_TREND,WINDOW_MAIN,T0,P0,T1,P1))Alert("ObjectCreate(",name,",TREND) failed: ",GetLastError());
    else if(!ObjectSet(name,OBJPROP_RAY,ray))Alert("ObjectSet(",name,",Ray) failed: ",GetLastError());
    if (!ObjectSet(name,OBJPROP_COLOR,clr))Alert("ObjectSet(", name, ",Color) [2] failed: ", GetLastError());
    string P0t=PriceToStr(P0);
    ObjectSetInteger(0,name,OBJPROP_WIDTH,2);
    if(MathAbs(P0-P1)>=Point)P0t=StringConcatenate(P0t," to ",PriceToStr(P1));
    if(!ObjectSetText(name,P0t,10))Alert("ObjectSetText(",name,") [2] failed: ", GetLastError());
}

string PriceToStr(double p){
    string pFrc=DoubleToStr(p, Digits);
    if(Digitspips==0)return(pFrc);
    string pPip=DoubleToStr(p,Digits-1);
    if(pPip+"0"==pFrc)return(pPip);
    return(pFrc);
}
Inside Start, you can set a trend line :

Code:
TLine("Trendline",iTime(NULL,0,0),value,iTime(NULL,0,valuek),value,White,false);
You just need to determine value and valuek.

In Init, add :

Code:
    if(Digits==5 || Digits==3){
       pips2dbl=Point*10;
       pips2points=10;
       Digitspips=1;
    }
    else{
       pips2dbl=Point;
       pips2points=1;
       Digitspips=0;
    }
Before Init, add :

Code:
int pips2points;
double pips2dbl;
int Digitspips;