|
区分上下横的运行轨道指标(适合4小时欧美)
图示:
代码:‘
- //根据某种条件,将 上行/震荡/下行 用不同的颜色分割开
- #property indicator_buffers 4
- #property indicator_color1 Black
- #property indicator_color2 Red
- #property indicator_color3 Blue
- #property indicator_color4 Green
- #property indicator_separate_window
- #property indicator_level1 1
- #property indicator_level2 0.2
- #property indicator_level3 -0.2
- #property indicator_level4 -1
- #property indicator_minimum -3
- #property indicator_maximum 3
- extern int 平均振幅周期=10;
- int 均线周期=60;
- double 新Slope缓冲区[];
- double 上行标示缓冲区[];
- double 震荡标示缓冲区[];
- double 下行标示缓冲区[];
- int 符号代码_上行=225;
- int 符号代码_震荡=224;
- int 符号代码_下行=226;
- int init()
- {
- //---- indicators
- IndicatorBuffers(8);
- SetIndexStyle(0,DRAW_LINE,EMPTY,2,Blue); //第三个参数在宽度大于1时无效.
- SetIndexBuffer(0,新Slope缓冲区);
- SetIndexDrawBegin(0,均线周期);
- //因为 平均振幅[] 并不显示在图上,所以没有把他放进缓冲区内.
- //----
- SetIndexStyle(1,DRAW_ARROW,0,0);
- SetIndexArrow(1,符号代码_上行);
- SetIndexBuffer(1,上行标示缓冲区);
- SetIndexEmptyValue(1,0.0);
- SetIndexStyle(2,DRAW_ARROW,0,0);
- SetIndexArrow(2,符号代码_震荡);
- SetIndexBuffer(2,震荡标示缓冲区);
- SetIndexEmptyValue(2,0.0);
-
- SetIndexStyle(3,DRAW_ARROW,0,0);
- SetIndexArrow(3,符号代码_下行);
- SetIndexBuffer(3,下行标示缓冲区);
- SetIndexEmptyValue(3,0.0);
- return(0);
- }
- }
- }
- return(0);
- }
复制代码
|
|