Смотри, как бесплатно скачать роботов
Ищи нас в Telegram!
Ставь лайки и следи за новостями
Ставь лайки и следи за новостями
Интересный скрипт?
Поставь на него ссылку - пусть другие тоже оценят
Поставь на него ссылку - пусть другие тоже оценят
Понравился скрипт?
Оцени его работу в терминале MetaTrader 5
Оцени его работу в терминале MetaTrader 5
Days of the week color - индикатор для MetaTrader 5
- Просмотров:
- 1674
- Рейтинг:
- Опубликован:
- 2018.03.14 11:36
- Нужен робот или индикатор на основе этого кода? Закажите его на бирже фрилансеров Перейти на биржу
Модификация кода Days of the week - теперь каждый день недели отображается своим цветом:
Для стиля DRAW_COLOR_HISTOGRAM требуется два буфера (буфер значений HistogramBuffer и буфер цвета HistogramColors):
//+------------------------------------------------------------------+ //| Days of the week color.mq5 | //| Copyright © 2018, Vladimir Karputov | //| http://wmua.ru/slesar/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2018, Vladimir Karputov" #property link "http://wmua.ru/slesar/" #property version "1.000" #property indicator_separate_window #property description "Days of the week in the form of a color histogram" #property indicator_separate_window #property indicator_buffers 2 #property indicator_plots 1 //--- plot Histogram #property indicator_label1 "Day colors" #property indicator_type1 DRAW_COLOR_HISTOGRAM //--- define 8 colors for coloring sections #property indicator_color1 clrCyan,clrRed,clrYellowGreen,clrBlue,clrYellow,clrNavy,clrGold,clrMediumSeaGreen #property indicator_style1 STYLE_SOLID #property indicator_width1 2 //--- indicator buffers double HistogramBuffer[]; double HistogramColors[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+
Цвета задаются в строке
//--- define 8 colors for coloring sections #property indicator_color1 clrCyan,clrRed,clrYellowGreen,clrBlue,clrYellow,clrNavy,clrGold,clrMediumSeaGreen
причем цвет clrCyan имеет индекс "0", clrRed имеет индекс "1", и так далее.
Управление цветом гистограммы реализуется присвоением каждому индексу буфера HistogramColors своего индекса цвета:
switch(STime.day_of_week) { case 0: HistogramBuffer[i]=0; HistogramColors[i]=0; break; case 1: HistogramBuffer[i]=1; HistogramColors[i]=1; break; case 2: HistogramBuffer[i]=2; HistogramColors[i]=2; break; case 3: HistogramBuffer[i]=3; HistogramColors[i]=3; break; case 4: HistogramBuffer[i]=4; HistogramColors[i]=4; break; case 5: HistogramBuffer[i]=5; HistogramColors[i]=5; break; case 6: HistogramBuffer[i]=6; HistogramColors[i]=6; break; }
Trend RDS
Распознание тренда на основе трех последних баров.
Cross_Line_TraderСоветник для открытия позиций по пересечению ценой объектов-линий.