Brooky_FibIt_Extension_Script
Download scriptThe Brooky_FibIt_Extension Script is a specialized tool designed for traders using MetaTrader 4 to automate the placement and visualization of Fibonacci extension levels on their trading charts. Rather than manually drawing complex retracement lines and calculating price targets, this script instantly generates a pre-configured geometric layout based on specific historical price action.
Core Functionality
The primary purpose of this script is to eliminate manual calculation errors and save time during live market analysis. When executed, the tool identifies a specific swing move on the chart (based on recent high and low price points) and instantly anchors a Fibonacci extension overlay.
Key Features & Logic:
- Automated Anchor Points: The script automatically looks back at a set number of candles to identify the "High" and "Low" points of a recent market move. It then uses these coordinates to draw the Fibonacci tool precisely, ensuring that the proportions of the price move are accurately represented.
- Customizable Visuals: Users can personalize the appearance of the tool directly through the settings menu. This includes changing the color, thickness, and line style of both the main Fibonacci bars and the individual level lines.
- Dynamic Labeling & Descriptions: One of the script's most useful features is its ability to "tag" specific levels with meaningful trading information. It automatically generates text labels for the Fibonacci levels, allowing you to see critical data points at a glance, such as:
- Stop Loss (SL) positions.
- Take Profit (TP1 and TP2) targets.
- Re-Entry Break zones.
- Precise Level Control: The script is programmed with seven specific Fibonacci levels by default, but these can be adjusted to meet specific trading strategies. Each level displays its corresponding price value on the chart, providing an immediate reference for where to enter or exit a trade.
How it Benefits the Trader:
Instead of manually dragging a Fibonacci tool and trying to align it perfectly with historical highs and lows, this script provides an "instant setup." By running the script, the trader receives a clean, professionally labeled roadmap of the current market trend, highlighting exactly where the most significant price targets and risk zones are located.
//+------------------------------------------------------------------+
//| Brooky_FibIt_Extension_Script.mq4 |
//| Copyright 2012, www.Brooky_Indicators.com |
//| www.Brooky_Indicators.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, www.Brooky_Indicators.com"
#property link "www.Brooky_Indicators.com"
#property show_confirm
#property show_inputs
//+---------------------
//| script program start function |
//+------------------------------------------------------------------+
extern int FibOnChartNum =1;
extern color Fib_Cbar_Color = Red;
extern int Fib_Cbar_Size=1;
extern int Fib_Cbar_Style=2;
extern color Fib_Level_Color = Gray;
extern int Fib_Level_Size=1;
extern int Fib_Level_Style=2;
extern double Fib_Level_1 = -0.117;
extern double Fib_Level_2 = 0;
extern double Fib_Level_3 = 1;
extern double Fib_Level_4 = 1.618;
extern double Fib_Level_5 = 2;
extern double Fib_Level_6 = 2.382;
extern double Fib_Level_7 = 3;
string Xtra_txtFib_Level_1 = "(SL) ";
string Xtra_txtFib_Level_2 = "";
string Xtra_txtFib_Level_3 = "";
string Xtra_txtFib_Level_4 = "(TP1)";
string Xtra_txtFib_Level_5 = "(TP2)";
string Xtra_txtFib_Level_6 = "Re Entry Break ";
string Xtra_txtFib_Level_7 = "";
string txtFib_Level_1 = "";
string txtFib_Level_2 = "";
string txtFib_Level_3 = "";
string txtFib_Level_4 = "";
string txtFib_Level_5 = "";
string txtFib_Level_6 = "";
string txtFib_Level_7 = "";
string FibPrice = " @ %$";
string FibName = "";
int start()
{
//----
txtFib_Level_1 = StringConcatenate(Xtra_txtFib_Level_1,DoubleToStr(Fib_Level_1,3),FibPrice);
txtFib_Level_2 = StringConcatenate(Xtra_txtFib_Level_2,DoubleToStr(Fib_Level_2,3),FibPrice);
txtFib_Level_3 = StringConcatenate(Xtra_txtFib_Level_3,DoubleToStr(Fib_Level_3,3),FibPrice);
txtFib_Level_4 = StringConcatenate(Xtra_txtFib_Level_4,DoubleToStr(Fib_Level_4,3),FibPrice);
txtFib_Level_5 = StringConcatenate(Xtra_txtFib_Level_5,DoubleToStr(Fib_Level_5,3),FibPrice);
txtFib_Level_6 = StringConcatenate(Xtra_txtFib_Level_6,DoubleToStr(Fib_Level_6,3),FibPrice);
txtFib_Level_7 = StringConcatenate(Xtra_txtFib_Level_7,DoubleToStr(Fib_Level_7,3),FibPrice);
FibName = "Brooky_Fib_"+FibOnChartNum;
ObjectDelete(FibName);
ObjectCreate(FibName,OBJ_FIBO,0,Time[9],High[24],Time[1],Low[1]);
ObjectSet(FibName, OBJPROP_COLOR,Fib_Cbar_Color);
ObjectSet(FibName, OBJPROP_WIDTH ,Fib_Cbar_Size);
ObjectSet(FibName, OBJPROP_STYLE ,Fib_Cbar_Style);
ObjectSet(FibName, OBJPROP_RAY,True);
ObjectSet(FibName, OBJPROP_LEVELSTYLE,Fib_Level_Style);
ObjectSet(FibName, OBJPROP_LEVELCOLOR,Fib_Level_Color);
ObjectSet(FibName, OBJPROP_LEVELWIDTH,Fib_Level_Size);
ObjectSet(FibName, OBJPROP_FIBOLEVELS,7);
ObjectSet(FibName, OBJPROP_FIRSTLEVEL+0,Fib_Level_1);
ObjectSet(FibName, OBJPROP_FIRSTLEVEL+1,Fib_Level_2);
ObjectSet(FibName, OBJPROP_FIRSTLEVEL+2,Fib_Level_3);
ObjectSet(FibName, OBJPROP_FIRSTLEVEL+3,Fib_Level_4);
ObjectSet(FibName, OBJPROP_FIRSTLEVEL+4,Fib_Level_5);
ObjectSet(FibName, OBJPROP_FIRSTLEVEL+5,Fib_Level_6);
ObjectSet(FibName, OBJPROP_FIRSTLEVEL+6,Fib_Level_7);
ObjectSetFiboDescription(FibName,0,txtFib_Level_1);
ObjectSetFiboDescription(FibName,1,txtFib_Level_2);
ObjectSetFiboDescription(FibName,2,txtFib_Level_3);
ObjectSetFiboDescription(FibName,3,txtFib_Level_4);
ObjectSetFiboDescription(FibName,4,txtFib_Level_5);
ObjectSetFiboDescription(FibName,5,txtFib_Level_6);
ObjectSetFiboDescription(FibName,6,txtFib_Level_7);
//----
return(0);
}
//+------------------------------------------------------------------+
Comments