Gann Line Trading Expert Advisor
Info
The Gann Line Trading Expert Advisor is a Expert Advisor for MetaTrader 4 that this expert advisor (ea) draws a gann line on your chart and trades in the direction of the trend. It includes a trailing stop loss and take profit functionality.
Usage
This tool is typically used for automated trading on major forex pairs and gold.
Platform
This Expert Advisor works exclusively on MetaTrader 4 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL4/Experts folder via File ? Open Data Folder in MetaTrader 4.
How to Install and Use Gann Line Trading Expert Advisor
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
What this tool does
This Expert Advisor (EA) draws a Gann Line on your chart and trades in the direction of the trend.
Typical Use Case
This Expert Advisor excels in automated trading and technical analysis on MetaTrader 4.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 4. Place the file in the MQL4/Experts folder and restart the terminal.
Description & Settings
Related: Trade from Lines (e-tfl) - Advanced Line Trading Expert Advisor - another powerful expert for MetaTrader 4 traders.
This Expert Advisor (EA) draws a Gann Line on your chart and trades in the direction of the trend.Also recommended: Line Order Expert Advisor - similar expert with strong performance on MetaTrader 4.
It includes a trailing stop loss and take profit functionality.The EA is designed to work with all time frames and major forex pairs, as well as stocks and indices like Nasdaq.
It has been reported to perform well on the 1-hour time frame.
Please test thoroughly on a demo account before using with real funds.
Trading Logic:
The EA trades exclusively based on the price of the opening candle.
Lot Size Management:
To disable trading with an increasing lot size after a losing trade, set "increasefactor=0".
Combined Indicators:
This EA integrates a simple trading strategy with two moving averages and the Gann Line.
Gann Line Functionality:
You can configure the Gann Line to trade based on either the opening candle price or on every tick. This feature is active in live trading mode.
Testing vs. Live Trading:
During backtesting or optimization, moving averages are considered for trade generation. The Gann Line is visually displayed but not factored into trade creation during tests.
In live trading, both the Gann Line and moving averages work together to generate trades.
The Gann Line acts as a filter, which can increase the probability of winning trades.
Input Parameters:
Take Profit Settings:
- use_tp_in_money: Use Take Profit in monetary value (true/false).
- tp_in_money: Take Profit value in currency units (10-100).
- use_tp_in_percent: Use Take Profit in percentage (true/false).
- tp_in_percent: Take Profit value as a percentage (10-100).
Trailing Stop Loss (Money-Based for Multiple Trades):
- enable_trailing: Enable money-based trailing stop (true/false).
- Take Profit (current currency): Take Profit value (25-100).
- Stop Loss (current currency): Stop Loss value (1-20).
Gann Line Settings:
- gann line length (bars): The number of bars to consider for the Gann Line calculation (10-100).
- gann line color: The color of the Gann Line on the chart.
Risk Management:
- exit: Close trades if the trend is against you and to control drawdown (true/false).
- lots: Initial lot size (0.01-1).
- lots size exponent: Factor for increasing lot size (1.01-2).
- increasefactor: Amount to increase lot size from total margin after a loss (0.001-0.1).
- stop_loss: Stop Loss in pips (10-100). Set to 600 for multiple trades.
- magicnumber: Unique identifier for EA trades (1-100000).
- takeprofit: Take Profit in pips (10-100). Set to 600 for multiple trades.
Moving Average Settings:
- fastma: Period for the fast moving average (1-20).
- slowma: Period for the slow moving average (50-200).
Momentum Triggers:
- mom_sell: Momentum trigger for sell signals (0.1-0.9).
- mom_buy: Momentum trigger for buy signals (0.1-0.9).
Drawdown Control:
- useequitystop: Enable equity stop loss (true).
- totalequityrisk: Maximum equity risk percentage (0.01-20).
Trade Management:
- max_trades: Maximum number of open trades (1-12).
- fractalnum: Number of fractals to consider for high and low (2-10).
Single Trade Trailing Stop Settings (if max_trades = 1):
- usetrailingstop: Enable trailing stop (true/false).
- whentotrail: Activate trailing stop when profit reaches this value in pips (40-100).
- trailamount: The amount to trail the stop loss by in pips (40-100).
- distance from candle: Distance in pips from the candle when using candle-based trailing (1-100).
- usecandeltrail: Enable candle-based trailing stop (true/false).
- x: Number of candles to consider for candle trailing (1-100).
- usemovetobreakeven: Enable move-to-break-even functionality (true/false).
- whentomovetobe: Activate move-to-break-even when profit reaches this value in pips (1-30).
- pipstomovesl: Number of pips to move the stop loss to break even (1-30).
Optimization and Usage Notes:
- It is recommended to optimize the EA's inputs every few months.
- Use the exact same inputs from your successful backtests for live trading.
- This EA can be used as a hedging grid EA or as a single trade EA.
Backtesting Procedure:
To perform a backtest:
You may also like: Line Order Management Expert Advisor - excellent alternative for expert users on MetaTrader 4.
Source Code
/
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.