거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
4492
평가:
(13)
게시됨:
2018.04.18 17:19
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

A modification of Days of the week - now every day of the week is marked with a separate color:

The DRAW_COLOR_HISTOGRAM style requires two buffers (a buffer of values HistogramBuffer and a color buffer 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                         |
//+------------------------------------------------------------------+

Colors are set in the line

//--- define 8 colors for coloring sections
#property indicator_color1  clrCyan,clrRed,clrYellowGreen,clrBlue,clrYellow,clrNavy,clrGold,clrMediumSeaGreen

Here, color clrCyan has index "0", clrRed has index "1", and so on.

Management of histogram colors is implemented by assigning an individual color index to each index of the HistogramColors buffer:

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;
        }

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/20207

DayTime DayTime

An arrow indicator, which compares the daily open price with the close price of an hour.

Parabolic_TrailingStop Parabolic_TrailingStop

A utility for applying trailing stop based on the "Parabolic SAR" indicator.

SV v.4.2.5 SV v.4.2.5

The Expert Advisor opens no more than one position per day. Positions are opened at the specified time. It searches for the Highest and Lowest price in an interval. Data of two iMA (Moving Average, MA) indicators are used.

DPO_Bar DPO_Bar

Detrended Price Oscillator Bar - price chart without a trend.