Please Help on Fractals - page 3

 
oladapolaleye:

Thank you very much. It works now. But one thing more, the LastUpperFractal, LastButOneUpperFractal, LastLowerFractal, LastButOneLowerFractal returned BarNumber instead of the value of the Fractals. Please what else could be done to have these values.

Given a bar number how do you get the high or low of that bar ? if you don't know this you need to start reading the Book
 
RaptorUK:
Given a bar number how do you get the high or low of that bar ? if you don't know this you need to start reading the Book


RaptorUK, you have been so good to me and others on this forum, to be sincere, I don't know how to get the value of LastButOneUpperFractal and LastButOneLowerFractal. To start to read the Book now may not solve this problem now but I'll start reading the Book for future purpose. So, please to get those two values is very important now and am also learning from you through this.

Thanks.

 
oladapolaleye:

RaptorUK, you have been so good to me and others on this forum, to be sincere, I don't know how to get the value of LastButOneUpperFractal and LastButOneLowerFractal. To start to read the Book now may not solve this problem now but I'll start reading the Book for future purpose. So, please to get those two values is very important now and am also learning from you through this.

Thanks.

OK, my last post on this thread . . .

Click ---> High[] Low[] or iHigh() & iLow()

 
oladapolaleye:

value of LastButOneUpperFractal and LastButOneLowerFractal.



what do you exactly mean by LastButOne?

 
szgy74:


what do you exactly mean by LastButOne?


That is the Fractal before the last; LastButOneUpperFractal or LastButOneLowerFractal.


Thanks.

 

the price values you need (using Raptor's code):


Low[LastButOneLowerFractal]
High[LastButOneUpperFractal]
 
RaptorUK:

OK, my last post on this thread . . .

Click ---> High[] Low[] or iHigh() & iLow()


RaptorUK, million thanks to you for help, teaches, instruction and direction. It finally returned values. See how I did it:

     int LastUpperFractal, LastButOneUpperFractal, LastLowerFractal, LastButOneLowerFractal;
   int BarNumber = 2;
   double UpperFractal, LowerFractal;
   double PreviousUpperFractal, PreviousLowerFractal;

   while(LastUpperFractal == 0 || LastButOneUpperFractal == 0 || LastLowerFractal == 0 || LastButOneLowerFractal == 0)
      {
      UpperFractal = iFractals(NULL, 0, MODE_UPPER, BarNumber); 
      LowerFractal = iFractals(NULL, 0, MODE_LOWER, BarNumber);
      
      Print("Bar: ", BarNumber, " UpperFractal: ",  UpperFractal, " LowerFractal: ", LowerFractal);
      
      if(UpperFractal > 0.0) 
         { 
         if(LastUpperFractal > 0)
            LastButOneUpperFractal = BarNumber;
         else LastUpperFractal = BarNumber;  
         }

      if(LowerFractal > 0.0) 
         {
         if(LastLowerFractal > 0)
            LastButOneLowerFractal = BarNumber;
         else LastLowerFractal = BarNumber;  
         }
      BarNumber++;
      }
      PreviousUpperFractal = iHigh(NULL,0,LastButOneUpperFractal);
      PreviousLowerFractal = iLow(NULL,0,LastButOneLowerFractal);

   Print("LastUpperFractal: ", UpperFractal, " LastButOneUpperFractal: ", PreviousUpperFractal, " LastLowerFractal: ", LowerFractal, " LastButOneLowerFractal: ", PreviousLowerFractal); 
//----
   return(0);
  }
 
WHRoeder:
You have to find them

Hi,

In your comment you say to never use a shift=1 because the bar is forming.

Is this the reason why for every shift<2 I get always values at 0?

Reason: