Is there any way to define consolidation?

 

Dear all

Does any one know how to teach EA to define consolidation?

or if it is impossible, how to handle it if your system will generate signal in consolidation?

Thanks for your reply in advance.

Wing

 
wing:
Does any one know how to teach EA to define consolidation?\

You must come up with a definition of consolidation. Then it can be coded.

For example if you define consolidation as the range of the last 10 bars is less then 2.5 ATR

int iHigh = Highest(NULL,0, MODE_HIGH, 10, 0),
    iLow  =  Lowest(NULL,0, MODE_LOW,  10, 0);
double range = High[iHigh] - Low[iLow],
       atr   = iATR(NULL,0, 14, 1);
bool isConsolidation = range < 2.5 * atr;
if (isConsolidation) Print("Consolidation");
 
WHRoeder:

You must come up with a definition of consolidation. Then it can be coded.

For example if you define consolidation as the range of the last 10 bars is less then 2.5 ATR


WHRoeder, thank you so much for your reply! In fact, I really don't have an idea how to define. Can you tell me more?

Is it efficent to use "range of last 10 bars < 2.5 ATR"? Is it the most common way? or do you know whether there is another way to define it by traders?

Wing

 
wing:
In fact, I really don't have an idea how to define.

Is it efficent to use "range of last 10 bars < 2.5 ATR"? Is it the most common way? or do you know whether there is another way to define it by traders?
  1. If you can't define it, you can't possibly code it.
  2. Efficient yes. Useful, no idea.
  3. Common, I have no idea. I just combined two ideas for an example. Do your own research.
  4. A million traders, a million ways to define it.
 
William Roeder:
  1. If you can't define it, you can't possibly code it.
  2. Efficient yes. Useful, no idea.
  3. Common, I have no idea. I just combined two ideas for an example. Do your own research.
  4. A million traders, a million ways to define it.

Based on your experience, could you please recommend some good approaches to finding consolidation.

Reason: