#property indicator_type1 DRAW_COLOR_ARROW
//--- зададим 8 цветов для раскраски гистограммы по дням недели (они хранятся в специальном массиве)
#property indicator_color1 clrRed,clrBlue,clrSeaGreen,clrGold,clrDarkOrange,clrMagenta,clrYellowGreen,clrChocolate
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
//--- input параметры
input int N=5; // кол-во тиков для изменения
input ushort code=159; // код символа для отрисовки в DRAW_ARROW
int color_sections;
//--- индикаторный буфер для построения
double ColorArrowBuffer[];
//--- буфер для хранения индексов цвета
double ColorArrowColors[];
//--- массив для хранения цветов содержит 14 элементов
color colors[]=
{
clrRed,clrBlue,clrGreen,clrChocolate,clrMagenta,clrDodgerBlue,clrGoldenrod,
clrIndigo,clrLightBlue,clrAliceBlue,clrMoccasin,clrWhiteSmoke,clrCyan,clrMediumPurple
};
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,ColorArrowBuffer,INDICATOR_DATA);
SetIndexBuffer(1,ColorArrowColors,INDICATOR_COLOR_INDEX);
//--- зададим код символа для отрисовки в PLOT_ARROW
PlotIndexSetInteger(0,PLOT_ARROW,code);
//--- зададим cмещение стрелок по вертикали в пикселях
PlotIndexSetInteger(0,PLOT_ARROW_SHIFT,5);
//--- установим в качестве пустого значения 0
PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0);
//---- количество цветов для раскраски синусоиды
color_sections=8; // см. комментарий к свойству #property indicator_color1
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],