一个例子 IndicatorSetInteger() function. A simple indicator that shows how to create a label, e.g. "超买水平"对于每个水平级别。
使用 #property编译器指令 对于在单独窗口中绘制的指标,您可以指定水平级别的颜色,样式和宽度,例如:
//--- Set showing of three horizontal levels in a separate indicator window <s1p>#property indicator_level1 20 #property indicator_level2 50 #property indicator_level3 80 //--- Set the width of horizontal levels #property indicator_levelwidth 5 //--- Set the color of horizontal levels #property indicator_levelcolor clrAliceBlue //--- Set the style of horizontal levels
除此之外 IndicatorSetInteger() 功能可以动态设置每个级别的样式
//--- Set the color of the level IndicatorSetInteger(INDICATOR_LEVELCOLOR,level,level_color); IndicatorSetInteger(INDICATOR_LEVELSTYLE,level,level_style);
可以通过设置水平线的样式 ENUM_LINE_STYLE 枚举:
识别码 |
描述 |
STYLE_SOLID |
实线 |
STYLE_DASH |
虚线 |
STYLE_DOT |
虚线 |
STYLE_DASHDOT |
点划线 |
STYLE_DASHDOTDOT |
破折号-两个点 |
注意
使用#property指令时,属性(修饰符)的编号从1(一)开始,而函数使用0(零)的编号。万一级别号设置不正确,结果指示符可能与预期的不同。
例如,为了设置第一条水平线的宽度,请使用第零个索引:
//--- index 0 is used to set width of the first level IndicatorSetInteger(INDICATOR_LEVELWIDTH, 0, 5);
图片:
MetaQuotes Software Corp.从俄语翻译而来。
来源文章: //www.tbxfkj.com/ru/code/1761
面板以不同的方式开仓和平仓í单击财务符号。
一个c的例子ómo utilizar la función IndicatorSetString()。一个简单的指示器,显示如何创建标签,例如。"Nivel de sobrecompra" para cada nivel.