1 //+------------------------------------------------------------------+
\r
3 //| Copyright © 2004, MetaQuotes Software Corp. |
\r
4 //| http://www.metaquotes.net/ |
\r
5 //+------------------------------------------------------------------+
\r
6 #property copyright "Copyright © 2004, MetaQuotes Software Corp."
\r
7 #property link "http://www.metaquotes.net/"
\r
9 #property indicator_chart_window
\r
10 #property indicator_buffers 3
\r
11 #property indicator_color1 Blue
\r
12 #property indicator_color2 Red
\r
13 #property indicator_color3 Lime
\r
14 //---- input parameters
\r
15 extern int JawsPeriod=13;
\r
16 extern int JawsShift=8;
\r
17 extern int TeethPeriod=8;
\r
18 extern int TeethShift=5;
\r
19 extern int LipsPeriod=5;
\r
20 extern int LipsShift=3;
\r
21 //---- indicator buffers
\r
22 double ExtBlueBuffer[];
\r
23 double ExtRedBuffer[];
\r
24 double ExtLimeBuffer[];
\r
26 //+------------------------------------------------------------------+
\r
27 //| Custom indicator initialization function |
\r
28 //+------------------------------------------------------------------+
\r
31 //---- line shifts when drawing
\r
32 SetIndexShift(0,JawsShift);
\r
33 SetIndexShift(1,TeethShift);
\r
34 SetIndexShift(2,LipsShift);
\r
35 //---- first positions skipped when drawing
\r
36 SetIndexDrawBegin(0,JawsShift+JawsPeriod);
\r
37 SetIndexDrawBegin(1,TeethShift+TeethPeriod);
\r
38 SetIndexDrawBegin(2,LipsShift+LipsPeriod);
\r
39 //---- 3 indicator buffers mapping
\r
40 SetIndexBuffer(0,ExtBlueBuffer);
\r
41 SetIndexBuffer(1,ExtRedBuffer);
\r
42 SetIndexBuffer(2,ExtLimeBuffer);
\r
43 //---- drawing settings
\r
44 SetIndexStyle(0,DRAW_LINE);
\r
45 SetIndexStyle(1,DRAW_LINE);
\r
46 SetIndexStyle(2,DRAW_LINE);
\r
48 SetIndexLabel(0,"Gator Jaws");
\r
49 SetIndexLabel(1,"Gator Teeth");
\r
50 SetIndexLabel(2,"Gator Lips");
\r
51 //---- initialization done
\r
54 //+------------------------------------------------------------------+
\r
55 //| Bill Williams' Alligator |
\r
56 //+------------------------------------------------------------------+
\r
60 int counted_bars=IndicatorCounted();
\r
61 //---- check for possible errors
\r
62 if(counted_bars<0) return(-1);
\r
63 //---- last counted bar will be recounted
\r
64 if(counted_bars>0) counted_bars--;
\r
65 limit=Bars-counted_bars;
\r
67 for(int i=0; i<limit; i++)
\r
69 //---- ma_shift set to 0 because SetIndexShift called abowe
\r
70 ExtBlueBuffer[i]=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
\r
71 ExtRedBuffer[i]=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
\r
72 ExtLimeBuffer[i]=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
\r
77 //+------------------------------------------------------------------+
\r