MQL5教程 05 指标开发实战:双色线、双线变色MACD、跨时间周期均线
文章目录一、双色线指标二、双线变色MACD指标三、跨时间周期均线一、双色线指标这里的类型中,Color开头的,是可以选择多个颜色的。#propertyindicator_chart_window#propertyindicator_buffers18#propertyindicator_plots7//--- plot xian#propertyindicator_label1"xian"#propertyindicator_type1 DRAW_COLOR_LINE#propertyindicator_color1 clrRed,clrYellow#propertyindicator_style1 STYLE_SOLID#propertyindicator_width13//--- plot zhu#propertyindicator_label2"zhu"#propertyindicator_type2 DRAW_COLOR_HISTOGRAM#propertyindicator_color2 clrRed,clrYellow#propertyindicator_style2 STYLE_SOLID#propertyindicator_width21//--- plot zhu2#propertyindicator_label3"zhu2"#propertyindicator_type3 DRAW_COLOR_HISTOGRAM2#propertyindicator_color3 clrRed,clrYellow#propertyindicator_style3 STYLE_SOLID#propertyindicator_width31//--- plot up#propertyindicator_label4"up"#propertyindicator_type4 DRAW_COLOR_ARROW#propertyindicator_color4 clrFuchsia,clrRed#propertyindicator_style4 STYLE_SOLID#propertyindicator_width43//--- plot down#propertyindicator_label5"down"#propertyindicator_type5 DRAW_COLOR_ARROW#propertyindicator_color5 clrPowderBlue,clrWhite#propertyindicator_style5 STYLE_SOLID#propertyindicator_width53//--- plot lazhu#propertyindicator_label6"lazhu"#propertyindicator_type6 DRAW_COLOR_CANDLES#propertyindicator_color6 clrAqua,clrBlue#propertyindicator_style6 STYLE_SOLID#propertyindicator_width61//--- plot xian2#propertyindicator_label7"xian2"#propertyindicator_type7 DRAW_COLOR_LINE#propertyindicator_color7 clrRed,clrYellow#propertyindicator_style7 STYLE_SOLID#propertyindicator_width73//--- indicator buffersdoublexianBuffer[];doublexianColors[];doublezhuBuffer[];doublezhuColors[];doublezhu2Buffer1[];doublezhu2Buffer2[];doublezhu2Colors[];doubleupBuffer[];doubleupColors[];doubledownBuffer[];doubledownColors[];doublelazhuBuffer1[];doublelazhuBuffer2[];doublelazhuBuffer3[];doublelazhuBuffer4[];doublelazhuColors[];doublexian2Buffer[];doublexian2Colors[];//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+// 指标句柄intma5_h;intma10_h;intOnInit(){//--- indicator buffers mappingSetIndexBuffer(0,xianBuffer,INDICATOR_DATA);SetIndexBuffer(1,xianColors,INDICATOR_COLOR_INDEX);SetIndexBuffer(2,zhuBuffer,INDICATOR_DATA);SetIndexBuffer(3,zhuColors,INDICATOR_COLOR_INDEX);SetIndexBuffer(4,zhu2Buffer1,INDICATOR_DATA);SetIndexBuffer(5,zhu2Buffer2,INDICATOR_DATA);SetIndexBuffer(6,zhu2Colors,INDICATOR_COLOR_INDEX);SetIndexBuffer(7,upBuffer,INDICATOR_DATA);SetIndexBuffer(8,upColors,INDICATOR_COLOR_INDEX);SetIndexBuffer(9,downBuffer,INDICATOR_DATA);SetIndexBuffer(10