#property indicator_chart_window #property indicator_buffers 5 #property indicator_color1 Green #property indicator_color2 Green #property indicator_color3 Green #property indicator_color4 Blue #property indicator_color5 Red #property indicator_style1 STYLE_SOLID #property indicator_style2 STYLE_SOLID #property indicator_style3 STYLE_SOLID #property indicator_style4 STYLE_SOLID #property indicator_style5 STYLE_SOLID #property indicator_width1 2 #property indicator_width2 2 #property indicator_width3 2 #property indicator_width4 2 #property indicator_width5 2 double BufUP[]; double BufCenter[]; double BufDOWN[]; double BufUP_Arrow[]; double BufDOWN_Arrow[]; extern int BB_Period = 20; // 初期化関数 int init() { SetIndexBuffer(0, BufUP); SetIndexBuffer(1, BufCenter); SetIndexBuffer(2, BufDOWN); SetIndexBuffer(3, BufUP_Arrow); SetIndexBuffer(4, BufDOWN_Arrow); SetIndexStyle(3,DRAW_ARROW,STYLE_SOLID,2,Blue); SetIndexArrow(3,233); SetIndexStyle(4,DRAW_ARROW,STYLE_SOLID,2,Red); SetIndexArrow(4,234); return(0); } // 指標計算関数 int start() { int counted_bar = IndicatorCounted(); int limit = Bars-counted_bar; if(counted_bar == 0) limit -= BB_Period-1; for (int i = limit-1; i>=0; i--) { BufUP[i] = iBands(NULL,0,BB_Period,3,0,PRICE_CLOSE,1,i); BufCenter[i] = iBands(NULL,0,BB_Period,3,0,PRICE_CLOSE,0,i); BufDOWN[i] = iBands(NULL,0,BB_Period,3,0,PRICE_CLOSE,2,i); } if(counted_bar == 0) limit -= 2; for (i = limit-1; i>=0; i--) { if(BufUP[i]Low[i]){ BufUP_Arrow[i] = EMPTY_VALUE; BufUP_Arrow[i] = Low[i]-30*Point; } } return(0); }