Discussing the article: "Automating Trading Strategies in MQL5 (Part 40): Fibonacci Retracement Trading with Custom Levels"

 

Check out the new article: Automating Trading Strategies in MQL5 (Part 40): Fibonacci Retracement Trading with Custom Levels.

In this article, we build an MQL5 Expert Advisor for Fibonacci retracement trading, using either daily candle ranges or lookback arrays to calculate custom levels like 50% and 61.8% for entries, determining bullish or bearish setups based on close vs. open. The system triggers buys or sells on price crossings of levels with max trades per level, optional closure on new Fib calcs, points-based trailing stops after a min profit threshold, and SL/TP buffers as percentages of the range.

In the OnDeinit function, we remove all info labels with the ObjectsDeleteAll function specifying prefix "InfoLabel_" and type OBJ_LABEL across all subwindows, then delete the daily Fib object via "ObjectDelete" on "FIB_OBJ" and the array one on "fibName" to clear visuals. Upon compilation, we get the following outcome.

COMPILED GIF

We can see that we manage the positions by default by applying trailing stops when needed, hence achieving our objectives. The thing that remains is backtesting the program, and that is handled in the next section.


Author: Allan Munene Mutiiria

 
wow this so good I am using this is my trading strategy perfect thanks for this 
 
Israr Hussain Shah #:
wow this so good I am using this is my trading strategy perfect thanks for this 
Thanks for the kind feedback. Welcome.
 
This so Amazing Just to apply what I learned in Campus to my Trading Strategies, Can we do one on Geometric Brownian Motion Too and also Calculus 
 
Lesley Malabi Barasa #:
This so Amazing Just to apply what I learned in Campus to my Trading Strategies, Can we do one on Geometric Brownian Motion Too and also Calculus 
Thanks for the kind feedback. Sure.