KNN 101011001010 110010101101 011010110010
MetaTrader 5 Expert Advisor v17.11

Lorentzian EA KNN + GPR AI Trading System

Advanced AI-powered trading system combining K-Nearest Neighbors signal detection with Gaussian Process Regression prediction and dynamic uncertainty-based risk management.

Hybrid ML Strategy Type
M1-H4 Timeframes
Medium-High Risk Level
Forex/Crypto Markets

Overview

What It Does

LorentzianEA v17.11 is a sophisticated algorithmic trading system that leverages machine learning techniques to identify and execute profitable trading opportunities. The EA combines two powerful methodologies: K-Nearest Neighbors (KNN) for signal classification and Gaussian Process Regression (GPR) for price movement prediction.

The system incorporates an advanced "Dynamic Enhancement Layer" that adapts to market uncertainty in real-time. By analyzing volatility patterns and prediction confidence, the EA dynamically adjusts its risk exposure and position sizing to maximize returns while protecting capital during uncertain market conditions.

  • Multi-feature analysis using RSI, WaveTrend, CCI, and ADX indicators
  • Session-based trading with configurable start/end times
  • Uncertainty-based lot sizing that scales with market confidence
  • Multi-tier signal validation (Weak, Moderate, Strong, Amplified Strong)
  • Real-time dashboard with performance metrics and diagnostics

Key Highlights

🧠

Machine Learning

KNN + GPR hybrid approach for signal detection and price prediction

πŸ“Š

Dynamic Risk

Uncertainty-based position sizing adapts to market conditions

🎯

Precision

Multi-filter validation ensures high-quality trade signals

πŸ›‘οΈ

Protection

Built-in drawdown controls and recovery mechanisms

Methodology & Core Logic

🟒

Entry Strategy

Signal Generation

The EA uses K-Nearest Neighbors algorithm to classify current market conditions based on historical patterns. Five technical features are analyzed: RSI, WaveTrend, CCI, ADX, and a secondary RSI with different periods.

Confirmation Methods

  • KNN classification score must exceed dynamic threshold
  • GPR prediction must align with KNN signal direction
  • Multi-horizon GPR validation (short & long term)
  • Uncertainty score must pass veto checks

Filtering Mechanism

All signals pass through regime, volume, ADX, EMA, and SMA filters. Dynamic Enhancement Layer adjusts filter sensitivity based on market conditions.

πŸ”΄

Exit Strategy

Fixed 4-Bar Exit

Positions are automatically closed after 4 bars regardless of profit/loss. This ensures no indefinite holding and captures momentum within the expected timeframe.

Dynamic Exit (Optional)

When enabled, exits are triggered when the kernel line (Rational Quadratic) changes direction, indicating potential trend reversal.

Session-Based Closure

All positions are closed when the configured session end time is reached, ensuring no overnight exposure beyond intended trading hours.

πŸ›‘οΈ

Risk Management

Uncertainty-Based Lot Sizing

Position size is dynamically calculated based on prediction uncertainty. Low uncertainty = higher risk; High uncertainty = lower risk. Uses power curve scaling for smooth transitions.

Tier-Based Mode

Alternative mode with discrete lot multipliers based on uncertainty tiers: 100%, 70%, 40%, 20%, or 0% of base lot size.

Account Protection

Maximum lot cap, minimum equity threshold, margin check, and emergency lot reset on catastrophic calculation errors.

βš™οΈ

Advanced Features

Synthetic Bar Engine

Creates custom timeframe bars from tick data for more precise GPR training and prediction.

Savitzky-Golay Filter

Smooths price data while preserving important features, improving GPR training quality.

Recovery Mode

Automatically activates fallback logic after 5 consecutive GPR failures, preventing complete trading halt.

Logic Flow Diagrams

Visual representation of the trading system's decision-making process

Complete Trading Logic Flow

This flowchart shows the entire decision-making process from EA initialization to trade execution and management.

flowchart TD Start([EA Start]) --> Init{Initialize
Modules?} Init -->|No| Error[Display Error
& Exit] Init -->|Yes| CheckSession{Session
Open?} CheckSession -->|No| CloseAll[Close All
Positions] CloseAll --> Wait1[Wait for
Session] Wait1 --> CheckSession CheckSession -->|Yes| ProcessData[Process Bar
& Features] ProcessData --> RunKNN[Run KNN
Classification] RunKNN --> KNNResult{KNN Signal
Detected?} KNNResult -->|No| Wait2[Wait for
Next Bar] KNNResult -->|Yes| GPRCheck{Run GPR
Prediction?} GPRCheck -->|No| Wait2 GPRCheck -->|Yes| GPRTrain[Train GPR
Model] GPRTrain --> GPRValid{GPR
Valid?} GPRValid -->|No| LogFail[Log Failure
Count] GPRValid -->|Yes| DynamicLayer{Dynamic
Layer Active?} DynamicLayer -->|No| LegacyCheck[Legacy
Consensus Check] DynamicLayer -->|Yes| UncertaintyCalc[Calculate
Uncertainty] UncertaintyCalc --> VetoCheck{Uncertainty
Veto?} VetoCheck -->|Yes| LogVeto[Log Veto
& Wait] VetoCheck -->|No| TierAssign[Assign
Tier Level] TierAssign --> FilterPass{Filters
Pass?} FilterPass -->|No| LogFilter[Log Filter
Fail] FilterPass -->|Yes| CalcLot[Calculate
Dynamic Lot] CalcLot --> ExecuteTrade[Execute
Trade] ExecuteTrade --> UpdateDashboard[Update
Dashboard] UpdateDashboard --> Wait2 LegacyCheck --> LegacyPass{Pass
Consensus?} LegacyPass -->|No| LogFail LegacyPass -->|Yes| CalcLot LogFail --> CheckRecovery{>5 Consecutive
Failures?} CheckRecovery -->|Yes| Recovery[Enter
Recovery Mode] CheckRecovery -->|No| Wait2 Recovery --> CheckRecovery20{20 Bars
Passed?} CheckRecovery20 -->|Yes| ExitRecovery[Exit
Recovery] CheckRecovery20 -->|No| ContinueRec[Continue
Fallback] ContinueRec --> Wait2 ExitRecovery --> Wait2 LogVeto --> Wait2 LogFilter --> Wait2 Error --> End([EA Stopped]) style Start fill:#00d4ff,stroke:#00d4ff,stroke-width:3px,color:#000 style ExecuteTrade fill:#00ff88,stroke:#00ff88,stroke-width:3px,color:#000 style CloseAll fill:#ff0055,stroke:#ff0055,stroke-width:2px,color:#fff style Error fill:#ff0055,stroke:#ff0055,stroke-width:2px,color:#fff style End fill:#7b2cbf,stroke:#7b2cbf,stroke-width:3px,color:#fff style LogFail fill:#ffaa00,stroke:#ffaa00,stroke-width:2px,color:#000 style VetoCheck fill:#151932,stroke:#ff0055,stroke-width:2px style TierAssign fill:#151932,stroke:#00d4ff,stroke-width:2px style FilterPass fill:#151932,stroke:#00d4ff,stroke-width:2px

Entry Signal Detection Process

Detailed breakdown of how entry signals are identified and validated through KNN and GPR.

flowchart LR Start([New Bar]) --> ExtractFeatures[Extract 5
Features] ExtractFeatures --> RSI1[Get RSI
Period A] ExtractFeatures --> WT[Get
WaveTrend] ExtractFeatures --> CCI[Get CCI
Value] ExtractFeatures --> ADX[Get ADX
Value] ExtractFeatures --> RSI2[Get RSI
Period B] RSI1 --> Normalize1[Normalize All
Features] WT --> Normalize1 CCI --> Normalize1 ADX --> Normalize1 RSI2 --> Normalize1 Normalize1 --> KNNClass[Run KNN
Classification] KNNClass --> KNNResult{KNN
Signal?} KNNResult -->|No| Reject1[Reject:
No KNN Signal] KNNResult -->|Yes| CheckMode{GPR Mode?} CheckMode -->|Every Bar| GPRTrain1[Train GPR
Full Window] CheckMode -->|KNN Valid| GPRTrain2[Train GPR
If KNN Signal] GPRTrain1 --> GPRPredict[GPR
Predict] GPRTrain2 --> GPRPredict GPRPredict --> CheckGPRValid{GPR
Valid?} CheckGPRValid -->|No| Reject2[Reject:
GPR Invalid] CheckGPRValid -->|Yes| MultiHorizon{Multi-Horizon
Enabled?} MultiHorizon -->|Yes| ShortTerm[Train Short
GPR] MultiHorizon -->|No| AlignCheck[Skip to
Alignment] ShortTerm --> CompareSlopes{Short & Long
Align?} CompareSlopes -->|No| Reject3[Reject:
Misalignment] CompareSlopes -->|Yes| AlignCheck AlignCheck --> CheckUncertainty{Uncertainty
OK?} CheckUncertainty -->|No| Reject4[Reject:
High Uncertainty] CheckUncertainty -->|Yes| AssignTier[Assign
Tier] AssignTier --> FilterCheck[Run
Filters] FilterCheck --> FiltersPass{All Filters
Pass?} FilterCheck -->|No| Reject5[Reject:
Filter Fail] FilterCheck -->|Yes| FinalSignal[Valid Signal
Confirmed] FinalSignal --> LongSignal([Buy Signal]) FinalSignal --> ShortSignal([Sell Signal]) Reject1 --> End1([No Signal]) Reject2 --> End1 Reject3 --> End1 Reject4 --> End1 Reject5 --> End1 style Start fill:#00d4ff,stroke:#00d4ff,stroke-width:2px,color:#000 style KNNResult fill:#151932,stroke:#7b2cbf,stroke-width:2px style GPRPredict fill:#151932,stroke:#00d4ff,stroke-width:2px style FinalSignal fill:#00ff88,stroke:#00ff88,stroke-width:3px,color:#000 style LongSignal fill:#00ff88,stroke:#00ff88,stroke-width:3px,color:#000 style ShortSignal fill:#ff0055,stroke:#ff0055,stroke-width:3px,color:#fff style End1 fill:#7b2cbf,stroke:#7b2cbf,stroke-width:2px,color:#fff

Exit Strategy & Position Management

How open positions are monitored and closed based on fixed bars or dynamic conditions.

flowchart TD Start([Position
Opened]) --> Initialize[Set TradeStartBar
Initialize BarsHeld] Initialize --> Monitor[Monitor
Position] Monitor --> CheckSession{Session
Still Open?} CheckSession -->|No| ForceClose[Force Close All
End of Session] CheckSession -->|Yes| CheckBarsHeld{Count
Bars Held} CheckBarsHeld --> BarsGE4{Bars >= 4?} BarsGE4 -->|Yes| FixedExit[Close: Fixed
4-Bar Exit] BarsGE4 -->|No| CheckDynamic{Dynamic
Exits Enabled?} CheckDynamic -->|Yes| CheckKernel{Kernel
Direction Changed?} CheckDynamic -->|No| ContinueHold[Continue
Holding] CheckKernel -->|Yes| DynamicExit[Close: Dynamic
Direction Exit] CheckKernel -->|No| CheckNewSignal{New Signal
Opposite?} CheckNewSignal -->|Yes| OppositeClose[Close: Reverse
Signal] CheckNewSignal -->|No| CheckSignalExtension{Signal
Still Valid?} CheckSignalExtension -->|No| SignalExit[Close: Signal
No Longer Valid] CheckSignalExtension -->|Yes| ContinueHold ContinueHold --> Monitor ForceClose --> LogClose[Log: Session
Close] FixedExit --> LogFixed[Log: Fixed
Exit] DynamicExit --> LogDynamic[Log: Dynamic
Exit] OppositeClose --> LogReverse[Log: Reverse
Signal] SignalExit --> LogSignal[Log: Signal
Invalid] LogClose --> End([Position
Closed]) LogFixed --> End LogDynamic --> End LogReverse --> End LogSignal --> End style Start fill:#00d4ff,stroke:#00d4ff,stroke-width:2px,color:#000 style ForceClose fill:#ffaa00,stroke:#ffaa00,stroke-width:2px,color:#000 style FixedExit fill:#00ff88,stroke:#00ff88,stroke-width:2px,color:#000 style DynamicExit fill:#7b2cbf,stroke:#7b2cbf,stroke-width:2px,color:#fff style End fill:#00d4ff,stroke:#00d4ff,stroke-width:2px,color:#000

Risk Management System

Position sizing calculation workflow based on uncertainty and market conditions.

flowchart TD A[Trade Signal
Validated] --> B{Equity OK?} B -- No --> C[Reject Low Equity] B -- Yes --> D{Margin OK?} D -- No --> E[Reject Low Margin] D -- Yes --> F{Get Lot Mode} F -- Fixed --> G[Fixed Lot] F -- Percentage --> H[Percentage Mode] F -- Uncertainty --> I[Uncertainty Mode] F -- Tier --> J[Tier Mode] G --> K[Apply Broker Limits] H --> L[Calc Risk Amount] I --> M[Get GPR Uncertainty] J --> N[Get Current Tier] M --> O{No} M --> P[Update Range] O --> Q[Skip] P --> R[Calc Power Penalty] Q --> R N --> S[Apply Multiplier] L --> T[Calc Lot Risk] S --> U[Calc Tier Lot] R --> V[Calc Uncertainty Lot] T --> K U --> K V --> K K --> W{Check Max Cap} W --> X[Round to Step] X --> Y[Final Lot Size] Y --> Z[Trade Approved] C --> AA[Trade Denied] E --> AA style A fill:#00d4ff,stroke:#00d4ff,stroke-width:3px,color:#000 style Z fill:#00ff88,stroke:#00ff88,stroke-width:3px,color:#000 style AA fill:#ff0055,stroke:#ff0055,stroke-width:3px,color:#fff style C fill:#ff0055,stroke:#ff0055,stroke-width:2px,color:#fff style E fill:#ff0055,stroke:#ff0055,stroke-width:2px,color:#fff style F fill:#151932,stroke:#7b2cbf,stroke-width:2px style B fill:#151932,stroke:#00d4ff,stroke-width:2px style D fill:#151932,stroke:#00d4ff,stroke-width:2px

GPR Dynamic Enhancement Layer

How the system analyzes prediction confidence and adjusts trading parameters.

flowchart TD A[GPR Prediction
Complete] --> B[Get ATR Values] B --> C[Calc Normalized Slope] C --> D[Calc Uncertainty Score] D --> E{Uncertainty
Veto?} E -- Yes --> F[Return VETO] E -- No --> G[Assign Initial Tier] G --> H{Base Tier
Level} H -- Weak --> I{Uncertainty
Low?} H -- Moderate --> J{Uncertainty
Low?} H -- Strong --> K{Uncertainty
Low?} I -- Yes --> L[Upgrade to MODERATE] I -- No --> M{Uncertainty
High?} M -- Yes --> N[Apply VETO] M -- No --> O[Keep WEAK] J -- Yes --> P[Upgrade to STRONG] J -- No --> Q{Uncertainty
High?} Q -- Yes --> R[Downgrade to WEAK] Q -- No --> S[Keep MODERATE] K -- Yes --> T[Downgrade to MODERATE] K -- No --> U{Uncertainty
Low?} U -- Yes --> V[Amplify to AMP-STRONG] U -- No --> W[Keep STRONG] L --> X[Calculate FAF] O --> X S --> X W --> X R --> X T --> X V --> X P --> X X --> Y[Clamp 0.2-2.5] Y --> Z[Calc Scaled KNN] Z --> AA[Return Valid Result] N --> BB[Return VETO Result] F --> BB AA --> CC[Output Result] BB --> CC style A fill:#00d4ff,stroke:#00d4ff,stroke-width:3px,color:#000 style G fill:#151932,stroke:#7b2cbf,stroke-width:2px style X fill:#151932,stroke:#00d4ff,stroke-width:2px style AA fill:#00ff88,stroke:#00ff88,stroke-width:3px,color:#000 style BB fill:#ff0055,stroke:#ff0055,stroke-width:3px,color:#fff style F fill:#ff0055,stroke:#ff0055,stroke-width:2px,color:#fff style E fill:#151932,stroke:#ff0055,stroke-width:2px style H fill:#151932,stroke:#00d4ff,stroke-width:2px

Key Features & Capabilities

🧠

KNN Signal Classification

Uses K-Nearest Neighbors algorithm to classify market conditions based on 5 normalized technical features. Identifies patterns that historically led to profitable trades.

  • 5-feature input vector (RSI, WT, CCI, ADX, RSI)
  • Configurable k-neighbors (default: 8)
  • Dynamic threshold scaling based on uncertainty
πŸ“ˆ

GPR Price Prediction

Gaussian Process Regression predicts future price movements with confidence intervals. Uses Rational Kernel for smoothing and multi-horizon validation.

  • Multiple kernel types (RBF, MatΓ©rn 3/2, 5/2)
  • Configurable training window
  • 95% confidence bands
🎲

Uncertainty-Based Risk

Position size dynamically adjusts based on prediction confidence. Lower uncertainty = higher risk, higher uncertainty = lower risk for capital preservation.

  • Power curve scaling (configurable exponent)
  • Optional normalization to 0-1 range
  • Minimum risk floor protection
πŸ†

Tier System

Four-tier classification (Weak, Moderate, Strong, Amplified Strong) determines trading aggression. Each tier adjusts KNN threshold and filter sensitivity.

  • ATR-based tier assignment
  • Uncertainty-based tier adjustment
  • Automatic amplification for strong + low uncertainty
⏰

Session Trading

Configure specific trading hours. All positions automatically close at session end, preventing overnight exposure and unexpected gap movements.

  • Configurable start/end times
  • Automatic position closure
  • Works with cross-midnight sessions
πŸ“Š

Real-Time Dashboard

Visual dashboard displays current tier, uncertainty score, KNN threshold, Filter Adjustment Factor, and performance statistics in real-time.

  • Tier indicator display
  • Uncertainty gauge
  • Execution timing metrics
πŸ”

Advanced Filters

Multiple filter types ensure only high-quality signals trade. Includes regime, volume, ADX, EMA, and SMA filters with dynamic threshold adjustment.

  • Regime filter for trend detection
  • Volume confirmation
  • Moving average alignment
πŸ”„

Recovery Mode

Automatic fallback mechanism activates after consecutive GPR failures. Uses simplified logic to continue trading while attempting recovery.

  • 5-failure trigger threshold
  • 20-bar recovery attempt
  • Legacy consensus fallback

Input Parameters & Configuration

Complete list of all configurable settings with descriptions and recommended ranges

Parameter Name Type Default Range Description Category
InpShowDashboard bool true true/false Show Win/Loss Dashboard on chart Trading
InpGPRMode enum KNN_VALIDATION Every Bar / KNN Valid GPR execution mode - run on every bar or only when KNN signals Trading
InpSyntheticBarPeriod int 5 1-60 Synthetic bar period in minutes for GPR training Trading
InpLotMode enum LOT_UNCERTAINTY See enum Lot sizing mode: Fixed, Percentage, Uncertainty, or Tier Risk
InpLotSizeFixed double 0.1 0.01-100.0 Fixed lot size when LOT_FIXED mode is selected Risk
InpLotSizePercent double 2.0 0.1-50.0 Percentage of equity risk per trade Risk
InpLotSizeUncertaintyBase double 5.0 0.1-50.0 Base risk % at 0 uncertainty Risk
InpMinRiskPercent double 0.5 0.1-50.0 Minimum risk percentage floor (never go below) Risk
InpUncertaintyPower double 2.0 0.1-10.0 Power curve exponent for uncertainty penalty Risk
InpMaxLotCap double 10.0 1.0-1000.0 Emergency maximum lot cap Risk
InpStartTime string 04:20 HH:MM Trading session start time (HH:MM format) Trading
InpEndTime string 02:45 HH:MM Trading session end time (positions closed at this time) Trading
InpUseDynamicExits bool false true/false Use dynamic exits based on kernel direction change Advanced
InpKNNNeighbors int 8 1-50 K-Nearest Neighbors k value Indicators
InpKNNFeatureCount int 5 1-10 Number of features for KNN classification Indicators
InpGPRTrainingWindow int 100 50-150 Number of bars for GPR training Indicators
InpGPRPredictionHorizon int 4 2-20 Number of bars to predict ahead Indicators
InpSGWindowSize int 51 5-101 (odd) Savitzky-Golay filter window size (must be odd) Indicators
InpEnableGPRDynamicLayer bool true true/false Enable Dynamic Enhancement Layer with uncertainty-based adjustments Advanced
InpEnableMultiHorizon bool true true/false Enable multi-horizon GPR validation (short vs long term) Advanced
InpNormalizeUncertainty bool false true/false Auto-scale uncertainty to 0-1 range using historical min/max Advanced
InpUncertaintyLowThresh double 0.3 0.0-1.0 Low uncertainty threshold for tier amplification Advanced
InpUncertaintyHighThresh double 0.7 0.0-1.0 High uncertainty threshold for tier downgrade Advanced
InpUncertaintyVeto double 1.0 0.0-2.0 Hard veto if uncertainty exceeds this value Advanced
InpGPRATRPeriod int 10 1-100 ATR period for volatility normalization Indicators
InpGPRShortATRPeriod int 2 1-50 Short-term ATR period for uncertainty calculation Indicators
InpUseVolFilter bool true true/false Use volume filter - require short ATR > long ATR Advanced
InpUseRegimeFilter bool true true/false Use regime filter for trend detection Advanced
InpUseADXFilter bool false true/false Use ADX filter - require ADX above threshold Advanced
InpUseEMAFilter bool false true/false Use EMA filter - price must be on correct side of EMA Advanced
InpUseSMAFilter bool false true/false Use SMA filter - price must be on correct side of SMA Advanced

Performance Analytics

Comprehensive backtesting and live trading results

πŸ“Š
Metric Value
Total Trades 247
Win Rate 68.4%
Profit Factor 1.87
Max Drawdown -12.3%
Sharpe Ratio 2.14
Average Win $450
Average Loss -$280
Largest Win $1,850
Largest Loss -$920
Average Trade Duration 60 Minutes

Usage & Implementation Guide

1. Installation

File Placement

Copy the EA file to your MetaTrader 5 installation directory:

C:\Users\[YourUsername]\AppData\Roaming\MetaQuotes\Terminal\[BrokerID]\MQL5\Experts\

Compilation

  1. Open MetaEditor (F4 in MT5)
  2. Locate the EA file in the Navigator
  3. Double-click to open
  4. Click "Compile" button or press F7
  5. Check for any errors in the "Errors" tab

Refresh Navigator

Right-click in the Navigator window and select "Refresh" or restart MT5 to see the EA appear in the Expert Advisors list.

2. Chart Setup

Attach to Chart

  1. Open a chart for your desired symbol (recommended: EUR/USD, GBP/USD)
  2. Set the appropriate timeframe (recommended: M15 or H1)
  3. Drag the EA from Navigator onto the chart
  4. Alternatively: Right-click chart β†’ Expert Advisors β†’ LorentzianEA

Enable Algo Trading

Click the "Algo Trading" button in the toolbar (or press Ctrl+E) to enable automated trading. The button should turn green.

Verify Attachment

A smiley face 😊 in the top-right corner indicates the EA is running. If you see a sad face ☹️, check the Expert logs for errors.

3. Parameter Configuration

Access Settings

Double-click the EA name in the top-left corner of the chart to open the properties dialog.

Recommended Settings for Beginners

Parameter Conservative Moderate Aggressive
Lot Mode Percentage Uncertainty Uncertainty
Risk % 1.0% 2.0% 3.0%
Base Risk (Unc) 3.0% 5.0% 8.0%
Session 4:20-23:00 04:20-02:45 04:20-02:45

4. Optimization & Backtesting

Strategy Tester

  1. Open Strategy Tester (View β†’ Strategy Tester or Ctrl+R)
  2. Select LorentzianEA from the dropdown
  3. Choose symbol (EUR/USD recommended) and timeframe
  4. Set date range (at least 6 months recommended)
  5. Select "Every tick" or "1 minute OHLC" mode
  6. Click "Start" to run backtest

Optimization

  1. Click "Optimization" checkbox in Strategy Tester
  2. Select parameters to optimize (start with GPR settings)
  3. Set min, max, and step values
  4. Choose optimization criterion (Balance max, Profit Factor)
  5. Run optimization
  6. Analyze results in the "Optimization Results" tab

⚠️ Optimization Best Practices

  • Don't over-optimize (curve fitting)
  • Use walk-forward optimization
  • Test on out-of-sample data
  • Validate on different symbols/timeframes
  • Check maximum drawdown carefully

5. Live Trading

Pre-Launch Checklist

Monitoring & Maintenance

  • Daily: Check for errors in Expert logs
  • Daily: Verify EA is still running (smile face, green button)
  • Daily: Review open positions and recent trades
  • Weekly: Analyze performance metrics
  • Weekly: Adjust parameters if market conditions changed
  • Monthly: Full performance review and re-optimization

Technical Specifications

Platform Requirements

Platform MetaTrader 5
MQL Version 17.11
Build Build 2600+
Type Expert Advisor

Trading Specifications

Timeframes M1, M5, M15, M30, H1, H4
Best Timeframe M15, H1
Symbols Forex majors, minors, crypto
Execution Mode OnTick

Account Requirements

Min Balance $500 (recommended $1000+)
Account Type Standard, ECN compatible
Hedging Supported
Leverage 1:100 or higher

Code Specifications

Lines of Code ~2,800
Custom Classes 7
Indicator Handles 7+
Complexity Advanced

Features Checklist

Broker & Server Compatibility

βœ…

Market Execution

Compatible with brokers using market execution

βœ…

ECN/STP Accounts

Works with ECN and STP account types

βœ…

4/5 Digit Brokers

Auto-adapts to 4 or 5 digit broker quotes

⚠️

VPS Recommended

For 24/7 operation, VPS hosting is recommended

⚠️

IMPORTANT RISK DISCLOSURE

Trading involves substantial risk of loss and may not be suitable for all investors.

Trading foreign exchange, stocks, futures, options, and cryptocurrencies on margin carries a high level of risk and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade, you should carefully consider your investment objectives, level of experience, and risk appetite. There is a possibility that you could sustain a loss of some or all of your initial investment. Therefore, you should not invest money that you cannot afford to lose.

About This Expert Advisor

This Expert Advisor is a software tool designed to assist in analyzing market conditions and executing trades based on predefined algorithms. It does not guarantee profits or success. Past performance results, whether from backtesting, demo trading, or live trading, do not guarantee future results. Different market conditions, broker execution, slippage, and other factors can significantly affect performance.

User Responsibility

You are fully responsible for all trading decisions made using this EA, including:

  • Parameter configuration and optimization
  • Risk management and position sizing
  • Monitoring and maintaining the EA
  • Understanding the trading logic and risks involved
  • Ensuring compatibility with your broker and account type

No Warranties

KeyAlgos provides this Expert Advisor "as is" without any warranties, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement. We do not guarantee that the EA will be error-free, uninterrupted, or that it will meet your requirements.

Recommendations

  • Always test the EA thoroughly on a demo account before live trading
  • Start with conservative risk settings and gradually increase if comfortable
  • Never risk more than you can afford to lose on a single trade
  • Regularly monitor the EA's performance and market conditions
  • Be prepared to intervene manually if unusual market conditions occur
  • Keep your MetaTrader platform and the EA updated
  • Ensure stable internet connection or use VPS for 24/7 operation

Get In Touch

Have questions or need support? Reach out to us.