Change the color of the candles Indicator For MT5
Table Of Contents:
- Change the color of the candles Indicator For MT5
- Installing the Change the color of the candles Indicator For MT5
- Parameters of the Change the color of the candles Indicator For MT5
- Buffers of the Change the color of the candles Indicator For MT5
- Main Parts Of The Code
The Change the color of the candles Indicator For MT5 this is a brilliant productive and technical trading tool which is designed to simply enhance the trading experience for traders to help them realize an easier method to analyze the market. This particular indicator is a colorized indicator which gives the trader the liberty to modify the colors of their candlesticks during certain periods of the day - it is an elegant technical trading tool in many respects though it was not designed to provide traders with signals however it was simply designed to improve the trading experience for traders. Therefore one possible brilliant application that a trader can go about using this indicator is by allocating a certain color scheme for each trading session so for the Asian session the trader would have a specific color scheme, for the London session the trader will have another color scheme and for the New York or United States session there will be another color scheme - therefore this simple tactic will just help traders to easily differentiate between the different trading sessions.
Installing the Change the color of the candles Indicator For MT5
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file candles_color.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.
Parameters of the Change the color of the candles Indicator For MT5
The Change the color of the candles Indicator For MT5 has 10 parameters to configure.
input int Start_Day=4; // Starting Day for show input int Start_Hour=6; // Starting Hour of day input int Start_Minute=0; // Starting Minute of hour input int End_Day=4; // End of Day input int End_Hour=20; // End Hour of day input int End_Minute=59; // End Hour of day input color Color_Bar_Up_1=clrPowderBlue; input color Color_Bar_Down_1=clrBisque; input color Color_Bar_Up_0=clrGreen; input color Color_Bar_Down_0=clrRed;
Buffers of the Change the color of the candles Indicator For MT5
The Change the color of the candles Indicator For MT5 provides 5 buffers.
SetIndexBuffer(0,buf_open,INDICATOR_DATA); SetIndexBuffer(1,buf_high,INDICATOR_DATA); SetIndexBuffer(2,buf_low,INDICATOR_DATA); SetIndexBuffer(3,buf_close,INDICATOR_DATA); SetIndexBuffer(4,buf_color_line,INDICATOR_COLOR_INDEX);
Main Parts Of The Code
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { MqlDateTime time_now; // define time struc //In the loop we fill the data buffers and color indexes buffers for each bar for(int i=prev_calculated;i lt =rates_total-1;i++) { //Set data for plotting buf_open[i]=open[i]; buf_high[i]=high[i]; buf_low[i]=low[i]; buf_close[i]=close[i]; datetime candle_time=time[i]; TimeToStruct(time[i],time_now); // change time to struct if((time_now.day_of_week gt =Start_Day && time_now.hour gt =Start_Hour && time_now.min gt =Start_Minute) && (time_now.day_of_week lt =End_Day && time_now.hour lt =End_Hour && time_now.min lt =End_Minute)) { // if time between start day and end of day if(open[i] gt =close[i]) //if open gt = close set color index 3 buf_color_line[i]=3;//Assign the bar with color index, equal to 3 else buf_color_line[i]=2;//Assign the bar with color index, equal to 2 } // if time isn t between start day and end of day else { if(open[i] gt =close[i]) //if open gt = close set color index 1 buf_color_line[i]=1;//Assign the bar with color index, equal to 1 else buf_color_line[i]=0;//Assign the bar with color index, equal to 0 } } return(rates_total-1); } //+------------------------------------------------------------------+