Help with price action indicator

 
Hi all,

I have created an indicator based on price action but I only want the signal to appear if the three signal candles are roughly the same size in other words non VOLATILE moments. Is this possible to code ? How would I do this? Big thank you in advance
 

Codeme:

Is this possible to code ?

How would I do this?

  1. Once you decide what you mean by roughly, same, VOLATILE.
  2. See #1. I would use
    bool volatile(double max, int iEnd, int iBeg=0){
       double sizeMax = 0, sizeMin = DBL_MAX;
       for(; iBeg < iEnd; ++iBeg){
          double size = High[iBeg] - Low[iBeg];
          if(sizeMin > size) sizeMin = size;
          if(sizeMax < size) sizeMax = size;
       }
       if(sizeMin == 0.0) return false;
       return sizeMax / sizeMin > max;
    }
 

When it comes to coding, there is no such thing as "roughly the same size ".

You have to define precisely the conditions that you require 

 
WHRoeder:
  1. Once you decide what you mean by roughly, same, VOLATILE.
  2. See #1. I would use

Great thanks , I know roughly not good enough :) I am trying to confirm that there are not big differences between all three candles in other words non volatile movements. Thanks again I will give it ago
Reason: