Join our fan page
- Views:
- 117
- Rating:
- Published:
- 2025.05.04 07:03
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
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
- Attach the EA to a Chart: Open MetaTrader 5 and attach this EA to the chart you wish to use.
- 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).
- 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.

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

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

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

Indicator edition for new platform.