Ema-HeikenAsi-Expert
17 $
11 $
The CoreX G EA is an advanced trading system specifically designed to tackle the complexities of the Forex market. By leveraging cutting-edge neural networks, sophisticated machine learning technologies, and an integrated big data strategy, CoreX G delivers exceptional accuracy and security in trading.
Ema-Heiken Expert Advisor, Moving averages Forex
This code defines an Expert Advisor (EA) for trading in the MetaTrader 4 platform, specifically using the Heiken Ashi and moving averages to decide on buy or sell orders. Let’s break it down into its components and explain its key features.
Features of the EA:
1. Buy and Sell Signals Based on Technical Indicators:
The EA opens buy or sell positions based on two main indicators:
- Moving Averages (SMMA): The EA calculates two SMAs to detect the market trend.
- Heiken Ashi Candles: It checks the open and close of the Heiken Ashi candles to confirm buy or sell signals.
2. Angle-Based Trend Strength Detection:
The EA calculates the angle between two moving averages to determine the strength of the trend. A larger positive angle indicates a strong upward trend, while a negative angle indicates a downward trend.
3. Trailing Stop Feature:
The EA includes a trailing stop mechanism to lock in profits as the market moves in favor of the trade. This is controlled by the TrailingStart
and TrailingStep
parameters.
4. Customizable Parameters:
The EA allows the user to set:
- TakeProfit: The target profit level for the trade.
- StopLoss: The level at which the trade will be closed to limit loss.
- Lots: The number of lots to trade.
- TrailingStart and TrailingStep: Control how the trailing stop behaves.
These parameters can be customized in MetaTrader’s settings to fit the user’s trading preferences.
5. Unique Magic Number for Trade Management:
Each trade opened by the EA is assigned a unique magic number, which ensures that the EA only manages its own trades, avoiding interference with manual or other automated trades.
6. Order Size Management:
The EA checks the available margin before opening a trade to ensure that there is enough free margin to place the order, preventing over-leveraging.
7. Order Closing:
The EA includes functionality to close open positions either manually or automatically when the conditions are met. The close functions are tailored to sell and buy positions separately.
8. Market Orders Only:
The EA places market orders at the current price (Bid for sell, Ask for buy) and uses the current spread for opening and closing orders.
9. Error Handling and Logging:
It logs any errors that occur during the order placement process using Print()
. If an order fails to open, it displays an error message with the error code.
Conclusion:
This Expert Advisor is designed to trade based on the Heiken Ashi indicator and SMMA (Simple Moving Average) crossover, combined with an angle-based trend strength indicator. The trailing stop feature ensures that profits are locked in as the market moves favorably, while the customizable parameters allow for flexible risk management. It is suitable for users who want to automate trading with a trend-following strategy and risk management controls such as stop loss, take profit, and trailing stops.
Version | 1.00 |
---|---|
Type | Expert Advisor |
Compatibility | MT4 |
Trading Hours | All Times |
Custom Inputs | Lots, Trailing, Stop Loss, Take Profit, ECN |
Timeframes | M1 and M5 |
Strategy Type | Scalping,Trend Following |
Supported Pairs | ALL |
Risk Management | Auto stop at high loss, Trailing Stop |
Outputs | Automatic Buy/Sell |