跳至内容

SetIndexShift

SetIndexShift

设置绘制线的偏移量。

void  SetIndexShift(
   int     index,       // line index
   int     shift        // shift
   );

参数

index

[in] 线条索引。必须在0到7之间。

shift

[in] 以条形表示的偏移值。

返回值

无。

注意

对于正值,线条将向右偏移;对于负值,线条将向左偏移。即,当前条形上计算出的偏移值将相对于当前条形进行绘制。

示例:

//+------------------------------------------------------------------+
//| 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);
  }

另请参阅

自定义指标属性

最后更新于