Set_Fibo_Price_Any
Download scriptThis script is designed to enhance the visual clarity of Fibonacci retracement tools on your trading charts. Its primary purpose is to automatically update and display the specific price values associated with each level of a Fibonacci tool, making it easier for traders to identify key support and resistance zones at a glance.
Core Functionality
When you place a Fibonacci retracement on your chart, the software normally displays the percentage levels (such as 61.8% or 50%). While useful, these percentages do not always tell you the exact price point on the current market quote. This script bridges that gap by performing the following actions:
- Automatic Price Labeling: The script scans your active trading chart to identify any Fibonacci objects you have drawn. It then calculates the exact price corresponding to every level of those tools.
- Dynamic Information Display: It takes the calculated price and places it directly into the description field of each Fibonacci level. This allows you to see both the percentage and the actual market price simultaneously (for example, showing "(61.8) - 1.23456").
- Real-Time Updates: The logic is set to run continuously. As the market moves or as you adjust the boundaries of your Fibonacci tool, the script automatically recalculates and refreshes those price labels in real-time so they are always accurate.
User Experience
From a user perspective, this tool removes the need to manually calculate prices or hover your mouse over lines to see where a level sits. By providing this data instantly on the screen, it streamlines your analysis, allowing for quicker decision-making when the market reaches critical price targets.
Clean Workspace Management
The script is also designed to be "tidy." When you remove the script from your chart, it includes a cleanup routine that ensures the temporary labels and modifications it created do not leave unnecessary clutter behind on your workspace.
//+------------------------------------------------------------------+
//| 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_Fibo_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_FIBO)
{
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_FIBO)
{
for(int j = 0; j < 32; j++)
{
if(GetLastError() != 0)
break;
ObjectSetFiboDescription(name, j, "(" + DoubleToStr(ObjectGet(name,
OBJPROP_FIRSTLEVEL+j)*100,1) + ")" + " - %$");
}
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments