yuraz mcch calculation indicator

yuraz mcch calculation indicator
Download ALL MT5 indicators (5676)
YouTube Video Thumbnail



Similar MetaTrader Tools

yuraz mcch calculation indicator

Info

The yuraz mcch calculation indicator is a Indicator for MetaTrader 5 that the indicator calculates % of growth or drop towards close. it is written via use of 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 % 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: alligator code for beginners by william210 - another powerful indicator for MetaTrader 5 traders.



the indicator calculates % of growth or drop towards close. it is written via use of object-oriented programming and can be easily integrated into any expert advisor or other indicator.

Also recommended: jm a candle trend signal - similar indicator with strong performance on MetaTrader 5.


the indicator calculates ch%, percentage of change of close of a previous day.

creates objects on a chart. the indicator is written in object-oriented programming style.

it is easily integrated into any expert advisor or other indicator. it suffices to describe a class and effectuate its activation

you can estimate code size integrated into another indicator or expert advisor.

there are 2 lines:

cchmcyz chmc
;

chmc.rchsay(
"eurusd"
,
timecurrent
()-
86400
*
5
,
timecurrent
(),
5
,
16
);
// let's calculate the current day ch%

object-oriented programming offer massive opportunities, necessary classes are written, and then you construct ...

//+------------------------------------------------------------------+

//|                                                   yuraz_mcch.mq5 |

//|                        copyright 2009, metaquotes software corp. |

//|                                               |

//+------------------------------------------------------------------+

#property

copyright

"2009, metaquotes software corp."

#property

link
      
""

#property

version
  
"1.00"

#property

indicator_chart_window

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// class calculation ch%

//

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
);
// let's 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
);
// let's 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: i-sadukey sig - 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;

.......

Leave your opinion, ask a question, share some knowledge

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.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.