support 发表于 2023-1-5 11:56:33

SetIndexShift( )【自定义指标篇-MQL4函数】

void SetIndexShift( int index, int shift)
撤销画线设置。对于仓位值,画线将会平移到右侧或是平移到左侧。在当前柱计算值将被平移到相应的柱。

参数:
index   -   索引线。必须在0至7之间。
shift   -   平移植。

示例:

//+------------------------------------------------------------------+
//| Alligator initialization function                              |
//+------------------------------------------------------------------+
int init()
{
//----当画出时线平移
   SetIndexShift(0,JawsShift);
   SetIndexShift(1,TeethShift);
   SetIndexShift(2,LipsShift);
//---- 当画出时越过地一个位置
   SetIndexDrawBegin(0,JawsShift+JawsPeriod);
   SetIndexDrawBegin(1,TeethShift+TeethPeriod);
   SetIndexDrawBegin(2,LipsShift+LipsPeriod);
//---- 绘制3个添加缓冲位置
   SetIndexBuffer(0,ExtBlueBuffer);
   SetIndexBuffer(1,ExtRedBuffer);
   SetIndexBuffer(2,ExtLimeBuffer);
//---- 画出设定
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);
//---- 索引标签
   SetIndexLabel(0,"Gator Jaws");
   SetIndexLabel(1,"Gator Teeth");
   SetIndexLabel(2,"Gator Lips");
//---- 初始化完成
   return(0);
}

页: [1]
查看完整版本: SetIndexShift( )【自定义指标篇-MQL4函数】