Allgain100
- Experts
- Nissar Ahmed
- Version: 1.0
- Activations: 5
Key Features
-
Strategy Core
-
EMA Crossover System:
-
Fast EMA (default: 20) and Slow EMA (default: 50)
-
Generates buy signals when Fast EMA crosses above Slow EMA.
-
Generates sell signals when Fast EMA crosses below Slow EMA.
-
-
Fibonacci Filter:
-
Calculates Fibonacci retrenchment levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) based on recent price swings.
-
Requires price to be near a Fibonacci level (configurable threshold) to validate trades.
-
-
-
Risk Management
-
Position Sizing: Dynamically calculates lot size based on account balance and user-defined risk percentage.
-
Stop Loss & Take Profit: Fixed in pips, adjusted for 5-digit brokers.
-
Single Position Rule: Avoids multiple entries by allowing only one active trade at a time.
-
-
User Configuration
-
Toggle trading on/off ( Enable Trading ).
-
Adjust EMA periods, Fibonacci look back, and risk parameters.
-
Enable/disable Fibonacci filtering ( UseFibFilter ).
-
Input Parameters
Group | Parameter | Description |
---|---|---|
Strategy Settings | EnableTrading | Enable/disable trading |
MagicNumber | Unique identifier for EA trades | |
RiskPercentage | Risk per trade (% of account balance) | |
EMA Settings | FastEMA | Period for faster EMA (e.g., 20) |
SlowEMA | Period for slower EMA (e.g., 50) | |
Fibonacci Settings | FibLookback | Bars analyzed for swing high/low (e.g., 100) |
FibThreshold | Max distance (pips) from Fib level to trade | |
UseFibFilter | Enable Fibonacci validation | |
Trade Settings | StopLoss | Stop loss in pips (e.g., 100) |
TakeProfit | Take profit in pips (e.g., 50) |
Workflow
-
Initialization ( OnInit ):
-
Validates EMA periods (ensures Fast < Slow).
-
Initializes EMA indicators and calculates PointMultiplier for broker digit adjustment.
-
Sets magic number for trade identification.
-
-
Tick Processing ( OnTick ):
-
Signal Generation:
-
Checks EMA crossover conditions using the latest two bars.
-
-
Fibonacci Validation:
-
Identifies recent swing high/low over FibLookback bars.
-
Computes Fibonacci levels and checks proximity to current price.
-
-
Trade Execution:
-
Calculates stop loss ( sl ), take profit ( tp ), and lot size.
-
Executes buy/sell orders only if no existing positions.
-
-
-
Risk Management:
-
CalculateLotSize() : Uses account balance, risk percentage, and stop loss to determine position size.
-
Converts pips to points for SL/TP using PointMultiplier .
-
Example Trade
-
Buy Signal:
-
Fast EMA (20) crosses above Slow EMA (50).
-
Current price is within 0.5 pips of the 61.8% Fibonacci level.
-
Lot size = (1% of $10,000 account) / (100 pips SL * tick value).
-
Order: Buy 0.15 lots, SL = entry - 100 pips, TP = entry + 50 pips.
-
Notes
-
Broker Compatibility: Handles 4/5-digit brokers via PointMultiplier .
-
Limitations:
-
No trailing stop or recovery mechanism.
-
Single-position logic may miss opportunities in trending markets.
-
-
Optimization: Consider adding trend filters (e.g., RSI) or modifying Fibonacci calculation logic for different market conditions.
This EA provides a systematic approach to trading EMA crossovers with Fibonacci confirmation, emphasizing controlled risk and parameter flexibility. Test thoroughly in a demo environment before live deployment.
How to Install Allagain100 ?
To install and use an Expert Advisor (ALLGAIN100) in MetaTrader 5 (MT5), follow these organized steps:
1. Install the ALLGAIN100
- Download the ALLGAIN100: Obtain the ALLGAIN100 file (typically a .ex5 compiled file or .mq5 source code).
- Locate the MT5 Folder:
- Open MT5, go to File > Open Data Folder.
- Navigate to MQL5 > Experts.
- Copy the ALLGAIN100 File:
- Place the .ex5 file into the Experts folder.
- For .mq5 files, compile it first:
- Open the .mq5 file in MetaEditor (press F4 in MT5).
- Click Compile (or press F7) to generate the .ex5 file.
2. Enable Automated Trading
- In MT5, click the Auto Trading button (or press Ctrl+E) on the toolbar to enable ALLGAIN100s.
3. Attach the ALLGAIN100 to a Chart
- Open the Navigator panel (Ctrl+N).
- Drag the ALLGAIN100 from the Expert Advisors list onto your desired chart.
- Configure settings (e.g., lot size, risk parameters) in the pop-up window.
- Ensure Allow Automated Trading is checked in the ALLGAIN100 settings.
4. Adjust Permissions
- Go to Tools > Options > Expert Advisors:
- Check Allow automated trading.
- Enable Allow DLL imports (if the ALLGAIN100 requires external libraries).
- Set Allow WebRequest if needed.
5. Test the ALLGAIN100
- Backtesting:
- Open the Strategy Tester (Ctrl+R).
- Select the ALLGAIN100, symbol, timeframe, and date range.
- Click Start to run historical tests.
- Forward Testing:
- Run the ALLGAIN100 on a live chart with Visual Mode in the Strategy Tester for rAllgain100l-time simulation.
6. Monitor Live Execution
- Keep the ALLGAIN100 attached to the chart for live trading.
- Check the Experts tab in the Toolbox (Ctrl+T) for logs/errors.
- Ensure your broker allows ALLGAIN100s and that your account has sufficient margin.
Troubleshooting Tips
- ALLGAIN100 Not AppAllgain100ring? Confirm the file is in MQL5/Experts (not MQL4).
- Compilation Errors: Fix code issues in .mq5 files using MetaEditor.
- Dependency Issues: Install required indicators (into MQL5/Indicators) or DLLs (into MQL5/Libraries).
- Broker Restrictions: Verify symbol names, execution modes, and trading hours align with your broker.
Key Considerations
- Test ALLGAIN100s thoroughly in a demo account before live use.
- Monitor performance during market volatility or news events.
- Ensure your VPS (if used) is reliable for 24/5 operation.
By following these steps, you can effectively automate your trading strategies in MT5.
------------------------------------- Best Of Profit Booking ------------------------------------