UltraFatl_HTF Indicator For MT5
The UltraFatl_HTF Indicator For MT5 is an alternate of the UltraFatl indicator that offers traders the liberty of choosing the timeframe for the indicator making it possible to use the indicator to analyse a market using a different timeframe from what is on the current chart.
The UltraFatl indicator is based on the Fatl indicator. It uses the values of the Fatl to generate its signals. However, the UltraFatl_HTF Indicator For MT5 is different from the standard UltraFatl indicator. The UltraFatl indicator plots lines of varying lengths while the UltraFatl_HTF Indicator For MT5 plots a colour cloud. Nonetheless, the two work the same.
The colour cloud plotted by the UltraFatl_HTF Indicator For MT5 indicates the market trend and its colour changes depending on the overbought and oversold levels at +8 and -8 respectively.
When the colour cloud turns Red, it shows a bearish trend has started. When the colour cloud turns Magenta, it shows the bearish trend has entered the oversold region. When the colour cloud turns HotPink, it shows the indicator is moving from the oversold region. When the colour turns brown, it shows the market is in a bearish trend but has just come from an oversold region meaning a bullish trend is more likely to start.
When the colour cloud turns LimeGreen, it shows a bullish trend has started. When the colour cloud turns Lime, it shows the bullish trend has entered the overbought region. When the colour cloud turns PaleGreen, it shows the indicator is moving from the overbought region. When the colour turns Teal, it shows the market is in bullish trend but has just come from the overbought region meaning a bearish trend is more likely to start.
For the indicator to work properly, the SmoothAlgorithms.mqh library classes should also be downloaded.
Installing the UltraFatl_HTF 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 ultrafatl_htf.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 UltraFatl_HTF Indicator For MT5
The UltraFatl_HTF Indicator For MT5 has 18 parameters to configure.
input ENUM_TIMEFRAMES TimeFrame=PERIOD_H4; // Chart period
input ENUM_APPLIED_PRICE Applied_price=PRICE_CLOSE; // Applied price
input Smooth_Method W_Method=MODE_JJMA; // Smoothing method
input int StartLength=3; // Initial smoothing period
input int WPhase=100; // Smoothing parameter
input uint Step=5; // Period change step
input uint StepsTotal=10; // Number of period changes
input Smooth_Method SmoothMethod=MODE_JJMA; // Smoothing method
input int SmoothLength=3; // Smoothing depth
input int SmoothPhase=100; // Smoothing parameter
input Applied_price_ IPC=PRICE_CLOSE; // Price constant
input uint UpLevel=80; // Overbought level, %
input uint DnLevel=20; // Oversold level, %
input color UpLevelsColor=clrBlue; // Overbought level color
input color DnLevelsColor=clrBlue; // Oversold level color
input STYLE Levelstyle=DASH_; // Levels style
input WIDTH LevelsWidth=Width_1; // Levels width
input bool ReDraw=true; // Repeat of information show on the empty bars
Buffers of the UltraFatl_HTF Indicator For MT5
The UltraFatl_HTF Indicator For MT5 provides 3 buffers.
SetIndexBuffer(0,UpBuffer,INDICATOR_DATA);
SetIndexBuffer(1,DnBuffer,INDICATOR_DATA);
SetIndexBuffer(2,ColorBuffer,INDICATOR_COLOR_INDEX);
Main Parts Of The Code
int OnCalculate(const int rates_total, // amount of history in bars at the current tick
const int prev_calculated,// amount of 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[])
{
//--- checking the number of bars to be enough for calculation
if(rates_total lt min_rates_total || !Init) return(RESET);
if(BarsCalculated(UltraFatl_Handle) lt Bars(Symbol(),TimeFrame)) return(prev_calculated);
//--- declaration of integer variables
int limit,bar;
//--- declaration of variables with a floating point
double UpValue[1],DnValue[1],clrValue[1];
datetime UltraFatlTime[1];
static uint LastCountBar;
//--- calculations of the necessary amount of data to be copied and
//--- the starting number limit for the bar recalculation loop
if(prev_calculated gt rates_total || prev_calculated lt =0)// checking for the first start of the indicator calculation
{
limit=rates_total-min_rates_total-1; // starting index for the calculation of all bars
LastCountBar=rates_total;
}
else limit=int(LastCountBar)+rates_total-prev_calculated; // starting index for the calculation of new bars
//--- indexing elements in arrays as timeseries
ArraySetAsSeries(time,true);
//--- main calculation loop of the indicator
for(bar=limit; bar gt =0 && !IsStopped(); bar--)
{
//--- zero out the contents of the indicator buffers for the calculation
UpBuffer[bar]=EMPTY_VALUE;
DnBuffer[bar]=EMPTY_VALUE;
ColorBuffer[bar]=0;
//--- copy newly appeared data in the array
if(CopyTime(Symbol(),TimeFrame,time[bar],1,UltraFatlTime) lt =0) return(RESET);
if(time[bar] gt =UltraFatlTime[0] && time[bar+1] lt UltraFatlTime[0])
{
LastCountBar=bar;
//--- copy newly appeared data into the arrays
if(CopyBuffer(UltraFatl_Handle,0,time[bar],1,DnValue) lt =0) return(RESET);
if(CopyBuffer(UltraFatl_Handle,1,time[bar],1,UpValue) lt =0) return(RESET);
if(CopyBuffer(UltraFatl_Handle,2,time[bar],1,clrValue) lt =0) return(RESET);
//--- loading the obtained values in the indicator buffers
UpBuffer[bar]=UpValue[0];
DnBuffer[bar]=DnValue[0];
ColorBuffer[bar]=clrValue[0];
}
if(ReDraw)
{
if(UpBuffer[bar+1]!=EMPTY_VALUE && UpBuffer[bar]==EMPTY_VALUE)
{
ColorBuffer[bar]=ColorBuffer[bar+1];
UpBuffer[bar]=UpBuffer[bar+1];
DnBuffer[bar]=DnBuffer[bar+1];
}
}
}
//---
return(rates_total);
}
//+------------------------------------------------------------------+