Индикатор - тиковый график.

 
Рисует тиковый график для пары из основного чарта.

Параметры:
extern int Length    = 300;   // длина графика
extern int BarVolume = 10;    // число тиков в баре


Если задать BarVolume = 1, показывает одиночные тики.
Если задать большее значение, то суммирует тики и рисует аналог для баров постоянного объема.
При этом показывается цена усредненная по всем тикам.

//+------------------------------------------------------------------+
//|                                                        Ticks.mq4 |
//|                                   Copyright © 2005, Yuri Makarov |
//|                                       http://mak.tradersmind.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Yuri Makarov"
#property link      "http://mak.tradersmind.com"

#property indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Green

extern int Length    = 300;
extern int BarVolume = 10;

double tick[];
double CumPrice = 0;
int    CurVol = 0;
int    IStart = 1;

int init()
{
	IndicatorShortName("Ticks");
	SetIndexBuffer(0, tick);
	SetIndexStyle (0, DRAW_LINE);
	IStart = 1;
}

int start()
{
	if (IStart == 1)
	{
      for (int i = 0; i < Bars; i++) tick[i] = EMPTY_VALUE; 
      IStart = 0;
   }

   CurVol++;
   CumPrice += Bid;
   if (CurVol >= BarVolume)
   {
	  for (i = Length; i >= 0; i--) tick[i + 1] = tick[i]; 
	  tick[0]  = CumPrice / CurVol;
	  CurVol   = 0;
	  CumPrice = 0;
	}
}
 
Версия с фильтрацией одинаковых тиков.
Часто на спокойном рынке (ночью особенно) идут котировки с постоянным значением.
Эта версия фильтрует такие котировки и не отображает их на графике.
//+------------------------------------------------------------------+
//|                                                       Ticks2.mq4 |
//|                                   Copyright © 2005, Yuri Makarov |
//|                                       http://mak.tradersmind.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Yuri Makarov"
#property link      "http://mak.tradersmind.com"

#property indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Green

extern int Length    = 300;
extern int BarVolume = 10;
extern int FilterTicks = 1;

double tick[];
double CumPrice = 0;
double LastTick = 0;
int    CurVol = 0;
int    IStart = 1;

int init()
{
	IndicatorShortName("Ticks");
	SetIndexBuffer(0, tick);
	SetIndexStyle (0, DRAW_LINE);
	IStart = 1;
}

int start()
{
	if (IStart == 1)
	{
      for (int i = 0; i < Bars; i++) tick[i] = EMPTY_VALUE; 
      IStart = 0;
   }

   if (Bid == LastTick && FilterTicks) return;
   CurVol++;
   LastTick  = Bid;
   CumPrice += LastTick;
   if (CurVol >= BarVolume)
   {
	  for (i = Length; i >= 0; i--) tick[i + 1] = tick[i]; 
	  tick[0]  = CumPrice / CurVol;
	  CurVol   = 0;
	  CumPrice = 0;
	}
}
 
Третья версия, аналог второй, но более общий случай фильтрации.

Параметр FilterTicks задает порог в разнице соседних тиков для включений в график.
FilterTicks = 0 - включаются все тики.
FilterTicks = 1 - с разницей 1 пп и больше.
FilterTicks = 2 - с разницей 2 пп и больше.
...............

//+------------------------------------------------------------------+
//|                                                       Ticks2.mq4 |
//|                                   Copyright © 2005, Yuri Makarov |
//|                                       http://mak.tradersmind.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Yuri Makarov"
#property link      "http://mak.tradersmind.com"

#property indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Green

extern int Length    = 300;
extern int BarVolume = 10;
extern int FilterTicks = 1;

double tick[];
double CumPrice = 0;
double LastTick = 0;
int    CurVol = 0;
int    IStart = 1;

int init()
{
	IndicatorShortName("Ticks");
	SetIndexBuffer(0, tick);
	SetIndexStyle (0, DRAW_LINE);
	IStart = 1;
}

int start()
{
	if (IStart == 1)
	{
      for (int i = 0; i < Bars; i++) tick[i] = EMPTY_VALUE; 
      IStart = 0;
   }

   if (MathAbs(Bid - LastTick) < FilterTicks * Point) return;
   CurVol++;
   LastTick  = Bid;
   CumPrice += LastTick;
   if (CurVol >= BarVolume)
   {
	  for (i = Length; i >= 0; i--) tick[i + 1] = tick[i]; 
	  tick[0]  = CumPrice / CurVol;
	  CurVol   = 0;
	  CumPrice = 0;
	}
}
 
При наступлении ноаого бара какая-то фигня происходит с этим индикатором :(
У меня сейчас загружена куча индикаторов, в том числе профайлы рынка на всех 12 парах.
Профайл на новом баре делает пересчет, видимо получается некоторая задержка.

В результате:
- на USDCHF (он стоит первым) образовалась дырка в тиковом графике (это не страшно)
- на остальных парах в массиве индикатора оказался 0. График естественно отнормировался и теперь там просто галка.

Это ошибка в моем скрипте, или "фича" МТ?

Текст с попыткой коррекции этой ошибки
//+------------------------------------------------------------------+
//|                                                       Ticks2.mq4 |
//|                                   Copyright © 2005, Yuri Makarov |
//|                                       http://mak.tradersmind.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Yuri Makarov"
#property link      "http://mak.tradersmind.com"

#property indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Green

extern int Length    = 300;
extern int BarVolume = 10;
extern int FilterTicks = 1;

double tick[];
double CumPrice = 0;
double LastTick = 0;
int    CurVol = 0;
int    IStart = 1;

int init()
{
	IndicatorShortName("Ticks");
	SetIndexBuffer(0, tick);
	SetIndexStyle (0, DRAW_LINE, STYLE_SOLID, 2, Gold);
	IStart = 1;
}

int start()
{
	if (IStart == 1)
	{
      for (int i = 0; i < Bars; i++) tick[i] = EMPTY_VALUE; 
      IStart = 0;
   }

   if (MathAbs(Bid - LastTick) < FilterTicks * Point) return;
   
   CurVol++;
   LastTick  = Bid;
   CumPrice += LastTick;
   
   if (CurVol >= BarVolume)
   {
	  for (i = Length; i >= 0; i--) tick[i + 1] = tick[i]; 
	  tick[0]  = CumPrice / CurVol;
	  if (tick[1] == 0) tick[1] = tick[0];  // <-- Correct MT error on New Bar
	  CurVol   = 0;
	  CumPrice = 0;
	}
}