Fibonnaci_Alert

Author: Melpheos from ForexFactory
Fibonnaci_Alert

This script is designed to assist traders by automatically identifying specific price movements on a trading chart and providing audible alerts when the market reaches key psychological levels. It simplifies the process of monitoring "Fibonacci" retracements—a common technique used to identify potential areas where a price might bounce or reverse.

How the System Works

1. Visual Mapping of Price Movement The tool begins by placing two horizontal lines on your trading chart. These lines serve as anchors for the current market trend:

  • Start Line: Marks the beginning of a price movement.
  • End Line: Marks the peak or trough reached during that movement.

You can customize these lines' colors and styles to make them clearly visible against your background.

2. Dynamic Trend Detection The script automatically senses the direction of the market based on where these two lines are placed:

  • If the "Start" price is lower than the "End" price, the tool recognizes an Upward Move.
  • If the "Start" price is higher than the "End" price, it recognizes a Downward Move.

As the market price continues to move in the direction of the trend, the "End" line automatically adjusts to follow the current highest or lowest price. This ensures that the tool always captures the most recent significant expansion of the market.

3. Automated Fibonacci Calculation Once the movement and its direction are established, the script calculates a specific retracement level based on a pre-set percentage (defaulting to 0.382). It identifies the exact price point where the market has "pulled back" enough to potentially trigger a trend reversal or a continuation.

4. Real-Time Notifications Instead of requiring you to watch the screen constantly, the script monitors the live price. When the market price enters the calculated Fibonacci zone (for example, dropping into a support zone during an uptrend), it triggers an audible alert. This allows you to stay focused on other tasks while being instantly notified when the price hits your target area.

Summary of Key Features

  • Automatic Tracking: The "End" line moves with the market to keep your data current.
  • Dynamic Logic: Automatically distinguishes between bullish and bearish trends.
  • On-Screen Data: Displays the current Fibonacci price, Start/End prices, and the trend direction directly on your chart area.
  • Audio Alerts: Provides immediate sound feedback when a key level is touched.
Miscellaneous
It plays sound alerts
8 Views
0 Downloads
0 Favorites
Fibonnaci_Alert
//+------------------------------------------------------------------+
//|                                             Fibonnacci_Alert.mq4 |
//+------------------------------------------------------------------+
#property copyright "Melpheos from ForexFactory"

#property indicator_chart_window
extern string StartLine="Start of Movement";
extern string EndLine="End of Movement";
extern color StartColor=Blue;
extern color EndColor=Red;
extern int LineStyle=STYLE_SOLID;
extern double FibLevel = 0.382;
extern string AlertWav="alert.wav";

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete (StartLine);
   ObjectDelete (EndLine);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
string Direction;
double Fib;


      ObjectCreate(StartLine, OBJ_HLINE, 0, 0, Bid);
      ObjectCreate(EndLine, OBJ_HLINE, 0, 0, Ask);
      ObjectSet(StartLine, OBJPROP_STYLE, LineStyle);
      ObjectSet(StartLine, OBJPROP_COLOR, StartColor);
      ObjectSet(EndLine, OBJPROP_STYLE, LineStyle);
      ObjectSet(EndLine, OBJPROP_COLOR, EndColor);
        
      double StartPrice =  ObjectGet( StartLine, OBJPROP_PRICE1);
      double EndPrice =  ObjectGet( EndLine, OBJPROP_PRICE1);

// Define move direction     
 
      if (StartPrice < EndPrice) Direction = "UpMove";
         else Direction = "DownMove";
         
// Check if necessary to move lines

      if ((Direction == "UpMove") && (Bid > EndPrice))
         ObjectMove(EndLine, 0, TimeCurrent(), Bid);
      if ((Direction == "DownMove") && ( Bid < EndPrice))
         ObjectMove(EndLine, 0, TimeCurrent(), Bid);
         
// Check Price of Fib level

      if (Direction == "UpMove") Fib = EndPrice - ((EndPrice - StartPrice)*FibLevel);
      if (Direction == "DownMove") Fib = EndPrice + ((StartPrice - EndPrice)*FibLevel);
Comment(Fib,"  ", StartPrice, "  ", EndPrice, "    ", Direction);
      
// Check Alert

      if ((Direction == "UpMove") && (Bid < Fib)) PlaySound(AlertWav);
      if ((Direction == "DownMove") && (Bid > Fib)) PlaySound(AlertWav); 
         
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments