GraphOnGrap





//+------------------------------------------------------------------+
//|                                                  GraphOnGrap.mq4 |
//|                          Gryb Alexander alexandergrib@rambler.ru |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Gryb Alexander alexandergrib@rambler.ru"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 1
extern string comment1 = "Âàëþòíàÿ ïàðà";
extern string symbol = "EURUSD";
extern string comment2 = "Òàéìôðåéì. 0 - òô òåêóùåãî ãðàôèêà";
extern int timeFrame = 0;
extern string comment3 = "Öåíà, ïî êîòîðîé ñòðîåòñÿ ãðàôèê ïàðû(Open, Close, Medium)";
extern string price = "Open";
extern color indicatorColor=Red;
double cot1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
    SetIndexBuffer(0,cot1);
    SetIndexStyle(0,DRAW_LINE,NULL,NULL,indicatorColor);
    IndicatorShortName("Ãðàôèê "+symbol);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
    for(int k = 0;k<1000;k++)
    {
     if(price == "Open") cot1[k]=iOpen(symbol,0,k);
     if(price == "Close") cot1[k]=iClose(symbol,0,k);
     if(price == "Medium") cot1[k]=((iOpen(symbol,0,k)+iClose(symbol,0,k))/2);
    }
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains open prices of each bar
Series array that contains close prices for each bar


Indicator Curves created:


Implements a curve of type DRAW_LINE

Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: