Hey there, fellow traders! Today, let’s dive into Brandy, a nifty Expert Advisor (EA) for MetaTrader 4 that keeps things straightforward with its dual moving average strategy.
This EA operates with two moving averages: a slow one that gives the entry signal and a fast one that signals when to exit. It's as simple as that!
How It Works:
- Buy Signal: If the slow MA trends upwards, the EA opens a Buy position. It closes when the fast MA dips down.
- Sell Signal: Conversely, if the slow MA moves down, the EA triggers a Sell position. This closes when the fast MA rises.
No complex calculations or moving average crossovers to worry about - just clear-cut signals! :)
Performance Results
Here’s a look at the optimization results from July 2007 to July 2008:


While optimization often showcases promising results, the real test is how the EA performs in real-time trading after that. To find out, let’s conduct a three-month forward test from July 2008 to today (mid-October), giving us three and a half months of live data.


As you can see, this EA continues to be profitable even after the optimization period!
Key Parameters to Optimize
- p1, p2: Period of averaging for calculating the Moving Average, optimized from 2 to 100 with a step of 1.
- s1, s2: Shift relative to the current bar, optimized from 2 to 20 with a step of 1.
- sl: Stop loss for opened positions, optimized from 10 to 100 with a step of 5.
- ts: Trailing stop for open positions, optimized from 100 to 200 with a step of 5.
It's important to note that if the trailing stop (ts) is set below 100, it will be disabled. This prevents interference during EA operations but acts as a safety net in case of a connection loss.
To disable trailing, simply set the ts variable to a value less than 100. For instance, setting ts = 0 disables the trailing function.
The EA operates on the appearance of a new bar, so make sure to run optimizations using the "Open prices only" model. This is the quickest way to analyze the most recently completed bar, especially for EAs that specifically handle bar openings.
P.S. The EA in the source code hasn’t been optimized yet.
Happy trading, and may your charts always be green!
Comments 0