Golden CrossFlex
- Эксперты
- Версия: 1.8
- Активации: 5
Golden CrossFlex.mq5
Golden CrossFlex is an automated trading system for MetaTrader 5 based on Moving Average (MA) crossovers. It combines flexible trade direction filters, money management rules, and a dynamic trailing stop system to maximize profits while controlling risk.
⚙️ Functions
-
MA Crossover Detection:
-
Opens BUY trades when the fast MA crosses above the slow MA.
-
Opens SELL trades when the fast MA crosses below the slow MA.
-
-
Trade Direction Control: Allows trading in both directions, only BUY, or only SELL.
-
Risk Management:
-
Optional Stop Loss in USD (negative value triggers automatic closure when loss reaches the set amount).
-
Dynamic Trailing Stop that locks a percentage of floating profit once a minimum profit threshold is reached.
-
-
Daily Trade Limit: Restricts the maximum number of trades per day.
-
Position Management:
-
Limits the maximum number of concurrent BUY and SELL positions.
-
Closes profitable positions when an opposite crossover occurs.
-
🔧 Input Parameters
-
MA Settings
-
InpFastMAPeriod : Fast MA period (short-term).
-
InpSlowMAPeriod : Slow MA period (long-term).
-
InpMAMethod : Type of MA (e.g., EMA, SMA).
-
InpAppliedPrice : Price type used (Close, Open, etc.).
-
-
Money Management
-
InpLotSize : Fixed lot size per trade.
-
InpStopLossMoney : Stop loss in USD (negative value activates it, 0 disables).
-
InpMagicNumber : Unique identifier for trades opened by this EA.
-
-
Dynamic Trailing % Settings
-
InpTriggerProfitMoney : Minimum profit (USD) required to activate trailing.
-
InpTrailingPercent : Percentage of profit to lock (e.g., 60% secures 60% of floating profit).
-
-
Restrictions
-
InpTradeDirection : Choose BUY only, SELL only, or BOTH.
-
InpMaxActiveBuy : Maximum concurrent BUY positions.
-
InpMaxActiveSell : Maximum concurrent SELL positions.
-
InpMaxDailyTrades : Maximum trades allowed per day.
-
📈 How It Works
-
Initialization:
-
Sets up MA indicators and resets daily trade counter.
-
-
On Each Tick:
-
Updates MA values and checks for crossover signals.
-
Monitors active positions for stop loss, trailing stop, and opposite crossover closure.
-
Resets daily trade count at the start of a new day.
-
-
Entry Logic:
-
Opens BUY when fast MA crosses above slow MA (if allowed and within limits).
-
Opens SELL when fast MA crosses below slow MA (if allowed and within limits).
-
-
Exit Logic:
-
Closes positions if stop loss or trailing stop conditions are met.
-
Closes profitable positions when an opposite crossover occurs.
-
This EA is designed for traders who want a flexible MA crossover system with dynamic profit protection and strict trade limits to avoid overtrading.
