ScalpEA v2

I am happy that you are here, let me introduce my small miracle.

At first, bot was created for XAUUSD pair. It could be used / trained for whatever you like, but at your own risk!

It all started as an experiment after one developer here told me that doing these modifications would be too complicated. So I told him ok.

My knowledge of MQL5 was close to zero so I thought how about to try some AI. 

Writing this bot started on ChatGPT5, it was complicated but after some time it ended up with compilable code.

On the way I have even tried Gemini but it was a disaster.. at the end I have ended at Claude and that bot is amazing and able to produce compilable code.


Now let me introduce what my EA does.

What it does:

  1. Trades FVG in both diorections.
  2. Have machine learning options.
  3. Have trailing TP or my Hybrid TP that contains Trailing SL
  4. Have option to trade bearish FVG with different setting tha Bullish ones,
  5. With my settings it trades with 98% winrate since 10/2023 (gold started to be more bullish)

Btw all my real accounts are running ScalpEA v2, you can find them on my myfxbook where my name is MartinSMGcz.
I have there even v1 but it was not that good.
Also, do not use default config, it is not that good than configs provided on the blog post.

This writng is not for me so I let AI to generate some description. Btw, I might be running too aggressive configurations but when it works, why not? When fail comes, recovery time is about 14 days so again, why not?

I am not selling this bot right after finishing the code but after 3 months of testing on multiple live accounts. (not a cent one)

Make your own backtests and feel free to share your opinions or configs for different instruments. I am sorry in advance if I will not be responding fast. And remember not to risk money you cannot lose. Since december I did not have a single losing trade but it could come.

It is really broker dependent and lower the spread the better. I have tested it on Purple trading, Vantage and VT. VT performs the best, Vantage is on the second place and last is Purple trading.

I am selling it as my one and only bot I am using. So hate it or love it, it is up to you now.
Test it before buying it, so you know if it fits your needs.

I have read that there should be some blog option to add description and links to download set files, I will do it as soon as possible.
Some additonal info and configs here
Channel where to discuss and share your ideas

I have put a lot of functions to my EA, but et the end I am not using most of them, such as recovery system, it could increase the prosit same as the loss, third candle confirmation function is nice, but it limits number of detected FVG and etc.

Since bot is looking for FVG and trading them we are not affected by these long falls that gold does sometimes as you can see on images.

I recommend having lot sizes 0,01 lot on each 500 EUR of your balance but it is your choice on how much you want to risk, but again, do not risk a lot please.


Here is promised description of my EA by AI:

SCALPEA V2 - EXPERT ADVISOR DESCRIPTION FOR MQL5


OVERVIEW

ScalpEA V2 is an advanced Fair Value Gap (FVG) scalping Expert Advisor for XAUUSD and similar instruments. 

Combines FVG detection, machine learning filtering, and three take profit management strategies.


CORE FEATURES


1. FVG DETECTION SYSTEM

- Identifies Fair Value Gaps in price action

- Detection window: 240 minutes (configurable)

- Minimum gap size (points): 30 (user parameter)

- Maximum gap size: Optional exhaustion protection

- FVG duration limit (minutes): 240 before expiration

- Third candle confirmation: Optional validation


2. MACHINE LEARNING FUNCTIONS


A) ADAPTIVE CONFIDENCE SCORING

- Records all trade outcomes to CSV file

- Calculates win rate from historical FVG trades

- Auto-adjusts confidence threshold (0.50 to 0.85)

- Learning mode: Allows unprofitable trades for data

- Minimum 50 historical trades before activation


B) OFFLINE DATABASE MODEL

- Loads historical FVG patterns from CSV

- Matches incoming FVGs by size and direction

- Assigns confidence scores to opportunities

- Default score threshold: 0.75

- Gap tolerance: 25% size variance


C) AI LEARNING MODE

- Trades all FVGs regardless of confidence

- Actively collects market data

- Improves accuracy continuously


3. TAKE PROFIT MANAGEMENT - THREE MODES


MODE 1: FIXED TAKE PROFIT

- Parameter: TP distance (points) 

- Default: 300 points

- Advantage: Simple, predictable

- Use case: Scalping strategies


MODE 2: TRAILING TAKE PROFIT

- Trailing activation (points): Profit needed before activation (default 50)

- Trailing distance (points): Distance maintained from current price (default 200)

- Behavior: Moves only in profit direction

- Benefit: Captures extended moves

- Update trigger: 2+ points price movement


MODE 3: EXPERIMENTAL (TRAILING STOP LOSS)

- Experimental activation (points): Distance from TP (default 50)

- Experimental trailing SL (points): Distance from price (default 200)

- Minimal profit lock (points): Minimum profit guarantee (default 20)

- Purpose: Capital protection near TP

- Mechanism: Progressive SL tightening


4. STOP LOSS STRATEGIES

- Global SL distance (points): Default 3000 points

- SELL-specific SL distance (points): Optional separate SL for shorts

- Respects broker STOPS_LEVEL requirements

- Recovery: Copies parent SL for consistency


5. RECOVERY SYSTEM

- Master switch: Use recovery system (ON/OFF)

- Activation distance (points): Drawdown threshold (default 400)

- Lot multiplier: Size increase per level (default 1.4x)

- Max recovery levels: Position count limit (default 3)

- TP strategy: Copy parent or calculate new


Mechanics:

- Triggers at specified drawdown

- Opens additional position with larger lot

- Uses parent SL for risk consistency

- All positions close together


6. DIRECTIONAL CONTROL


SELL-SPECIFIC SETTINGS (Optional)

- SELL TP distance (points): Short-only TP distance

- SELL SL distance (points): Short-only SL distance

- SELL risk % override: Separate risk per trade

- SELL max pendings: Separate order limit


SELL GAP FILTERS

- Require bigger gap: Multiplier applied (default 1.7x)

- Max gap size (points): Exhaustion limit (default 250)

- Fixed min gap: Absolute minimum option


7. MONEY MANAGEMENT


STATIC LOT SIZING

- Lot size: Fixed amount (default 0.01)

- Simple approach


DYNAMIC LOT SIZING

- Use dynamic lot sizing: Enable/disable

- Risk per trade (%): Percentage of balance (default 0.5%)

- Calculation: Lot = (Balance x Risk%) / (SL points x Point Value)

- Auto-respects symbol constraints


8. ORDER PLACEMENT

- Entry offset (points): Distance from FVG level (default 2)

- Max FVG per side: Pending order limit (default 5)

- Max distance from price (points): Entry validation (default 2000)

- Max spread (points): Trading prohibition threshold

- FIFO system: Auto-removes oldest when limit reached

- Order duration: 240 minutes before expiration


9. VISUAL INTERFACE


ON-CHART DASHBOARD

- Current balance and equity display

- Floating profit/loss on positions

- Total EA profit (accurate with swap/commission)

- Win rate from trade history

- Pending order count per direction

- Next lot size calculation

- TP mode indicator (Fixed/Trailing/Experimental)

- Configuration name display

- Last update timestamp


FVG VISUALIZATION

- Bullish FVGs: Blue rectangles

- Bearish FVGs: Red rectangles

- Transparency: 0-255 adjustable

- Size labels: Optional display

- Auto-cleanup: Removes old FVGs

- Active filter: Show only tradeable FVGs


10. ADVANCED FEATURES


POSITION TRACKING

- Records all pending orders

- Links orders to positions at fill

- Stores historical outcomes

- Connects recovery to parent

- Auto-cleanup after 24 hours


FAILED ORDER RECOVERY

- Saves failed order parameters

- Auto-retries on market open

- Prevents FVG time expiration

- Complete failure logging


SPREAD & LIQUIDITY

- Maximum spread enforcement

- Auto-detection per symbol

- Critical bypass for maintenance

- Liquidity warnings


DEBUGGING & LOGGING

- Trade entry/exit logging

- FVG detection details

- AI decision tracking

- Order attempt recording

- Recovery position tracking

- Win/loss statistics


CRITICAL PARAMETERS FOR SETUP


Optimization priority:

1. Max FVG per side: Pending order limit

2. Min gap points (global): Minimum FVG to trade

3. TP distance (points): Profit target in points

4. SL distance (points): Maximum loss in points

5. Risk per trade (%): Account risk percentage


Machine Learning:

1. Use AI Filter: Enable/disable

2. Use offline model: Database filtering

3. Min history events: Data threshold (50+)

4. Use adaptive confidence: Dynamic threshold

5. AI Learning mode: Allow unprofitable trades


Trailing Mechanics:

1. TP mode: 0=Fixed, 1=Trailing, 2=Experimental

2. Trailing activation (points): Profit before start

3. Trailing distance (points): Distance from price

4. Experimental activation (points): TP proximity

5. Experimental trailing SL (points): SL distance


Recovery System:

1. Use recovery system: Master enable

2. Activation distance (points): Drawdown trigger

3. Lot multiplier: Size multiplication factor

4. Max recovery levels: Position limit

5. Copy TP from parent: TP strategy choice


RECOMMENDED CONFIGURATIONS


AGGRESSIVE SCALPING

- Min gap: 30 points

- TP: 300 points (Fixed mode)

- SL: 3000 points

- Dynamic lot: 0.5% risk

- AI: Enabled

- Recovery: Disabled


BALANCED APPROACH

- Min gap: 50 points

- TP: 300 points (Trailing, 50pt activation)

- SL: 600 points

- Dynamic lot: 0.5-1.0% risk

- AI: Enabled

- Recovery: Enabled (1.4x, 2 levels)


CONSERVATIVE

- Min gap: 80 points

- TP: 200 points (Trailing, 100pt activation)

- SL: 800 points

- Dynamic lot: 0.25% risk

- AI: Enabled (strict)

- Recovery: Disabled


TREND FOLLOWING

- Min gap: 40 points

- TP: Variable (Experimental, 50pt activation)

- SL: 1000 points

- Dynamic lot: 0.3% risk

- AI: Enabled (learning)

- Recovery: Disabled


INSTALLATION


1. Save ScalpEA_V2.mq5 in Experts folder

2. Compile in MetaEditor (F5)

3. Attach to chart (XAUUSD recommended)

4. Configure parameters

5. Backtest thoroughly

6. Monitor dashboard

7. Optimize based on results


KNOWN LIMITATIONS


- Historical data detection only (no real-time MTF)

- ML requires 50+ trades for accuracy

- Recovery needs sufficient margin

- Offline DB needs manual updates

- High spread prevents execution

- News spikes may bypass filters


VERSION 2.635


Recent additions:

- Recovery system for averaging

- Failed order retry mechanism

- Adaptive confidence scoring

- Experimental TP with trailing SL

- FIFO order management

- Real-time profit dashboard

- Enhanced logging


USAGE NOTES


Designed for advanced traders with FVG knowledge.

Requires proper risk management discipline.

Extensive backtesting before live deployment.

Monitor recovery system closely for risk.


Фильтр:
Нет отзывов
Ответ на отзыв