GEN JanusEA
- Experts
- Gede Egi Narditya
- Versione: 1.0
JanusEA Pro: A Market Structure Expert Advisor
Developer: Gede Egi
Overview
JanusEA is an Expert Advisor for MetaTrader 5 based on the concept of market structure. The EA automatically identifies Supply (Pivot High) and Demand (Pivot Low) zones on the chart. Based on these identified zones, JanusEA can execute trades using one of two distinct, selectable trading logics: Breakout or Reversal.
The name is inspired by the Roman god Janus, reflecting the EA's dual-strategy design. This allows users to configure the EA's behavior to align with different market analyses and conditions.
Core Trading Strategies
The EA includes two primary operational modes that can be selected by the user.
- Breakout Strategy
- Logic: This mode is designed to trade in the direction of a price break. It places a Buy Stop order if the price moves above a detected Supply zone and a Sell Stop order if the price moves below a Demand zone.
- Intended Market Condition: This logic is typically applied in trending market environments or during periods of high volatility where price might move strongly in one direction after breaking a key level.
- Reversal Strategy
- Logic: This mode is designed to trade against a price movement as it approaches a key zone. It places a Sell Limit order as price enters a Supply zone and a Buy Limit order as price enters a Demand zone.
- Intended Market Condition: This logic is generally applied in ranging (sideways) market environments where Supply and Demand levels are anticipated to hold and cause a price reversal.
Features
- Automatic Zone Detection: Identifies Supply & Demand zones based on a configurable 'swingSize' parameter.
- Dual Strategy Selection: Users can switch between Breakout or Reversal trading modes via input parameters.
- Automated Lot Sizing: Includes an 'AutoLot' feature that calculates trade volume based on a user-defined risk percentage of the account balance.
- Configurable Risk:Reward Ratio: Allows users to define a Risk:Reward ratio to set the Take Profit distance as a multiple of the Stop Loss distance.
- Trailing Stop Function: A trailing stop can be enabled to manage open positions by adjusting the stop loss level as the price moves in a favorable direction.
- Zone Visualization: An option to display the detected Supply & Demand zones directly on the chart for visual analysis.
- Maximum Stop Loss Limit: A parameter to set a ceiling on the stop loss distance in points ('maxStopLossPoints') for risk control.
Configuration Examples
IMPORTANT: The following settings are for illustrative purposes only and are not optimized trading recommendations. They demonstrate how a user might configure the EA based on a specific market hypothesis. Always conduct thorough backtesting and optimization on your preferred instruments before any live application.
Example 1: Breakout Hypothesis on XAUUSD
- Instrument: XAUUSD (Gold)
- Timeframe: H1
- Selected Strategy: Breakout (useBreakoutStrategy = true)
- Hypothesis: Gold can exhibit strong directional moves after breaking key price levels. This configuration attempts to capture such movements.
- Sample Parameters:
- riskPercent: 0.03
- RiskRewardRatio: 2.0
- swingSize: 10
- trailingStopTrigger: 100
- trailingStopStep: 50
Example 2: Breakout Hypothesis on USDJPY
- Instrument: USDJPY
- Timeframe: H1
- Selected Strategy: Breakout (useBreakoutStrategy = true)
- Hypothesis: Major currency pairs can trend strongly after breaking significant structure. This setup is an example for such a scenario.
- Sample Parameters:
- riskPercent: 0.03
- RiskRewardRatio: 2.0
- swingSize: 10
- trailingStopTrigger: 100
- trailingStopStep: 50
Key Input Parameters
As per MQL5 Market rules, all parameter names and descriptions are in English.
Strategy & Order Management
- useReversalStrategy / useBreakoutStrategy: Set one to 'true' to enable the desired trading logic.
- magicNumber: A unique identifier for the EA's orders.
Zone & Structure Detection
- swingSize: The number of bars on each side to define a pivot point for zone creation.
- showZones: Toggles the visibility of the Supply/Demand zones on the chart.
Risk Management
- useAutoLot: Enables or disables automatic lot sizing.
- riskPercent: The risk percentage used for AutoLot calculation.
- lotSize: The fixed lot size used if useAutoLot is disabled.
- RiskRewardRatio: The multiplier for the Take Profit distance relative to the Stop Loss.
- maxStopLossPoints: The maximum allowed Stop Loss in points.
Position Management
- useTrailingStop: Enables or disables the trailing stop function.
- trailingStopTrigger: The profit in points at which the trailing stop activates.
- trailingStopStep: The step in points for the trailing stop adjustment.
Risk Warning
Trading Forex and CFDs involves a high level of risk and may not be suitable for all investors. Past performance is not an indicator of future results. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.
For product updates and support, please refer to my MQL5 seller profile: https://www.mql5.com/en/users/gedeegi/seller
