PercentInfo Indicator For MT5
The PercentInfo Indicator For MT5
Installing the PercentInfo 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 percentinfo.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 PercentInfo Indicator For MT5
The PercentInfo Indicator For MT5 has 8 parameters to configure.
input color UpColor=Teal;//color for the upward move
input color DnColor=Magenta;//color for the downward move
input color ZrColor=Gray;//color for no change
input int FontSize=11; //font size
input type_font FontType=Font14; //font type
input ENUM_BASE_CORNER WhatCorner=CORNER_LEFT_LOWER; //location corner
input uint Y_=20; //vertical location
input uint X_=5; //horizontal location
Buffers of the PercentInfo Indicator For MT5
The PercentInfo Indicator For MT5 provides 0 buffers.
Main Parts Of The Code
int OnCalculate(
const int rates_total, // history in bars at the current tick
const int prev_calculated,// history in bars at the previous tick
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[]
)
{
//----
double DayOpPrice[1],DayClPrice[1],WeekOpPrice[1],WeekClPrice[1],MonthOpPrice[1],MonthClPrice[1];
//---- copy the new data into the array
if(CopyOpen(Symbol(),PERIOD_D1,0,1,DayOpPrice) lt =0) return(RESET);
if(CopyClose(Symbol(),PERIOD_D1,0,1,DayClPrice) lt =0) return(RESET);
if(CopyOpen(Symbol(),PERIOD_W1,0,1,WeekOpPrice) lt =0) return(RESET);
if(CopyClose(Symbol(),PERIOD_W1,0,1,WeekClPrice) lt =0) return(RESET);
if(CopyOpen(Symbol(),PERIOD_MN1,0,1,MonthOpPrice) lt =0) return(RESET);
if(CopyClose(Symbol(),PERIOD_MN1,0,1,MonthClPrice) lt =0) return(RESET);
//----
color ColorDayGain=ZrColor;
color ColorWeekGain=ZrColor;
color ColorMonthGain=ZrColor;
//----
string DailyInfo = StringWordConvertor("Daily....: ",DayOpPrice[0],DayClPrice[0],_Digits);
string WeeklyInfo = StringWordConvertor("Weekly...: ",WeekOpPrice[0],WeekClPrice[0],_Digits);
string MonthlyInfo= StringWordConvertor("Monthly..: ",MonthOpPrice[0],MonthClPrice[0],_Digits);
//----
if(DayClPrice[0]-DayOpPrice[0] lt 0) ColorDayGain=DnColor;
else ColorDayGain=UpColor;
//----
if(WeekClPrice[0]-WeekOpPrice[0] lt 0) ColorWeekGain=DnColor;
else ColorWeekGain=UpColor;
//----
if(MonthClPrice[0]-MonthOpPrice[0] lt 0) ColorMonthGain=DnColor;
else ColorMonthGain=UpColor;
//----
SetTLabel(0,"DailyStat",0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X_,Y_+shift_1,DailyInfo,ColorDayGain,sFontType,FontSize);
SetTLabel(0,"WeeklyStat",0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X_,Y_+shift_2,WeeklyInfo,ColorWeekGain,sFontType,FontSize);
SetTLabel(0,"MonthlyStat",0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X_,Y_+shift_3,MonthlyInfo,ColorMonthGain,sFontType,FontSize);
//----
ChartRedraw(0);
//----
return(rates_total);
}
//+------------------------------------------------------------------+