Unlock Trading Success with MSLEA: Your Go-To EA for MetaTrader 4

Mike 2010.12.06 19:32 37 0 0
Attachments


Hey there, traders! Today, let’s dive into the world of automated trading with the MSLEA, a powerful EA (Expert Advisor) specifically designed for MetaTrader 4. This nifty tool is all about leveraging market structure highs and lows to help you make smarter trading decisions.

So, what does MSLEA do? It calculates the most recent local highs and lows, patiently waiting for breakout opportunities. If you’re interested in a deeper dive into local highs and lows, check out my article here.

How MSLEA Works

  • **Long Trades**: If the price climbs above the local high (that’s when it crosses the green line), it’s time to go long.
  • **Short Trades**: Conversely, if the price dips below the local low (crossing the red line), it’s time to short.

For an added layer of precision, you can set a distance in pips. For example, you might want the price to exceed the last high by 5 pips before entering a long position or drop 5 pips below the low for a short.

And don’t worry about getting caught in bad trades—MSLEA utilizes a trailing stop loss to protect your profits.

Key Parameters

  • Level: Set this to 1 for the most recent local high/low. Higher values will use the minimum or maximum of the last n local highs/lows.
  • Distance: Specify your desired distance in pips from the high or low.
  • MaxTrades: The maximum number of trades allowed. A new trade will open only when the stop loss on your existing trades is secured.
  • Lots: Specify the number of lots (0 means minimum lots required).
  • Stop Loss: Use negative values to set a stop loss at a multiple of the broker's minimum (e.g., -3 for 30 pips).
  • Take Profit: Same concept as stop loss for negative values.
  • BreakEven: Set to adjust your stop loss to breakeven after winning x pips.

MSLEA can open as many positions as you like, as long as the stop loss for each is secure. This flexibility allows you to adapt to changing market conditions.

The EA is neatly organized into ea.mqh for better management, making the core code simple while separating order management tools. Feel free to customize your own strategies using ea.mqh!

Support the Author! If you find this code useful, consider showing your support to help keep it free for all. Check the comments in the .mq4 file for more details.

Strategy Tester Report
MSLEA
EGlobal-Cent2 (Build 229)

SymbolEURUSD (Euro vs US Dollar)
Period15 Minutes (M15) 2010.11.18 00:00 - 2010.11.30 23:59
ModelOpen Price (only for Expert Advisors that control bar openings)
ParametersMaxTrades=1; Level=2; Distance=11; Lots=1; Slippage=20; StopLoss=30; TakeProfit=0; TrailingStopLoss=true; BreakEven=20; Magic=12345;

Bars in Test1857Ticks Modeled2712Modeling Qualityn/a
Errors in Chart Adjustment0




Initial Deposit£10,000.00



Total Net Profit£5,908.64Gross Profit£6,028.64Gross Loss-£120.00
Profit Factor50.24Expected Payoff£1,477.16

Absolute Drawdown£170.00Max Drawdown£1,080.00 (7.83%)Relative Drawdown8.18% (£1,040.00)

Total Trades4Winning Short Positions (%)1 (100.00%)Winning Long Positions (%)3 (66.67%)

Profitable Trades (% of Total)3 (75.00%)Loss Trades (% of Total)1 (25.00%)
Largest Profit Trade£5,241.31Loss Trade-£120.00
Average Profit Trade£2,009.55Loss Trade-£120.00
MaximumConsecutive Wins (Profit in Money)3 (£6,028.64)Consecutive Losses (Loss in Money)1 (-£120.00)
MaximalConsecutive Profit (Number of Wins)£6,028.64 (3)Consecutive Losses (Number of Losses)-£120.00 (1)
AverageConsecutive Wins3Consecutive Losses1


List
Comments 0