//+------------------------------------------------------------------+ //| Objective.mq4 | //| Copyright © 2011, LeMan. | //| b-market@mail.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2011, LeMan." #property link "b-market@mail.ru" #property indicator_chart_window #property indicator_buffers 8 #property indicator_color1 Red #property indicator_color2 Red #property indicator_color3 Red #property indicator_color4 Red #property indicator_color5 Green #property indicator_color6 Green #property indicator_color7 Green #property indicator_color8 Green #property indicator_style1 2 #property indicator_style2 2 #property indicator_style3 2 #property indicator_style4 2 #property indicator_style5 2 #property indicator_style6 2 #property indicator_style7 2 #property indicator_style8 2 //---- extern int Sample = 20; extern double Quartile_1 = 25.0; extern double Quartile_2 = 50.0; extern double Quartile_3 = 75.0; //---- double q1Buffer[]; double q2Buffer[]; double q3Buffer[]; double q4Buffer[]; double q5Buffer[]; double q6Buffer[]; double q7Buffer[]; double q8Buffer[]; //+------------------------------------------------------------------+ int init() { //---- IndicatorBuffers(8); IndicatorDigits(Digits); //---- indicators SetIndexBuffer(0, q1Buffer); SetIndexBuffer(1, q2Buffer); SetIndexBuffer(2, q3Buffer); SetIndexBuffer(3, q4Buffer); SetIndexBuffer(4, q5Buffer); SetIndexBuffer(5, q6Buffer); SetIndexBuffer(6, q7Buffer); SetIndexBuffer(7, q8Buffer); //--- SetIndexStyle(0, DRAW_LINE); SetIndexStyle(1, DRAW_LINE); SetIndexStyle(2, DRAW_LINE); SetIndexStyle(3, DRAW_LINE); SetIndexStyle(4, DRAW_LINE); SetIndexStyle(5, DRAW_LINE); SetIndexStyle(6, DRAW_LINE); SetIndexStyle(7, DRAW_LINE); //---- if (Sample <= 0) Sample = 20; //---- return(0); } //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ int start() { //---- double HOArray[], OLArray[]; ArrayResize(HOArray, Sample); ArrayResize(OLArray, Sample); //---- int i,j; int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); if(counted_bars > 0) counted_bars--; int limit = Bars - counted_bars; if(counted_bars==0) limit-=1+Sample+1; //---- for (i=0; i