MQL4 Reference  Custom Indicators
 Custom Indicators  SetIndexShift
  SetIndexShift
  
    
      
| 
SetIndexShiftSets offset for the drawing line. 
| void  SetIndexShift(int     index,
 int     shift
 );
 | Parameters index [in]  Line index. Must lie between 0 and 7. shift [in]  Shift value in bars. Returned value Note Example: 
| //+------------------------------------------------------------------+//| Alligator initialization function                                |
 //+------------------------------------------------------------------+
 int init()
 {
 //---- line shifts when drawing
 SetIndexShift(0,JawsShift);
 SetIndexShift(1,TeethShift);
 SetIndexShift(2,LipsShift);
 //---- first positions skipped when drawing
 SetIndexDrawBegin(0,JawsShift+JawsPeriod);
 SetIndexDrawBegin(1,TeethShift+TeethPeriod);
 SetIndexDrawBegin(2,LipsShift+LipsPeriod);
 //---- 3 indicator buffers mapping
 SetIndexBuffer(0,ExtBlueBuffer);
 SetIndexBuffer(1,ExtRedBuffer);
 SetIndexBuffer(2,ExtLimeBuffer);
 //---- drawing settings
 SetIndexStyle(0,DRAW_LINE);
 SetIndexStyle(1,DRAW_LINE);
 SetIndexStyle(2,DRAW_LINE);
 //---- index labels
 SetIndexLabel(0,"Gator Jaws");
 SetIndexLabel(1,"Gator Teeth");
 SetIndexLabel(2,"Gator Lips");
 //---- initialization done
 return(0);
 }
 | See also |