//+------------------------------------------------------------------+ //| Web: Q(VolumeNorm).mq4 | //| MNS777 | //| mns777.ru@mail.ru | //+------------------------------------------------------------------+ #property copyright "MNS777" #property link "Web:" //---- отрисовка индикатора в отдельном окне #property indicator_separate_window //---- количество индикаторных буфферов #property indicator_buffers 4 //---- цвета индикатора #property indicator_color1 Black #property indicator_color2 Lime #property indicator_color3 Red #property indicator_color4 Blue //---- толщина индикаторных линий #property indicator_width1 1 #property indicator_width2 2 #property indicator_width3 2 #property indicator_width4 2 //---- ВХОДНЫЕ ПАРАМЕТРЫ ИНДИКАТОРА ююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююжж+ extern int PeriodMA = 24; extern int ShiftMA = 0; extern int ModeMA = 0; extern double K = 1000; extern int MaxBars = 1000 ; // баров истории extern string autor="Mns777.ru@mail.ru"; //---- жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж+ //---- индикаторные буфферы double ExtBuffer0[]; double ExtBuffer1[]; double ExtBuffer2[]; double SignalBuffer[]; //+------------------------------------------------------------------+ //| indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- стили изображения индикатора SetIndexStyle(0,DRAW_NONE); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexStyle(3,DRAW_LINE); //---- точность IndicatorDigits(Digits+1); SetIndexDrawBegin(0,Digits); SetIndexDrawBegin(1,Digits); SetIndexDrawBegin(2,Digits); SetIndexDrawBegin(3,Digits); //---- 3 индикаторных буффера использованы для счёта. SetIndexBuffer(0,ExtBuffer0); SetIndexBuffer(1,ExtBuffer1); SetIndexBuffer(2,ExtBuffer2); SetIndexBuffer(3,SignalBuffer); //---- имена для окон данных и лэйбы для субъокон. IndicatorShortName("Q(VolumeNorm)"); SetIndexLabel(1,NULL); SetIndexLabel(2,NULL); SetIndexLabel(3,"MA"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); double prev,current; //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=MaxBars; //---- macd for(int i=0; i<limit; i++) ExtBuffer0[i]= ((High[i] - Open[i])*K)/ Volume[i]; //---- signal line counted in the 2-nd buffer for(i=0; i<limit; i++) SignalBuffer[i]=iMAOnArray(ExtBuffer0,Bars,PeriodMA,ShiftMA,ModeMA,i); //---- dispatch values between 2 buffers bool up=true; for(i=limit-1; i>=0; i--) { current=ExtBuffer0[i]; if(current>0) up=true; if(current<0) up=false; if(!up) { ExtBuffer2[i]=current; ExtBuffer1[i]=0.0; } else { ExtBuffer1[i]=current; ExtBuffer2[i]=0.0; } } //---- done return(0); } //+------------------------------------------------------------------+prusax писал (а):
Добрый день!
Большое спасибо Вам!
Хочу спросить, если Вам это не составило больших усилий, то не смогли бы из 2-х индикаторов ссделать один. Я пытался их выложить в развёрнутом виде, но программа пишет, что слишком большой текст. Попробую их вложить в свёрнутом виде. Смысл заключается в следующем: они фиксиуют тиковый объём при движении вверх(один индикатор) и движение вниз(второй индикатор). Если можно выполнить вот в каком варианте: к примеру, если вверх показывает 3, а вниз 5, то общее минус 2 (-2) , т.е. сразу показывать разницу, и наоборот.
//+------------------------------------------------------------------+ //| Web: Q(VolumeNorm).mq4 | //| MNS777 | //| mns777.ru@mail.ru | //+------------------------------------------------------------------+ #property copyright "MNS777" #property link "Web:" //---- отрисовка индикатора в отдельном окне #property indicator_separate_window //---- количество индикаторных буфферов #property indicator_buffers 4 //---- цвета индикатора #property indicator_color1 Black #property indicator_color2 Lime #property indicator_color3 Red #property indicator_color4 Blue //---- толщина индикаторных линий #property indicator_width1 1 #property indicator_width2 2 #property indicator_width3 2 #property indicator_width4 2 //---- ВХОДНЫЕ ПАРАМЕТРЫ ИНДИКАТОРА ююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююююжж+ extern int PeriodMA = 24; extern int ShiftMA = 0; extern int ModeMA = 0; extern double K = 1000; extern int MaxBars = 1000 ; // баров истории extern string autor="Mns777.ru@mail.ru"; //---- жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж+ //---- индикаторные буфферы double ExtBuffer0[]; double ExtBuffer1[]; double ExtBuffer2[]; double SignalBuffer[]; //+------------------------------------------------------------------+ //| indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- стили изображения индикатора SetIndexStyle(0,DRAW_NONE); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexStyle(3,DRAW_LINE); //---- точность IndicatorDigits(Digits+1); SetIndexDrawBegin(0,Digits); SetIndexDrawBegin(1,Digits); SetIndexDrawBegin(2,Digits); SetIndexDrawBegin(3,Digits); //---- 3 индикаторных буффера использованы для счёта. SetIndexBuffer(0,ExtBuffer0); SetIndexBuffer(1,ExtBuffer1); SetIndexBuffer(2,ExtBuffer2); SetIndexBuffer(3,SignalBuffer); //---- имена для окон данных и лэйбы для субъокон. IndicatorShortName("Q(VolumeNorm)"); SetIndexLabel(1,NULL); SetIndexLabel(2,NULL); SetIndexLabel(3,"MA"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); double prev,current; //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=MaxBars; //---- macd for(int i=0; i<limit; i++) ExtBuffer0[i]= ((Low[i] - Open[i])*K)/ Volume[i]; //---- signal line counted in the 2-nd buffer for(i=0; i<limit; i++) SignalBuffer[i]=iMAOnArray(ExtBuffer0,Bars,PeriodMA,ShiftMA,ModeMA,i); //---- dispatch values between 2 buffers bool up=true; for(i=limit-1; i>=0; i--) { current=ExtBuffer0[i]; if(current>0) up=true; if(current<0) up=false; if(!up) { ExtBuffer2[i]=current; ExtBuffer1[i]=0.0; } else { ExtBuffer1[i]=current; ExtBuffer2[i]=0.0; } } //---- done return(0); } //+------------------------------------------------------------------+
Извини сейчас в гости уходим а завтро меня не будет обратись
к сообществу да и програмист я ещё тот .
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
Добрый день!
Большое спасибо Вам!
Хочу спросить, если Вам это не составило больших усилий, то не смогли бы из 2-х индикаторов ссделать один. Я пытался их выложить в развёрнутом виде, но программа пишет, что слишком большой текст. Попробую их вложить в свёрнутом виде. Смысл заключается в следующем: они фиксиуют тиковый объём при движении вверх(один индикатор) и движение вниз(второй индикатор). Если можно выполнить вот в каком варианте: к примеру, если вверх показывает 3, а вниз 5, то общее минус 2 (-2) , т.е. сразу показывать разницу, и наоборот.