Yuraz MCCH Calculation Indicator
Info
The Yuraz MCCH Calculation Indicator is a Indicator for MetaTrader 5 that the indicator calculates the percentage of growth or drop towards close. It is written using object-oriented programming and can be easily integrated into any expert advisor or other indicator.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Yuraz MCCH Calculation Indicator
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
The indicator calculates the percentage of growth or drop towards close.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: i-sadukey Digital Trend Filter - another powerful indicator for MetaTrader 5 traders.
The indicator calculates the percentage of growth or drop towards close. It is written using object-oriented programming and can be easily integrated into any expert advisor or other indicator.Also recommended: J2 JMACandle - similar indicator with strong performance on MetaTrader 5.
The indicator calculates ch%, the percentage of change of the previous day's close.
It creates objects on a chart and is written in an object-oriented programming style.
Integration into other indicators or expert advisors is straightforward. You can estimate the code size when integrated into another indicator or expert advisor.
There are two lines:
cchmcyz chmc;
chmc.rchsay("eurusd",timecurrent()-86400*5,timecurrent(),5,16); // Calculate the current day's ch%
Object-oriented programming offers massive opportunities. Necessary classes are written, and then you construct...
//+------------------------------------------------------------------+
//| yuraz_mcch.mq5 |
//| copyright 2026, MetaQuotes Software Corp. |
//| |
//+------------------------------------------------------------------+
struct symbolstruct
{
bool work;
string ssymbol;
int y;
int x;
double ch;
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
class cchmcyz
{
public:
symbolstruct ssymb;
color lcolorsym;
color lcolorchplus;
color lcolorchminus;
color lcolorch;
int indicatorwindow; // Work in the main window
void cchmcyz()
{
indicatorwindow=0;
lcolorsym=darkblue; // darkturquoise
lcolorch=darkgreen; // white;
lcolorchplus = green; // limegreen;
lcolorchminus = firebrick; // red;
} // Constructor
void rch(string ssym,datetime db,datetime de); // Full calculation of one pair only without display
void rchsay(string ssym,datetime db,datetime de,int x,int y); // Full calculation of one pair and its display
private:
color lcolor;
double dclose[7000]; // Array for copying maximal prices
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void cchmcyz::rch(string ssymbol,datetime datebeg,datetime dateend)
{
ssymb.ch = 0;
int countbar;
datebeg = stringtotime( timetostring(datebeg,time_date));
dateend = stringtotime( timetostring(dateend,time_date));
countbar= copyclose(ssymbol,period_d1,dateend,2,dclose);
if(countbar>=0)
{
if(normalizedouble(dclose[1],5)!=0.0 && normalizedouble(dclose[0],5)!=0.0)
{
ssymb.ch=(dclose[1]*100)/dclose[0]-100;
}
}
}
//+------------------------------------------------------------------+
//| Calculation with output
//+------------------------------------------------------------------+
void cchmcyz::rchsay(string ssym,datetime db,datetime de,int xd,int yd) // Full calculation of one pair only
{
rch(ssym,db,de);
if(objectfind(indicatorwindow,"oyz"+ssym)==-1)
{
objectcreate(indicatorwindow,"oyz"+ssym,obj_label,indicatorwindow,0,0);
objectsetinteger(indicatorwindow,"oyz"+ssym,objprop_xdistance,xd);
objectsetinteger(indicatorwindow,"oyz"+ssym,objprop_ydistance,yd);
objectsetinteger(indicatorwindow,"oyz"+ssym,objprop_corner,corner_left_upper);
objectsetstring(indicatorwindow,"oyz"+ssym,objprop_text,ssym);
objectsetstring(indicatorwindow,"oyz"+ssym,objprop_font,"arial");
objectsetinteger(indicatorwindow,"oyz"+ssym,objprop_fontsize,7);
objectsetinteger(indicatorwindow,"oyz"+ssym,objprop_color,lcolorsym);
objectsetinteger(indicatorwindow,"oyz"+ssym,objprop_selectable,true);
}
if(objectfind(indicatorwindow,"oyz_"+ssym)==-1)
{
objectcreate(indicatorwindow,"oyz_"+ssym,obj_label,indicatorwindow,0,0);
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_xdistance,xd+45);
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_ydistance,yd);
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_corner,corner_left_upper);
objectsetstring(indicatorwindow,"oyz_"+ssym,objprop_text,ssym);
objectsetstring(indicatorwindow,"oyz_"+ssym,objprop_font,"arial");
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_fontsize,7);
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_color,lcolorch);
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_selectable,true);
}
yd=yd+11;
lcolor=lcolorch;
if(ssymb.ch>0)
{
lcolor=lcolorchplus;
objectsetstring(indicatorwindow,"oyz_"+ssym,objprop_text," "+doubletostring(ssymb.ch,5));
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_xdistance,xd+45);
}
if(ssymb.ch<0)
{
lcolor=lcolorchminus;
objectsetstring(indicatorwindow,"oyz_"+ssym,objprop_text,doubletostring(ssymb.ch,5));
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_xdistance,xd+46);
}
objectsetinteger(indicatorwindow,"oyz_"+ssym,objprop_color,lcolor);
}
//
// End of class
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Code where the class is used in
//
cchmcyz chmc;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int oninit()
{
//--- Indicator buffers mapping
chmc.rchsay("eurusd",timecurrent()-86400*5,timecurrent(),5,16); // Calculate current day of ch%
chmc.rchsay("audusd",timecurrent()-86400*5,timecurrent(),5,16+12 );
chmc.rchsay("gbpusd",timecurrent()-86400*5,timecurrent(),5,16+12*2 );
chmc.rchsay("usdchf",timecurrent()-86400*5,timecurrent(),5,16+12*3 );
chmc.rchsay("usdcad",timecurrent()-86400*5,timecurrent(),5,16+12*4 );
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
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[])
{
chmc.rchsay("eurusd",timecurrent()-86400*5,timecurrent(),5,16); // Calculate current day of ch%
chmc.rchsay("audusd",timecurrent()-86400*5,timecurrent(),5,16+12 );
chmc.rchsay("gbpusd",timecurrent()-86400*5,timecurrent(),5,16+12*2 );
chmc.rchsay("usdchf",timecurrent()-86400*5,timecurrent(),5,16+12*3 );
chmc.rchsay("usdcad",timecurrent()-86400*5,timecurrent(),5,16+12*4 );
return(rates_total);
}
void ondeinit()
{
int i=objectstotal(0); // Remove our objects
while( i > 0 )
{
if(stringsubstr(objectname(0,i ),0,3)=="oyz")
{
objectdelete(0,objectname(0,i ));
}
i--;
}
}
You may also like: Safe Zone Indicator - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "robotfx"
#property link "https://robotfx.org"
#property version "1.00"
#property indicator_chart_window
struct symbolstruct
{
bool work;
string ssymbol;
int y;
int x;
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.