CanadosIndicator





//+------------------------------------------------------------------+
//|                                             CanadosIndicator.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red


extern int N1=10;
extern double N2=0.004;
//---- buffers

double HHV1_N2[];

double LLV1_N2[];



int i;
  
int init()
  {

  IndicatorBuffers(2);
 
//---- drawing settings

  
 
   SetIndexStyle(0,DRAW_LINE,EMPTY,2);
   SetIndexBuffer(0, HHV1_N2);
  
  SetIndexStyle(1,DRAW_LINE,EMPTY,2);
  SetIndexBuffer(1, LLV1_N2);



   return(0);
  }

int start()
  {

int counted_bars=IndicatorCounted();
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;

int i=Bars-counted_bars;

  
      

   while(i>=0)
  
   
     {


  HHV1_N2[i]=High[Highest(NULL,0,MODE_HIGH,N1,i)]-N2;

  LLV1_N2[i]=Low[Lowest(NULL,0,MODE_LOW,N1,i)]+N2;
 
 
      i--;
     
     }
      
   return(0);
  }
 
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar


Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: