want to get rid of extra 0's

 

Hi guys,

I am coding a simple gap indy for myself and am wondering how to get rid of the extra zero's at the end of the usable numbers...


have a look at the pic and you will see the extra 0's. I have tried normalizedouble, mathround and mathfloor to no avail.

any help much appreciated.




heres the code :

int start()
  {
   int    counted_bars=IndicatorCounted();

//---- Closes and Prices
    close = iClose(Symbol(),PERIOD_D1,1);
    open  = iOpen(Symbol(),PERIOD_D1,0); 

//---- Is it end of weekend?
if(DayOfWeek()==0)trade=true;
  
//---- Have we gapped UP or DOWN

   if(close<open)gapup=true;
   if(close>open)gapdown=true;

//---- Difference Calcs
   differenceup   = NormalizeDouble(open-close,5);
   differencedown = NormalizeDouble(close-open,5);   
    if(differenceup>=0&&differencedown<0)differenceup=finaldifference;
    if(differencedown>=0&&differenceup<0)differencedown=finaldifference;
//---- Spread calc
   spread = (Ask-Bid)*10000;
   spread1 = NormalizeDouble(spread,2);
  //double spread2 = spread1*Point;

//---- SL and TP calcs
    percentlong = (((open-close)/100)*75)+open;
    percentshort= (((close-open)/100)*75)+open;
   
   if(gapup==true)sl=(open+0.00040);
   if(gapdown==true)sl=(open-0.00040);
   
   if(gapup==true)tp=percentlong;
   if(gapdown==true)tp=percentshort;
//---- Is the gap tradable?

   if(differenceup>Minimum_Gap)tradableup=true;
   if(differencedown>Minimum_Gap)tradabledown=true;

//---- Lets Plot the Info

    ObjectCreate("title",OBJ_LABEL,0,0,0);
    ObjectSetText("title","PipsMaximus Gap Trade Indicator",18,"Times New Roman",Gold);
    ObjectSet("title", OBJPROP_XDISTANCE, 10);
    ObjectSet("title", OBJPROP_YDISTANCE, 40);  
    
    ObjectCreate("underline",OBJ_LABEL,0,0,0);
    ObjectSetText("underline","_________________________________________",12,"Times New Roman",Maroon);
    ObjectSet("underline", OBJPROP_XDISTANCE, 10);
    ObjectSet("underline", OBJPROP_YDISTANCE, 45);      
    
    ObjectCreate("gapsize",OBJ_LABEL,0,0,0);
    ObjectSetText("gapsize","Gap Size   : "+finaldifference,16,"Times New Roman",Gold);
    ObjectSet("gapsize", OBJPROP_XDISTANCE, 60);
    ObjectSet("gapsize", OBJPROP_YDISTANCE, 80);
    
    ObjectCreate("spread",OBJ_LABEL,0,0,0);
    ObjectSetText("spread","Spread       : "+spread1,16,"Times New Roman",Gold);
    ObjectSet("spread", OBJPROP_XDISTANCE, 60);
    ObjectSet("spread", OBJPROP_YDISTANCE, 110);  
       
    ObjectCreate("stoploss",OBJ_LABEL,0,0,0);
    ObjectSetText("stoploss","Stoploss    : "+sl,16,"Times New Roman",Gold);
    ObjectSet("stoploss", OBJPROP_XDISTANCE, 60);
    ObjectSet("stoploss", OBJPROP_YDISTANCE, 140);  
    
    ObjectCreate("takeprofit",OBJ_LABEL,0,0,0);
    ObjectSetText("takeprofit","Takeprofit : "+tp,16,"Times New Roman",Gold);
    ObjectSet("takeprofit", OBJPROP_XDISTANCE, 60);
    ObjectSet("takeprofit", OBJPROP_YDISTANCE, 170);   
    
//---- END   
   return(0);
  }
//+------------------------------------------------------------------+
 

many thanx, I will read it. your guidance is much appreciated :)
 
23510:

Hi guys,

I am coding a simple gap indy for myself and am wondering how to get rid of the extra zero's at the end of the usable numbers...


have a look at the pic and you will see the extra 0's. I have tried normalizedouble, mathround and mathfloor to no avail.

any help much appreciated.




heres the code :

The name PipsMaximus the indicator the code and the strategy is copyright protected
 

i dont believe you can copyright a strategy

Reason: