Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Day of the Week Color - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources - MetaTrader 5 Resources

author EAcpu | 3 reads | 0 comments |

Days of the week color - indicator for MetaTrader 5

Days of the week color - indicator for MetaTrader 5

Days of the week color - indicator for MetaTrader 5

Modification of Days of the Week - Each day of the week is now marked with a separate color:

Days of the week color - indicator for MetaTrader 5

Days of the week color - indicator for MetaTrader 5

Days of the week color - indicator for MetaTrader 5

This DRAW_COLOR_HISTOGRAM style requires two buffers (a value buffer histogram buffer and a color buffer histogram color ):

 //+------------------------------------------------------------------+
//| Days of the week color.mq5 |
//| Copyright © 2018, Vladimir Karputov |
//| http://wmua.ru/slesar/ | http://wmua.ru/slesar/ |
//+------------------------------------------------------------------+
#Property Copyright "Copyright © 2018, Vladimir Karputov"
#Property association "http://wmua.ru/slesar/"
# Property version "1.000"
#property -indicator_separate_window
# Property description "Days of the week in color histogram form"

#property -indicator_separate_window 
# Property indicator buffer 2
#Property Indicator Chart 1 
//--- draw a histogram
# propertyindextag1 "The Color of Day" 
# Property indicator type 1 DRAW_COLOR_HISTOGRAM
//--- Define 8 colors for the coloring part
#Property indicator colors 1 cyan , red blood cell , clr chartreuse , clear blue , yellow , clr navy , gold , clr sea green
# PropertyIndicatorStyle1Style_Entity 
# Property indicator width 1 2
//--- indicator buffer
Double HistogramBuffer[]; Double Histogram Color[];
//+------------------------------------------------------------------+
//|Custom indicator initialization function |
//+------------------------------------------------------------------+

The color has been set in the row

//--- Define 8 colors for the coloring part
#Property indicator colors 1 cyan , red blood cell , clr chartreuse , clear blue , yellow , clr navy , gold , clr sea green

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

Management of histogram colors is achieved by assigning individual color indices to each index in the histogram color buffer:


Attachment download

📎 days_of_the_week_color.mq5 (6.87 KB)

Source: MQL5 #20207

Verification code Refresh