Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Risk Management EA Based on ATR Volatility - expert for MetaTrader 5

Views:
117
Rating:
(1)
Published:
2025.05.04 07:03
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Brief Description

This Expert Advisor (EA) assists traders in managing risk by automatically adjusting the position size based on market volatility, measured by the ATR (Average True Range) indicator. The EA calculates the optimal position size for each trade to ensure consistent risk exposure, regardless of changing market conditions.

Key Features

  • Dynamic Position Sizing: The EA calculates the position size based on a user-defined risk percentage (of the account balance) and the current ATR value.
  • ATR-Based Stop-Loss: Optionally, the EA can set the stop-loss level based on ATR to adapt to market volatility.
  • Simple Trading Logic: The EA uses a basic moving average crossover strategy to open buy trades, but the primary focus is on risk management.

Usage Instructions

  1. Attach the EA to a Chart: Open MetaTrader 5 and attach this EA to the chart you wish to use.
  2. Configure Input Parameters:
    • RiskPercentage : Set the percentage of the account balance you are willing to risk per trade (e.g., 1.0 for 1%).
    • ATRPeriod : The period for the ATR indicator (e.g., 14).
    • ATRMultiplier : The multiplier for ATR to calculate the stop-loss distance (e.g., 2.0).
    • UseATRStopLoss : Set to true to use ATR-based stop-loss or false to use a fixed stop-loss (e.g., 50 pips).
  3. The EA will automatically calculate the position size and open a trade when the fast moving average crosses above the slow moving average.

Benefits

  • Ensures consistent risk exposure across varying market conditions.
  • Protects the account from large losses during high volatility periods.
  • Customizable to suit different trading strategies and risk tolerance levels.

Risk Warning

  • This EA is designed for educational purposes and should be tested on a demo account before using it in live trading.
  • Always monitor your trades and adjust the parameters as needed to fit your trading style.

Stoch Cross EA – Buy Below 20, Sell Above 80 (H1) Stoch Cross EA – Buy Below 20, Sell Above 80 (H1)

A simple and effective Expert Advisor based on Stochastic Oscillator reversal signals on the H1 timeframe. Buy signals are triggered when %K crosses above %D below the 20 level. Sell signals are triggered when %K crosses below %D above the 80 level. Risk is calculated based on the account balance, with the lot size set to 0.1 (adjustable as needed). Take Profit (TP) is set to 300 points for all positions. Stop Loss (SL) is dynamically calculated based on the opposite crossover signal. The position is closed when a crossover in the opposite direction occurs, as well as when TP or SL is reached

Brooky Trend Strength for MT5 Brooky Trend Strength for MT5

This indicator calls 3 other subwindow indicators. All files go in your Indicators folder.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.