very useful function need to be reversed

 

this function calculates the maximum down correction between 2 points

could any one please reverse it,, to calculate the maximum up correction

double getDif(int X0, int X3 )
{
   double maxdif;
   int P,B;
   for(int i=MathMax(X0,X3); i>=MathMin(X0,X3); i--)
   {
      for(int p=i-1; p>=MathMin(X0,X3); p--)
      {
         if(High[i]-Low[p] > maxdif )
         {
            maxdif = High[i]-Low[p];
            P = i;
            B = p;
         }
      }
   }
   
   

   
   CorrB = MathAbs(P-B); 
   
   return(NormalizeDouble(maxdif/Point,0));
}
 
3ammary:

this function calculates the maximum down correction between 2 points

could any one please reverse it,, to calculate the maximum up correction

if(High[i]-Low[p] > maxdif )
   {
      maxdif = High[i]-Low[p];
if(Low[i]-High[p] > maxdif )
   {
      maxdif = Low[i]-High[p];
 

thanks but ......

it still didn't work

is there any other thing to modificate in the function

 
could any one please type the complete function,, and test it
 
3ammary:
could any one please type the complete function,, and test it
Has your keyboard broken ? obviously not . . . test it yourself and fix it . . .
 
it didn't work i tested it alot,,, if it had worked why i asked here,,,
 
3ammary:
it didn't work i tested it alot,,, if it had worked why i asked here,,,
So add some debugging Print statements, find out what is wrong and fix it.
 
ok i'll try
 
thank u
Reason: