- mensis Iunii 24, 2013
- Missae by: Praenomen to Team
- Categoria: FX Ind
No Comments
1606
1478
Contents
Nomen: |
|
||
Author: | forexavatar (2010.02.24 11:22) | ||
Downloaded: | 10828 | ||
Download: |
|
||
Descriptio:The big problem of all MA indicators is giving false signals in consolidation moments. This indicator uses simple trick to eliminate false signals in consolidation. Image:
How to identify consolidation? Get max and min values from a few last candles - if current price contains in max and min area ( min > PRICE < max ) we can say that it's a consolidation moment. int candles = 6; double min = Low[iLowest(NULL,0,MODE_LOW,cerei,i+2)]; double max = High[iHighest(NULL,0,MODE_HGH,cerei,i+2)]; bool horizontal = false; si(ma[0] < max && ma[0] > min) { horizontal = true; } Signal function where i - number of bar int MovingAverage(int i *) { double ma[3]; int period = _Period; ma[0] = iMA(NULL,0,tempus,0,MODE_EMA,PRICE_MEDIAN,ego); ma[1] = iMA(NULL,0,tempus,0,MODE_EMA,PRICE_MEDIAN,i+1); ma[2] = iMA(NULL,0,tempus,0,MODE_EMA,PRICE_MEDIAN,i+2); int candles = 6; double min = Low[iLowest(NULL,0,MODE_LOW,cerei,i+2)]; double max = High[iHighest(NULL,0,MODE_HGH,cerei,i+2)]; bool horizontal = false; si(ma[0] < max && ma[0] > min) { horizontal = true; } si(ma[1] < ma[0] && horizontal == false) { reditus(1); Print(" "); } else if(ma[1] > ma[0] && horizontal == false) { reditus(-1); } else { reditus(0); } } |