
The black fairy trading system uses a mean-reversion approach with moving averages and the Keltner channel to time entries as price returns to mean, hedging and trailing stops manage risk.
Learn to customize MetaTrader 5 chart aesthetics for a Black Fairy expert advisor by adjusting grid visibility, chart mode, background and candle colors, and by testing indicators in strategy tester.
Import the keltner channel indicator into an ea, copy the upper and lower values, and configure kcc inputs (period, deviation, mode, applied price) for entry decisions.
Create a function to calculate Keltner channel values in the EA, storing results in calculated KCC upper and lower arrays. Then remove the KCC indicator, keeping a single moving average.
Define entry signals for mql5: buy on close above lower Keltner line after close below it, and sell on close below higher Keltner line after close above it.
Prepare your ea by including trade.mq, creating a CTrade object to access the trade class, then set the magic number and slippage in points (five pips) before compiling.
Implement buy and sell functions in MQL5. Enter trades at the ask price with defined stops and targets, and add a trade-count filter to limit executions.
Implement integer variables to track candlesticks after buy and after sell, ensuring trades only enter on new bars by comparing bars on the chart.
Develop a dynamic take profit function for both buy and sell positions to monetize profits toward a set target, then trigger a close all trades routine when reached.
apply cost averaging to a MQL5 grid strategy, entering buys and sells on keltner channel break signals and re-entering at better prices to capture profits while avoiding false breakouts.
Implement cost averaging by computing the last entry price and setting next buy and sell prices with a five-pip grid in a MQL5 expert advisor.
Explore using a lot multiplier to dynamically scale grid hedging trades in an mql5 advisor, removing the first position's stop loss for cost averaging and guiding progressive lot sizing.
Limit risk in cost averaging by capping the number of grid trades and testing in visual mode. Observe how a max trades filter reduces drawdown and boosts profit.
Develop an auto lot function that scales lot size with account balance via balance and volume increases, with min/max limits, two-decimal normalization, and adjust take-profit targets as balance grows.
Learn to add a trailing stop loss to a MQL5 expert advisor for a black fairy hedging grid strategy, offering profit target and trailing stop options to lock in profits.
This lecture shows adding a trailing take profit to an expert advisor to prevent runaway grid by using a moving average as the trailing exit in grid trading.
Fixes a bug in trailing stop logic by tracking last buy and sell prices using ask and bid prices before trade entry, ensuring correct grid entries and take profit.
In this lesson, we debug an MQL5 EA by fixing how trades are counted, separating pi and cell counters, and testing with position info to ensure correct grid cell entries.
Diagnose the mql5 expert advisor to stop grid entries on every tick, trigger only on price action beyond keltner channel, and review trailing stop loss and trailing take profit setups.
Add hedging capability to the expert advisor and hedge all pie trades and sell trades; compute the total lot size with a by position size function that sums trade volumes.
Build hedging functions for an expert advisor, add a hedge lot multiplier, and implement Keltner channel breakout rules to place hedge trades with disciplined sizing.
Explore setting a hedge basket target in MQL5 as this lecture demonstrates hedging logic with boolean controls, profit-target close-all, and iterating positions to calculate total hedge profit on Metatrader.
Fix a bug in the black fairy hedging grid scalping strategy by filtering hedge trades during trailing stops and using comments to prevent premature stop losses.
Add a loss recovery feature with two exclusive options—hedging and trailing take profit—controlled by a loss recovery method enum; switch in tick to run the chosen method (default hedging).
Optimizing an expert advisor for a grid hedging strategy, the lecture focuses on four trade management parameters—grid distance, load multiplier, hedge load multiplier, and maximum trades—while avoiding curve fitting.
Thank you for joining the MQL5 projects course on the black fairy hedging grid scalping strategy. Apply what you learned to your personal projects and contact us with questions.
The Black Fairy trading strategy is a mean reversion system. It seeks to find market tops and bottoms by calculating how far price has deviated from the mean. Its entry principles are based on the fact that price will always revert back to the mean no matter how far it may deviate from it.
In this course, we'll explore the power of the Black Fairy strategy, a system that capitalizes on entries in the market during its movement towards the mean. With the application of powerful trade management protocols and risk adjustments, this strategy has become a source of pride for me, and I'm excited to share it with you.
Our focus will be on trade management strategies, as we walk you through the process of building a complex Expert Advisor that uses advanced trade management techniques to earn consistent profits in the market. We'll teach you how to code custom chart appearances, calculate custom indicator values, and interpret trading strategy concepts using functional programming.
But that's not all - we'll also explore some of the most interesting and unique ways to use the MQL5 language that you won't find in other courses.
Throughout the course, we'll cover a range of trade management strategies, including cost averaging, trailing stops, and hedging, to help you optimize your trading system and minimize losses. We'll also explore how to debug and optimize your Expert Advisor to ensure maximum efficiency with minimal curve fitting.
Here's a preview of what you'll learn in this course:
Custom chart appearances – Discover how to code a custom chart appearance to change the appearance of any chart when our expert advisor is loaded.
Custom indicator values – Learn how to calculate custom indicator values within an expert advisor and publish it as one file as required by the Metaquotes marketplace.
Functional programming – Understand the thought process of functional programming to interpret trading strategy protocol concepts and translate them into code.
Cost averaging – Add cost averaging capabilities to our EA with a fixed virtual monetary take profit.
Trailing stop – Explore the idea of trailing the price with a trailing stop for a basket of orders after our monetary take profit amount is reached to squeeze more profits out of our positions.
Trailing take profit – Use a trailing take profit to escape the eventuality of a runaway grid.
Hedging – Use hedging to shift your position in the market towards the prevailing market direction when the market conditions do not favor us as a loss recovery strategy.
Debugging – Learn how to debug expert advisors to find inefficiencies in our code and solve them.
Optimization – Discover how to optimize a strategy with minimum curve fitting of parameters.
Enroll today and join us on this incredible journey of developing the Black Fairy trading strategy. Click that enroll button now and take the first step towards trading success!