//+------------------------------------------------------------------+ //| Dinamic(AM)4.mq4 | //| | //+------------------------------------------------------------------+ #property copyright "Andrey Matvievskiy" #property link "" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Green #property indicator_color2 Red #property indicator_maximum 1 #property indicator_minimum -1 extern int AO_PeriodMA1 = 34; extern int AO_PeriodMA2 = 5; extern int AO_TypeMA1 = 0; extern int AO_TypeMA2 = 0; extern int AO_PriceMA1 = 4; extern int AO_PriceMA2 = 4; extern int AO_TF1 = 0; extern int AO_TF2 = 0; extern int AO_Shift1 = 0; extern int AO_Shift2 = 0; extern int AC_PeriodMA1 = 34; extern int AC_PeriodMA2 = 5; extern int AC_PeriodMA3 = 5; extern int AC_TypeMA1 = 0; extern int AC_TypeMA2 = 0; extern int AC_TypeMA3 = 0; extern int AC_PriceMA1 = 4; extern int AC_PriceMA2 = 4; extern int AO_AC_TF1 = 0; extern int AO_AC_TF2 = 0; extern int AO_AC_Shift1 = 0; extern int AO_AC_Shift2 = 0; extern int AO_AC_Shift3 = 0; double ExtMapBuffer2[]; double ExtMapBuffer3[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM,0,4); SetIndexBuffer(0,ExtMapBuffer2); SetIndexStyle(1,DRAW_HISTOGRAM,0,2); SetIndexBuffer(1,ExtMapBuffer3); SetIndexLabel(0,"D1"); SetIndexLabel(1,"D2"); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { //---- int counted_bars=IndicatorCounted(); //---- if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; for(int i=0;i