Set_Expansion_Price_Any
Download scriptThis script is designed to automate the visual organization of Fibonacci Expansion tools on your trading charts. Its primary purpose is to enhance the readability of these technical analysis tools by automatically generating and updating descriptive labels for every price level within a selected tool.
Core Functionality
When you place a Fibonacci Expansion tool on your chart, it typically displays various percentage levels (such as 61.8%, 100%, etc.). While these are useful, they can sometimes be difficult to distinguish at a quick glance. This script solves that by scanning your chart for any active expansion objects and automatically attaching a clear, custom text description to every single one of its levels.
How it Works
The logic follows a three-step process:
- Automatic Detection: The script continuously monitors your workspace. It identifies every object on the screen that qualifies as a "Fibonacci Expansion" tool.
- Dynamic Labeling: For every expansion tool found, the script looks at each individual price level (up to 32 levels). It takes the numerical value of that level and converts it into a readable format.
- Visual Enhancement: It then applies a standardized label to those levels in the format of: "FIBO EXT ([Level Value]) - %". This ensures that every point on your tool is clearly identified with its corresponding percentage, making it much easier for you to identify key support or resistance zones instantly.
User Experience
From a user's perspective, this script acts as an "auto-labeler." Instead of you having to manually rename or check the values of each Fibonacci level, the script does the heavy lifting in the background. It ensures that your charts remain organized and that all your technical analysis markers are consistently labeled, providing a cleaner and more professional viewing experience for your trading environment.
//+------------------------------------------------------------------+
//| Set_Fibo_Price_Any.mq4 |
//| Copyright © 2007, Eng. Waddah Attar |
//| waddahattar@hotmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright Waddah Attar"
#property link "waddahattar@hotmail.com"
//----
#property indicator_chart_window
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
Comment("Set_Expansion_Price_Any");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
int obj_total = ObjectsTotal();
string name;
for(int i = 0; i < obj_total; i++)
{
name = ObjectName(i);
if(ObjectType(name) == OBJ_EXPANSION)
{
for(int j=0;j<32;j++)
{
if(GetLastError() != 0)
break;
ObjectSetFiboDescription(name, j, DoubleToStr(ObjectGet(name,
OBJPROP_FIRSTLEVEL + j)*100, 1));
}
}
}
Comment("");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int obj_total = ObjectsTotal();
string name,text;
for(int i = 0; i < obj_total; i++)
{
name = ObjectName(i);
if(ObjectType(name) == OBJ_EXPANSION)
{
for(int j = 0; j < 32; j++)
{
if(GetLastError() != 0)
break;
ObjectSetFiboDescription(name, j, " FIBO EXT (" + DoubleToStr(ObjectGet(name,
OBJPROP_FIRSTLEVEL+j)*100,1) + ")" + " - %$");
}
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments