//+------------------------------------------------------------------+ //| 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); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features:
It plays sound alerts