//+------------------------------------------------------------------+ //| iMoningStar.mq4 | //| * | //| * | //+------------------------------------------------------------------+ #property copyright "http://dmffx.com" #property link "http://dmffx.com" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 DeepSkyBlue #property indicator_color2 Red #property indicator_width1 1 #property indicator_width2 1 extern int PreBarMaxSize = 10; // Мaксимальный размер предшествующего бара в пунктах extern int PreBarMinSize = 0; // Минимальный размер предшествующего бара в пунктах extern double StarSize = 0.2; // Размер тела звезды (по отношению к телу предшествующего бара) extern double GapSize = 0.05; // Размера гэпа (по отношению к телу предшествующего бара) double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,172); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,172); SetIndexBuffer(1,ExtMapBuffer2); SetIndexEmptyValue(1,0.0); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { 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-=2; for(int i=limit-1;i>=0;i--) { ExtMapBuffer1[i]=0; ExtMapBuffer2[i]=0; if(MathAbs(Close[i+1]-Open[i+1])<=Point*PreBarMaxSize) { if(MathAbs(Close[i+1]-Open[i+1])>=Point*PreBarMinSize) { if(MathAbs(Close[i]-Open[i])MathMax(Close[i+1],Open[i+1])+GapSize*MathAbs(Close[i+1]-Open[i+1])) { ExtMapBuffer2[i]=High[i]+Point*5; } } } } } return(0); } //+-----------------------------------------------------------------+