Yaanna





//+------------------------------------------------------------------+
//|                                                       Yaanna.mq4 |
//|                             Copyright © 2009, Victor Chebotariov |
//|                                       http://www.chebotariov.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Victor Chebotariov"
#property link      "http://www.chebotariov.com"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Green
//---- input parameters
extern int BBPeriod=200;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("Yaanna ("+BBPeriod+")");
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Yaanna                                                           |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
//----
   i=Bars-counted_bars-1;
   while(i>=0)
     {
      double highbb = iBands(NULL,0,BBPeriod,2,0,PRICE_LOW,MODE_UPPER,i);
      double lowbb = iBands(NULL,0,BBPeriod,2,0,PRICE_LOW,MODE_LOWER,i);
      double close = Close[i];
      double ma = iMA(NULL,0,BBPeriod,0,0,0,i);
      double visota = (highbb-lowbb); // âûñîòà == 100%
      if(visota==0){visota=1;}
      double pclose = (close-lowbb); // öåíà
      double enter = pclose/visota*100;
      ExtMapBuffer1[i]=enter;         
      i--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains close prices for each bar


Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:

Bollinger bands indicator
Moving average indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: