Forum on trading, automated trading systems and testing trading strategies
what are the names of these indicator??????????????? please tell me if anyone knows.
Marco vd Heijden, 2019.02.03 12:50
Those are called: Moving Average.Moving average -
Forum on trading, automated trading systems and testing trading strategies
Nikolai Semko , 2019.02.14 08:49
Ultra-fast indicator of hundreds of moving averages, implemented on the Canvas.
100 MA lines (period step 10) - calculation and display time - 4-7 milliseconds
1000 MA lines (period step 1) - calculation and display time - 20-30 milliseconds
#include <Canvas\iCanvas.mqh> //https://www.mql5.com/ru/code/22164 #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ input int MA= 1000 ; // максимальный период скользящих средних input int stepMa= 10 ; // шаг скользящих средних double Close []; uint Col[ 6 ]={ 0xFFFF0000 , 0xFFFF00FF , 0xFF0000FF , 0xFF00FFFF , 0xFF00FF00 , 0xFFFFFF00 }; long Total; int Ma; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int OnInit () { ChartSetInteger ( 0 , CHART_EVENT_MOUSE_MOVE , true ); ChartSetInteger ( 0 , CHART_SCALE , 0 , 0 ); ChartSetInteger ( 0 , CHART_FOREGROUND , true ); CopyClose ( _Symbol , _Period ,( int )W.Right_bar,W.BarsInWind+Ma- 1 , Close ); Total= SeriesInfoInteger ( _Symbol , _Period , SERIES_BARS_COUNT ); if (Total<(MA+W.BarsInWind)) Ma=( int )Total- 1 -W.BarsInWind; else Ma=MA; if (Ma<= 0 ) Ma= 1 ; return ( INIT_SUCCEEDED ); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate ( const int rates_total, const int prev_calculated, const int begin, const double &price[]) { CopyClose ( _Symbol , _Period ,( int )W.Right_bar,W.BarsInWind+Ma- 1 , Close ); Print ( "Время формирования кадра = " +( string )(nMA()/ 1000 )+ " миллискунд" ); return (rates_total); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent ( const int id, const long &lparam, const double &dparam, const string &sparam) { if (id== CHARTEVENT_CHART_CHANGE ) { ChartSetInteger ( 0 , CHART_SCALE , 0 , 0 ); CopyClose ( _Symbol , _Period ,( int )W.Right_bar,W.BarsInWind+Ma- 1 , Close ); Print ( "Время формирования кадра = " +( string )(nMA()/ 1000 )+ " миллискунд" ); } } //+------------------------------------------------------------------+ ulong nMA() { ulong t= GetMicrosecondCount (); int preY= 0 ; Canvas.Erase(); double S= 0 ; for ( int i= 0 ;i<Ma; i++) S+= Close [i]; for ( int Per=Ma;Per> 0 ;) { double s=S; uint Clr=Grad(( double )Per/Ma); for ( int x= 0 ; x<W.BarsInWind;x++) { int Y=( int )(Canvas.Y(s/Per)- 0.5 ); if (x> 0 ) if ( fabs (Y-preY)> 1 ) Canvas.Line(x- 1 ,preY,x,Y,Clr); else Canvas.PixelSet(x,Y,Clr); if ((Ma+x)< ArraySize ( Close )) s=s- Close [x+Ma-Per]+ Close [Ma+x]; else break ; preY=Y; } for ( int j= 0 ; j<stepMa; j++) if (Per> 0 ){ S=S- Close [Ma-Per]; Per--;} else break ; } Canvas.Update(); return GetMicrosecondCount ()-t; } //+------------------------------------------------------------------+ uint Grad( double p) { p=p* 5 ; int n=( int )p; if (n== 5 ) return Col[ 5 ]; double k= 1 -p+( int )p; argb c1,c2; c1.clr=Col[n]; c2.clr=Col[n+ 1 ]; return ARGB( 255 ,c2.c[ 0 ]+ uchar (k*(( int )c1.c[ 0 ]-( int )c2.c[ 0 ])+ 0.5 ), c2.c[ 1 ]+ uchar (k*(( int )c1.c[ 1 ]-( int )c2.c[ 1 ])+ 0.5 ), c2.c[ 2 ]+ uchar (k*(( int )c1.c[ 2 ]-( int )c2.c[ 2 ])+ 0.5 )); } //+------------------------------------------------------------------+
Forum on trading, automated trading systems and testing trading strategies
Sergey Golubev, 2019.02.14 10:53
Thanks.
It is really great!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Friends,
Can please help me to understand which MT4 indicator is in attached pic?
Thanks in Advance for your help.