FE Fibonacci Extension - MetaTrader 4 Script | Trading Script Download - MT4/MT5 Resources

Hello fellow traders...
This is a FE Fibonacci extension I created using 2 objects (P[2]) in an array that represent properties for each upward or downward direction.
This is a class:
class___ { people : integers aa, bb, cc; Double one, Second, C; ___(): Ah ( 0 ), bb ( 0 ), CC ( 0 ), A( 0.0 ),B( 0.0 ),C( 0.0 ) {} ~___(){} } P[ 2 ];
I then used the fractal formula with a few modifications to determine the upper, lower and price between three points and their direction.
I use a loop with the nearest bar position:
//--- Integer i = 0 ; Integer meters = 0 , n = 0 ; boolean stop = false ; Double hello= 0.0 ,lo= 0.0 ; //--- A= 0.0 ; B= 0.0 ; C= 0.0 ; for (m= 0 ,n= 0 ,i= 0 ;i< bar - 5 &&!stop;i++) { Hello =( love high ( _symbol , 0 ,i+ 2 )>= love high ( _symbol , 0 ,i+ 0 )&& love high ( _symbol , 0 ,i+ 2 )>= love high ( _symbol , 0 ,i+ 1 )&& love high ( _symbol , 0 ,i+ 2 )>= love high ( _symbol , 0 ,i+ 3 )&& love high ( _symbol , 0 ,i+ 2 )>= love high ( _symbol , 0 ,i+ 4 )) ? lovehigh ( _symbol , 0 ,i+ 2 ): 0.0 ; Luo=( low ( _symbol , 0 ,i+ 2 )<= low ( _symbol , 0 ,i+ 0 )&& low ( _symbol , 0 ,i+ 2 )<= low ( _symbol , 0 ,i+ 1 )&& low ( _symbol , 0 ,i+ 2 )<= low ( _symbol , 0 ,i+ 3 )&& low ( _symbol , 0 ,i+ 2 )<= low ( _symbol , 0 ,i+ 4 )) ? low ( _symbol , 0 ,i+ 2 ): 0.0 ; //--- //--- //------------------------------------------------------------------------------------------------------------------------------------------------ //---------------------------------------------------------------------------------------------------------------------------------------- if (Hi! = 0.0 ) // - - - - - - Up - - - - { if (P[ 1 ].C!= 0.0 ) { if (n== 2 ) { if (P[ 1 ].B1 ].C1 ].B) { P[ 1 ].B=Hi; //Modify B[1] before A[1] exists P[ 1 ].bb=i+mber">2; } } if (n== 1 ) { if (P[ 1 ].C<hi) { P[ 1 ].B=hi; //This B[1] dn P[ 1 ].bb=i+ 2 ; n++; } other { n--; P[ 1 ].C= 0.0 ; } } } //--- if (P[ 0 ].C== 0.0 ) { if (m < 1 ) { P[ 0 ].C = hi; // initial C[0] up P[ 0 ].cc = i+ 2 ; m++; } } else { if (m == 2 ) { if (P[ 0 ].C < hi) { P[ 0 ].A = hi; // this A[0] up P[ 0 ] .aa = i+ 2 ; m = 0 ; stop = true ; } } if (m == 1 ) { if (P[ 0 ].C < hi) { P[ 0 ].C = hi ; //Modify C[ 0 ] before B[0] exists P[ 0 ].cc=i+ 2 ; } } } //--- } //Other if (voila! = 0.0 ) // ------------ dn ------------ { if (P[ 0 ].C!= 0.0 ) { if (m == 2 ) { if ( P[ 0 ] .B>lo&&P [ 0 ] .C>P[ 0 ].B) { P[ 0 ].B=lo; //Modify B[0] before A[0] exists P[ 0 ].bb=i+ 2 ; } } if (m == 1 ) { if (P[ 0 ].C> lo ) { P[ 0 ].B=lo; //This B[0] goes up P[ 0 ].bb=i+ 2 ; m ++ ; } else { m—— ; {if ( P [ 1 ].C>lo) {P[ 1 ].A=lo; //This A[1] dn P[ 1 ].aa=i+ 2 ; n= 0 ; stop= true ; } } if (n== 1 ) { if (P[ 1 ].C>lo) { P[ 1 ].C=lo; //Modify C[1] before B[1] exists P[ 1 ].cc=i+ 2 ; } } } //--- } //Others // //--- //--- //--- if ((P[ 0 ].C== 0.0 &&P[ 1 ].C== 0.0 )||(Hi== 0.0 &&lo== 0.0 )) { continue ; } } // Ring
If 3 points in the UP or DOWN direction are found, the cycle is interrupted.
I have to come up with 3 points early.
if (P[ 0 ].A!= 0.0 &&P[ 0 ].B!= 0.0 &&P[ 0 ].C!= 0.0 ) { Draw extension (tool, "FE->" , time [P[ 0 ].aa], P[ 0 ].A, time [P[ 0 ].bb], P[ 0 ].B, time [P[ 0 ].cc], P[ 0 ].C,- 1 ); } //--- if (P[ 1 ].A!= 0.0 &&P[ 1 ].B!= 0.0 &&P[ 1 ].C!= 0.0 ) { Draw extension (tool, "FE->" , time [P[ 1 ].aa], P[ 1 ].A, time [P[ 1 ].bb], P[ 1 ].B, time [P[ 1 ].cc], P[ 1 ].C, 1 ); }
Finally draw using OBJ_EXPANSION object..and I use single function DrawExpansion(...).
blank draw expand( string name, string label, datetime t1, double p1, datetime t2, double p2, datetime t3, double p3, integer flor = 0 ) { //--- Object delete (name); Color wrn=(fl> 0 )? clrsky blue:(fl< 0 )? Tomato : innocent ; if ( object lookup ( 0 , name)! = 0 ) Object creation (name, OBJ_EXPANSION , 0 ,t1,p1,t2,p2,t3,p3); ObjectSet(name, OBJPROP_FIBOLEVELS, 5 ); ObjectSet(name, OBJPROP_FIRSTLEVEL+ 0 , 0.618 ); ObjectSet(name, OBJPROP_FIRSTLEVEL+ 1 , 1.000 ); ObjectSet(name, OBJPROP_FIRSTLEVEL+ 2 , 1.618 ); ObjectSet(name, OBJPROP_FIRSTLEVEL+ 3 , 2.618 ); Object set (name, OBJPROP_FIRSTLEVEL+ 4 , 4.236 ); //--- Object set (name, OBJPROP_LEVLCOLOR , purple in clr ); ObjectSet(name, OBJPROP_LEVELWIDTH , 1 ); ObjectSet(name, OBJPROP_LEVLSTYLE , 0 ); ObjectSet(name, OBJPROP_COLOR , warning); //--- ObjectSetFiboDescription(name, 0 , label + " " +DoubleToStr( 0.618 * 100 , 1 ) + " " ); ObjectSetFiboDescription(name, 1 , label + " " +DoubleToStr( 1.000 * 100 , 1 ) + " " ); ObjectSetFiboDescription(name, 2 , label + " " +DoubleToStr( 1.618 * 100 , 1 )+ " " ); ObjectSetFiboDescription(name, 3 , label + " " +DoubleToStr( 2.618 * 100 , 1 ) + " " ); ObjectSetFiboDescription(name, 4 , label + " " +DoubleToStr( 4.236 * 100 , 1 ) + " " ); //--- }

Attachment download
📎 fe.mq4 (7.93 KB)
Source: MQL5 #31891
FE Fibonacci Extension-Key points before using MetaTrader 4 script
This page has been supplemented with structured instructions, focusing on the purpose of trading scripts, MT4/MT5 platform compatibility, testing procedures and risk control. Before downloading or deploying, it is recommended to first determine whether it is consistent with your own variety, cycle and account environment.
Suitable for who to use
- Users who want to quickly screen trading scripts and are willing to do simulation verification first.
- People who need to compare MT4/MT5 EAs, indicators, scripts or source code projects.
- Traders who wish to record backtests, parameters and risk boundaries before placing a trade.
Testing and risk control suggestions
- First verify the default parameters in the strategy tester or demo account, and then adjust the symbol, period, spread and trading period one by one.
- Scalping, grid, martin, and high-frequency strategies should focus on observing maximum drawdowns, consecutive losses, slippage, and trading frequency.
- It is not recommended to run any document directly on the real disk. At least observe the simulated disk performance for 2-4 weeks first.
FAQ
Can MT4 and MT5 be used interchangeably?
Usually cannot be used directly. EX4/MQ4 corresponds to MT4, EX5/MQ5 corresponds to MT5, and the source code needs to be compiled in the corresponding MetaEditor.
Is this resource guaranteed to be profitable?
cannot. EAs, indicators and scripts can only be used as trading tools, and the results depend on parameters, market environment, spreads, slippage and risk control.
What else can I continue to watch?
Forex EA download , foreign exchange indicator download , EA evaluation , MQL5 CodeBase .
English Search Notes
This page is also optimized for English search intent around FE Fibonacci Extension - MetaTrader 4 Script . Related search terms include: trading script, MT4 script, MT5 script. Test any Forex EA, Expert Advisor, MT4/MT5 indicator, script or MQL source code with historical data and a demo account before live trading.
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •