points counter between high to low or low to high

 

hi am traying to make an indicator that help me to find how many points between high to low / low to high

attached is my code but it need some modification because am not good in mql4

any one can help me to finish it?

and thanks

//+------------------------------------------------------------------+
//|                                                         points counter.mq4
//|                      Copyright © 2011, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
extern string PriceType=" 1=HightoLow / 2=LowtoHigh ";
extern int Type=1;
extern datetime  StartTime=D'2011.03.07 00:00';
extern datetime  EndTime=D'2011.03.11 00:00';


double point;
int init() {
if(Digits<4){point=0.01;}
     else{point=0.0001;}
   return(0);
   }

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit() {
ObjectDelete("H2L");
   ObjectDelete("L2H");
      return (0);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

//a
{
   int D=StartTime;
   int i=EndTime;
   double shifthighD=iBarShift(NULL,0,D,false);
   double shiftlowD=iBarShift(NULL,0,D,false);
   double shifthighi=iBarShift(NULL,0,i,false);
   double shiftlowi=iBarShift(NULL,0,i,false);
   {
if (Type==1)
 double H2L=High [shifthighD] -Low [shiftlowi];
 
 ObjectCreate("H2L", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Range high2low", 14, "Arial", White);
      ObjectSet("H2L", OBJPROP_XDISTANCE, 20);
      ObjectSet("H2L", OBJPROP_YDISTANCE, 20);
      ObjectSet("H2L", OBJPROP_CORNER, 1);
     
if (Type==2)
double L2H= Low[shiflowD]-High[shifthighi];
 
 ObjectCreate("L2H", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Rangelow2high", 14, "Arial", White);
      ObjectSet("L2H", OBJPROP_XDISTANCE, 20);
      ObjectSet("L2H", OBJPROP_YDISTANCE, 20);
      ObjectSet("L2H", OBJPROP_CORNER, 1);
 }
   return (0);
}}
 


any help plz

 

A) having code that doesn't compile is not helpful

B) assigning datetime to int & int to double is not good practice

   int i=EndTime; // should assign datetime to datetime
   double shifthighD=iBarShift(NULL,0,D,false); // should assign int to int
 
brewmanz:

A) having code that doesn't compile is not helpful

B) assigning datetime to int & int to double is not good practice



that because am not good in mql4 and asking for some help........

thanks for u

Reason: