
Develop an expert advisor that uses cost averaging and trailing stops to grow a $100 euro dollar account via five-candle swing breakouts, with no fixed take profit or stop loss.
Set up an expert advisor by creating metadata and a template, organizing the EA folder, defining inputs (symbol, time frame, magic, slippage), and implementing new-bar logic to run on ticks.
Develop swing high and swing low detection and drawing lines on the chart to identify support and resistance for a small trading account expert advisor in MQL5.
Initialize digits, bid, ask, and point from symbol info, then generate buy and sell signals by close relative to swing high and swing low, counting trades with C trade class.
Code your first trades in a MQL5 expert advisor by implementing buy and sell entry functions with 0.01 lot size, using ask and bid prices, and preparing comments.
Set a trailing stop strategy for profitable trades in an MQL5 expert advisor, applying it to cost averaging and first entries, and compute a weighted average price with trail parameters.
Add a trailing stop loss to the MQL5 expert advisor by implementing a void function that iterates positions, computes new stop losses from current price, and updates via position modify.
Define a next entry price function to support cost averaging trades, calculating buy and sell entry levels with distance points and open prices.
Learn to implement cost averaging entries in an MQL5 expert advisor by counting and managing pending orders, and placing buy stop and sell stop orders with comment-based validation.
Create two boolean functions to detect if a buy or sell order is triggered by comparing position trade counts and updating pending orders, including new highs and lows.
Modify pending buy stop and sell stop orders by detecting new highs and lows and updating entries to swing highs or swing lows, with error alerts.
Integrate cost averaging for buys and sells, manage pie stop and trailing stop orders, and update pending orders on every tick to ready the expert advisor for testing.
Test and debug the MQL5 advanced expert advisor with an every-tick backtest on a $100 account at 1:1000 leverage; verify trailing stops and cost averaging, then review drawdown and profits.
Conclude by applying the course’s end-to-end approach to coding an expert advisor that trades a $100 balance with robust trade management.
One of the most critical questions that I get asked a lot is if it’s possible to conduct algorithmic trading successfully using a very small trading account. This question basically goes against the pillar of success in trading based on the belief that well capitalized traders do better in the market than those that are not so well capitalized. This is mainly because better capitalized traders can withstand losses and drawdowns better without losing the ability to trade in the future. So I also asked myself if it’s possible to develop an algorithmic trading strategy that can grow a very small trading account and use cost averaging to reduce the illusion of optimization and perfect market timing. As an algorithmic trader, testing ideas and possibilities is the reason we live. So I decided to test this possibility by developing an algorithmic trading strategy that has the capacity to handle a very small account using cost averaging.
The strengths of this strategy are based on its simple and yet effective entry logic and most importantly, how it manages profitable trades.This strategy was developed and tested on the EURUSD currency pair on the 15M timeframe. The EURUSD was chosen because it is a popular pair for liquidity and cheaper trading costs, and the 15 minute chart strikes a great balance between frequent movement and avoiding too much noise.
If you're still familiarizing yourself with MQL5, don't worry. As long as you understand the basics, this course is perfect for you. I'll patiently guide you through every step, ensuring you grasp the concepts behind each line of code. By the end of this course, you'll have gained the skills necessary to code similar trading models based on the expert advisor shared in this course.
So, hit the enroll button now and join me on this exciting journey of coding a trading strategy that can trade a very small trading account using the MQL5 algorithmic trading language!