An Expert Advisor that implements the LongTail trading strategy, designed to capitalize on trends while surviving ranging markets.
LongTail is a modified version of the Remora strategy that uses a 1:R reward system (where R > 1). The current implementation focuses on a 1:3 reward ratio.
- Dynamic grid-based trading system
- Automated recovery mechanism for ranging markets
- Daily session management capability
- Progression sequence for position sizing
- Advanced delay management for price gaps
The EA is organized into several key components:
-
Core Management
- Daily session control
- Position monitoring
- Strategy rule enforcement
-
Grid Management
- Exit position handling
- Recovery position placement
- Continuation order management
-
Risk Management
- Dynamic position sizing
- Progressive lot sequence
- Multiple validation checks
Key parameters that can be configured:
input bool use_daily_session = false; // Enable/disable daily sessions
input int multiplier = 3; // Reward multiplier
input int sequenceLength = 50; // Length of progression sequence
Default session times (when daily sessions enabled):
- Start: 08:30
- End: 18:30
- MetaTrader 5 Platform
- Account with appropriate broker permissions
- Sufficient margin for progression sequence
LongTail-Strategy/
├── Main/
│ └── LongTailsScalperV1.mq5 # Main EA entry point
├── Modules/
│ ├── ControlInterface/ # Core business logic
│ │ ├── SequenceHandler/ # Progression sequence management
│ │ ├── ProgressionCycleHandler/ # Trading cycle management
│ │ ├── GridStopsHandler/ # Stop orders management
│ │ ├── GridShiftHandler/ # Grid movement logic
│ │ └── ErrorCorrectionHandler/ # Error handling and rules
│ └── AuditInterface/ # Logging and monitoring
├── Abstract/ # Documentation and planning
└── Documentation.md
- Clone the repository to your local MetaEditor project directory
- Compile the main EA file (
LongTailsScalperV1.mq5) - Attach the EA to your desired chart in MetaTrader 5
- Primary focus is on XAU/USD with a grid spread of 40 points
- Can potentially be used with Volatility 75 and 75(1s)
- Requires careful monitoring during initial deployment
- Recommended to test thoroughly on a demo account first
- Slippage can affect order placement
- Spread variations may impact strategy performance
- Maximum range survival threshold is still under study
Current version: 1.73
Status: Under active development and testing
Copyright © 2025 Anyim Ossi
Contact: [email protected]