5 day Breakout Indicator For MT4
The 5 day Breakout Indicator For MT4 plots horizontal lines around the previous 5 day High price and the 5 day Low price. The High price is marked by a Green Line, while the Low price is depicted by a Red line. Initiating trades using the 5 day Breakout Indicator For MT4 is pretty much self explanatory: 1. A buy signal gets generated when an asset price crosses and closes above the 5 day High line (Green). 2. A sell signal is triggered when price breaches and closes below the 5 day Low line (Red). The default breakout period is defined as 5. However, traders can change it from the indicator input tab.
Installing the 5 day Breakout Indicator For MT4
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file 5_day_breakout.mq4 into the folder MQL4\Indicators of your MT4 installation. After that please restart MT4 and then you will be able to see the indicator in the list of indicators.
Parameters of the 5 day Breakout Indicator For MT4
The 5 day Breakout Indicator For MT4 has 1 parameters to configure.
extern int DAYS=5;
Buffers of the 5 day Breakout Indicator For MT4
The 5 day Breakout Indicator For MT4 provides 0 buffers.
Main Parts Of The Code
int start()
{
double daily_high[20];
double daily_low[20];
double yesterday_close;
double phigh,plow;
int i=1;
//---- TODO: add your code here
ArrayResize(daily_high,DAYS);
ArrayResize(daily_low,DAYS);
ArrayInitialize(daily_high,0);
ArrayInitialize(daily_low,0);
ArrayCopySeries(daily_low, MODE_LOW, Symbol(), PERIOD_D1);
ArrayCopySeries(daily_high, MODE_HIGH, Symbol(), PERIOD_D1);
/* initialise */
plow=daily_low[1];
phigh=daily_high[1];
//----
for(i=1;i lt DAYS;i++)
{
if(plow gt daily_low[i])
{
plow =daily_low[i];
}
}
for(i=1;i lt DAYS;i++)
{
if(phigh lt daily_high[i])
{
phigh =daily_high[i];
}
}
Comment("
5dayH ",phigh,"
5dayL ",plow);
//----
ObjectDelete("5dayHigh");
ObjectDelete("5dayLow");
ObjectCreate("5dayHigh", OBJ_HLINE,0, CurTime(),phigh);
ObjectSet("5dayHigh",OBJPROP_COLOR,SpringGreen);
ObjectSet("5dayHigh",OBJPROP_STYLE,STYLE_SOLID);
ObjectCreate("5dayLow", OBJ_HLINE,0, CurTime(),plow);
ObjectSet("5dayLow",OBJPROP_COLOR,Red);
ObjectSet("5dayLow",OBJPROP_STYLE,STYLE_SOLID);
//----
ObjectsRedraw();
return(0);
}
//+------------------------------------------------------------------