Chart_Patterns_NTF

Author: megabaks
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites
Chart_Patterns_NTF
//+------------------------------------------------------------------+ 
//|                                           Chart_Patterns_NTF.mq4 | 
//+------------------------------------------------------------------+ 
#property copyright "megabaks"
#property link      "megabaks@jabber.ru"
//----
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters 
extern int   maxExtDepth      =12;
extern int   minExtDepth      =11;
extern int   ExtDeviation     =5;
extern int   ExtBackstep      =3;

bool  show_zig_zag     =false;
extern bool  show_targets     =true;

extern int   max_percent_diff =50;
extern int   max_wave_diff    =3;

extern color triangle         =DimGray;
extern color head_shoulders   =DimGray;
extern color double_triple    =DimGray;
extern int GrossPeriod        =30;
//---- buffers 
double ExtMapBuffer1[];
datetime daytimes[];
//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
int init()
  {
//---- indicators 
   if ( show_zig_zag ) SetIndexStyle(0,DRAW_SECTION);
   else                SetIndexStyle(0,DRAW_NONE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexEmptyValue(0,0.0);
//---- 
   if ( Period()>GrossPeriod ) { Alert("Chart_Patterns_NTF: Current TF > target TF ", GrossPeriod); return(0); }
   ArrayCopySeries(daytimes,MODE_TIME,Symbol(),GrossPeriod);
   return(0);
  }
//+------------------------------------------------------------------+ 
//| Custor indicator deinitialization function                       | 
//+------------------------------------------------------------------+ 
int deinit()
  {
//---- 
//---- 
   return(0);
  }
//+------------------------------------------------------------------+ 
//| Custom indicator iteration function                              | 
//+------------------------------------------------------------------+ 
int start()
  {
if ( Period()<GrossPeriod )
      {
      iCustom(NULL,GrossPeriod,"Chart_Patterns",maxExtDepth,minExtDepth,ExtDeviation,ExtBackstep,show_zig_zag,show_targets,max_percent_diff,max_wave_diff,triangle,head_shoulders,double_triple,0,0);
      }
   else
      {
      Alert("Chart_Patterns_NTF: Current TF ",Period()," >= ","target TF ",GrossPeriod); return(0);
      }
   return(0);
  }
//+------------------------------------------------------------------+

Comments