2 type=INDICATOR_ADVISOR
\r
47 #property copyright "#copyright#"
\r
48 #property link "#link#"
\r
50 #indicator_properties#
\r
53 //---- indicator buffers
\r
54 double ExtBlueBuffer[];
\r
55 double ExtRedBuffer[];
\r
56 double ExtLimeBuffer[];
\r
58 //+------------------------------------------------------------------+
\r
59 //| Custom indicator initialization function |
\r
60 //+------------------------------------------------------------------+
\r
64 //---- line shifts when drawing
\r
65 SetIndexShift(0,JawsShift);
\r
66 SetIndexShift(1,TeethShift);
\r
67 SetIndexShift(2,LipsShift);
\r
68 //---- first positions skipped when drawing
\r
69 SetIndexDrawBegin(0,JawsShift+JawsPeriod);
\r
70 SetIndexDrawBegin(1,TeethShift+TeethPeriod);
\r
71 SetIndexDrawBegin(2,LipsShift+LipsPeriod);
\r
72 //---- 3 indicator buffers mapping
\r
73 SetIndexBuffer(0,ExtBlueBuffer);
\r
74 SetIndexBuffer(1,ExtRedBuffer);
\r
75 SetIndexBuffer(2,ExtLimeBuffer);
\r
76 //---- drawing settings
\r
78 //---- initialization done
\r
81 //+------------------------------------------------------------------+
\r
82 //| Bill Williams' Alligator |
\r
83 //+------------------------------------------------------------------+
\r
87 int counted_bars=IndicatorCounted();
\r
88 //---- check for possible errors
\r
89 if(counted_bars<0) return(-1);
\r
90 //---- last counted bar will be recounted
\r
91 if(counted_bars>0) counted_bars--;
\r
92 limit=Bars-counted_bars;
\r
94 for(int i=0; i<limit; i++)
\r
96 //---- ma_shift set to 0 because SetIndexShift called abowe
\r
97 ExtBlueBuffer[i]=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
\r
98 ExtRedBuffer[i]=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
\r
99 ExtLimeBuffer[i]=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
\r
104 //+------------------------------------------------------------------+
\r