• Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)

New EA MathQuant 1.6

ManOneBillion

Member
Credit Hunter
Credits
38
Saya sedang mengembangkan EA Quant untuk MT5, khususnya XAUUSD. EA ini menggabungkan beberapa perhitungan matematika untuk menentukan kondisi pasar, arah transaksi, entry, SL, TP, dan ukuran lot.

Komponen utama:

Momentum

Mengukur kekuatan dan arah pergerakan harga.

Z-Score
Mendeteksi pullback atau penyimpangan harga dari nilai rata-ratanya.

Linear Regression
Menentukan arah dan kekuatan tren secara objektif.

ATR
Menyesuaikan jarak SL dengan volatilitas pasar.

Risk-Based Lot
Menghitung lot berdasarkan persentase risiko terhadap equity.

Expectancy
Mengevaluasi peluang strategi berdasarkan win rate dan risk-reward. Expectancy sementara tidak dijadikan filter wajib karena dapat menyebabkan entry terlalu jarang jika probabilitasnya belum dikalibrasi dengan sampel yang cukup.

Kondisi pasar:

  • Trend: mencari entry mengikuti tren setelah pullback.
  • Range: mencari mean-reversion dari Z-Score ekstrem.
  • Neutral: tidak melakukan entry sampai kondisi pasar lebih jelas.
Struktur timeframe:

  • H4: mendeteksi regime, momentum, dan arah tren.
  • M15: mendeteksi pullback menggunakan Z-Score.
  • M15: candle recovery sebagai trigger entry.
Syarat BUY:

  • Regime pasar sedang trend.
  • Momentum dan regression H4 mengarah naik.
  • Terjadi Z-Score negatif atau pullback dalam beberapa candle M15 terakhir.
  • Muncul candle bullish sebagai tanda recovery.
  • Spread dan volatilitas masih dalam batas aman.
Syarat SELL:

  • Regime pasar sedang trend.
  • Momentum dan regression H4 mengarah turun.
  • Terjadi Z-Score positif atau pullback dalam beberapa candle M15 terakhir.
  • Muncul candle bearish sebagai tanda recovery.
  • Spread dan volatilitas masih dalam batas aman.
Manajemen risiko:

  • Risiko normal: 0,5% per transaksi.
  • Risiko saat volatilitas tinggi: 0,25%.
  • SL normal: sekitar 1,5 ATR.
  • SL saat volatilitas tinggi: sekitar 1,8 ATR.
  • Target trend: sekitar RR 1:2.
  • Target range: sekitar RR 1:1,3.
  • Maksimum dua transaksi loss per hari.
  • Satu posisi aktif per simbol.
Channel Indicator + EA gratis : t.me/forexbotlab
 

Attachments

Last edited:
I'm developing EA Quant for MT5, especially XAUUSD. This EA combines several mathematical calculations to determine market conditions, transaction direction, entry, SL, TP, and lot size.

Main components:

Momentum

Measuring the strength and direction of price movements.

Z-Score
Detect pullbacks or price deviations from the average value.

Linear Regression
Determine the direction and strength of trends objectively.

ATR
Adjusting the distance SL to market volatility.

Risk-Based Lot
Calculate lots based on the percentage of risk to equity.

Expectancy
Evaluate strategy opportunities based on win rate and risk-reward. Temporary expectancy is not made a mandatory filter because it can cause entry too rarely if the probability has not been calibrated with enough samples.

Market conditions:

  • Trends: looking for entries following trends after pullbacks.
  • Range: looking for mean-reversion of extreme Z-Score.
  • Neutral: do not enter until market conditions are clearer.
Timeframe structure:

  • H4: detects regime, momentum and trend direction.
  • M15: detect pullbacks using Z-Score.
  • M15: candle recovery as trigger entry.
Buy TERMS:

  • The market regime is trending.
  • Momentum and regression H4 leads up.
  • There has been a negative Z-Score or pullback in the last few M15 candles.
  • A bullish candle appears as a sign of recovery.
  • Spreads and volatility are still within safe limits.
Sell TERMS:

  • The market regime is trending.
  • Momentum and regression H4 leads down.
  • There has been a positive Z-Score or pullback in the last few M15 candles.
  • A bearish candle appears as a sign of recovery.
  • Spreads and volatility are still within safe limits.
Risk management:

  • Normal risk: 0.5% per transaction.
  • Risk when volatility is high: 0.25%.
  • Normal SL: about 1.5 ATR.
  • SL when volatility is high: about 1.8 ATR.
  • Target trend: around RR 1:2.
  • Target range: around RR 1:1.3.
  • Maximum two transaction losses per day.
  • One active position per symbol.
Channel Indicator + EA free: t.me/forexbotlab
nt working
 
in demo or backtest no rodre send. the journal is:
2026.07.29 18:21:38.970 Core 01 expert file added: Experts\shoe\Math_Quant_1_6_EA.ex5. 86400 bytes loaded
2026.07.29 18:21:38.970 Core 01 initial deposit 500.00 EUR, leverage 1:400
2026.07.29 18:21:38.970 Core 01 successfully initialized
2026.07.29 18:21:38.970 Core 01 82 Kb of total initialization data received
2026.07.29 18:21:38.970 Core 01 AMD Ryzen AI 7 350 w/ Radeon 860M, 31866 MB
2026.07.29 18:21:38.970 Core 01 XAUUSD.p: symbol to be synchronized
2026.07.29 18:21:38.970 Core 01 XAUUSD.p: symbol synchronized already, 22 bytes received
2026.07.29 18:21:38.970 Core 01 XAUUSD.p: load 31 bytes of history data to synchronize in 0:00:00.000
2026.07.29 18:21:38.970 Core 01 XAUUSD.p: history synchronized from 2024.01.02 to 2026.07.28
2026.07.29 18:21:38.970 Core 01 XAUUSD.p: ticks synchronization started
2026.07.29 18:21:38.970 Core 01 XAUUSD.p: load 38 bytes of tick data to synchronize in 0:00:00.000
2026.07.29 18:21:38.970 Core 01 XAUUSD.p: history ticks synchronized from 2025.06.02 to 2026.07.27
2026.07.29 18:21:38.970 Core 01 XAUUSD.p,M15: history cache allocated for 37129 bars and contains 35277 bars from 2025.01.02 01:00 to 2026.06.30 23:45
2026.07.29 18:21:38.970 Core 01 XAUUSD.p,M15: history begins from 2025.01.02 01:00
2026.07.29 18:21:38.970 Core 01 XAUUSD.p,M15 (PepperstoneEU-Live): generating based on real ticks
2026.07.29 18:21:38.970 Core 01 testing with execution delay 100 milliseconds
2026.07.29 18:21:38.970 Core 01 XAUUSD.p,M15: testing of Experts\shoe\Math_Quant_1_6_EA.ex5 from 2026.07.01 00:00 to 2026.07.28 00:00 started with inputs:
2026.07.29 18:21:38.970 Core 01 GENERAL=
2026.07.29 18:21:38.970 Core 01 InpMagicNumber=26072901
2026.07.29 18:21:38.970 Core 01 InpTradeComment=MathQuant-Regime-v2
2026.07.29 18:21:38.970 Core 01 InpRegimeTF=16388
2026.07.29 18:21:38.970 Core 01 InpTrendTF=16388
2026.07.29 18:21:38.970 Core 01 InpPullbackTF=15
2026.07.29 18:21:38.970 Core 01 InpEntryTF=15
2026.07.29 18:21:38.970 Core 01 InpAllowBuy=true
2026.07.29 18:21:38.970 Core 01 InpAllowSell=true
2026.07.29 18:21:38.970 Core 01 InpBlockAnyPositionOnSymbol=true
2026.07.29 18:21:38.970 Core 01 InpMaxSpreadPoints=0
2026.07.29 18:21:38.970 Core 01 InpMaxSpreadATRPercent=25.0
2026.07.29 18:21:38.970 Core 01 InpSlippagePoints=20
2026.07.29 18:21:38.970 Core 01 SESSION AND RE-ENTRY CONTROL=
2026.07.29 18:21:38.970 Core 01 InpUseSessionFilter=false
2026.07.29 18:21:38.970 Core 01 InpSessionStartHour=10
2026.07.29 18:21:38.970 Core 01 InpSessionEndHour=23
2026.07.29 18:21:38.970 Core 01 InpCooldownAfterSLMinutes=30
2026.07.29 18:21:38.970 Core 01 InpOneTradePerPullback=true
2026.07.29 18:21:38.970 Core 01 InpMaximumLossesPerDay=2
2026.07.29 18:21:38.970 Core 01 1. MOMENTUM=
2026.07.29 18:21:38.970 Core 01 InpMomentumPeriod=12
2026.07.29 18:21:38.970 Core 01 InpMinMomentumPercent=0.03
2026.07.29 18:21:38.970 Core 01 2. Z-SCORE PULLBACK=
2026.07.29 18:21:38.970 Core 01 InpZScorePeriod=20
2026.07.29 18:21:38.970 Core 01 InpZMinAbs=0.4
2026.07.29 18:21:38.970 Core 01 InpZMaxAbs=1.8
2026.07.29 18:21:38.970 Core 01 InpSetupLookbackBars=8
2026.07.29 18:21:38.970 Core 01 InpMaxRecoveryZAbs=0.75
2026.07.29 18:21:38.970 Core 01 InpRequireZRecovery=false
2026.07.29 18:21:38.970 Core 01 InpMinZScoreRecovery=0.15
2026.07.29 18:21:38.970 Core 01 InpEnableRangeTrading=true
2026.07.29 18:21:38.970 Core 01 InpRangeZMinAbs=1.8
2026.07.29 18:21:38.970 Core 01 InpRangeZMaxAbs=2.8
2026.07.29 18:21:38.970 Core 01 InpRangeRewardRiskRatio=1.3
2026.07.29 18:21:38.970 Core 01 3. REGRESSION TREND=
2026.07.29 18:21:38.970 Core 01 InpRegressionPeriod=12
2026.07.29 18:21:38.970 Core 01 InpTrendATRPeriod=14
2026.07.29 18:21:38.970 Core 01 InpMinTrendScore=0.04
2026.07.29 18:21:38.970 Core 01 MARKET REGIME=
2026.07.29 18:21:38.970 Core 01 InpEfficiencyRatioPeriod=24
2026.07.29 18:21:38.970 Core 01 InpTrendEfficiencyMin=0.22
2026.07.29 18:21:38.970 Core 01 InpRangeEfficiencyMax=0.12
2026.07.29 18:21:38.970 Core 01 ENTRY TRIGGER=
2026.07.29 18:21:38.970 Core 01 InpUseBreakoutTrigger=false
2026.07.29 18:21:38.970 Core 01 InpBreakoutLookback=1
2026.07.29 18:21:38.970 Core 01 InpBreakoutBufferATR=0.0
2026.07.29 18:21:38.970 Core 01 InpMinimumBodyATR=0.08
2026.07.29 18:21:38.970 Core 01 InpMaximumCandleRangeATR=2.0
2026.07.29 18:21:38.970 Core 01 4. ATR SL AND TP=
2026.07.29 18:21:38.970 Core 01 InpEntryATRPeriod=14
2026.07.29 18:21:38.970 Core 01 InpSlowATRPeriod=100
2026.07.29 18:21:38.970 Core 01 InpMinimumVolatilityRatio=0.55
2026.07.29 18:21:38.970 Core 01 InpHighVolatilityRatio=1.3
2026.07.29 18:21:38.970 Core 01 InpExtremeVolatilityRatio=2.5
2026.07.29 18:21:38.970 Core 01 InpSL_ATR_Multiplier=1.5
2026.07.29 18:21:38.970 Core 01 InpHighVolSL_ATR_Multiplier=1.8
2026.07.29 18:21:38.970 Core 01 InpRewardRiskRatio=2.0
2026.07.29 18:21:38.970 Core 01 5. RISK AND LOT=
2026.07.29 18:21:38.970 Core 01 InpRiskPercent=0.5
2026.07.29 18:21:38.970 Core 01 InpHighVolRiskPercent=0.25
2026.07.29 18:21:38.970 Core 01 InpAllowMinimumLotOverRisk=false
2026.07.29 18:21:38.970 Core 01 6. EXPECTANCY=
2026.07.29 18:21:38.970 Core 01 InpUseExpectancyFilter=false
2026.07.29 18:21:38.970 Core 01 InpEstimatedBuyWinRatePercent=36.0
2026.07.29 18:21:38.970 Core 01 InpEstimatedSellWinRatePercent=36.0
2026.07.29 18:21:38.970 Core 01 InpRoundTurnCommissionPerLot=0.0
2026.07.29 18:21:38.970 Core 01 InpEstimatedSlippagePoints=0.0
2026.07.29 18:21:38.970 Core 01 InpMinimumExpectancyR=0.05
2026.07.29 18:21:38.970 Core 01 DISPLAY=
2026.07.29 18:21:38.970 Core 01 InpShowDashboard=true
2026.07.29 18:21:38.970 Core 01 XAUUSD.p,H4: history cache allocated for 2426 bars and contains 2310 bars from 2025.01.02 00:00 to 2026.06.30 20:00
2026.07.29 18:21:38.970 Core 01 XAUUSD.p,H4: history begins from 2025.01.02 00:00
2026.07.29 18:21:38.970 Core 01 XAUUSD.p : real ticks begin from 2025.06.02 00:00:00
2026.07.29 18:21:38.970 Core 01 EURUSD.p: symbol to be synchronized
2026.07.29 18:21:38.970 Core 01 EURUSD.p: symbol synchronized already, 22 bytes received
2026.07.29 18:21:38.970 Core 01 EURUSD.p: load 31 bytes of history data to synchronize in 0:00:00.000
2026.07.29 18:21:38.970 Core 01 EURUSD.p: history synchronized from 2024.01.02 to 2026.07.28
2026.07.29 18:21:38.970 Core 01 EURUSD.p: ticks synchronization started
2026.07.29 18:21:38.970 Core 01 EURUSD.p: load 38 bytes of tick data to synchronize in 0:00:00.000
2026.07.29 18:21:38.970 Core 01 EURUSD.p: history ticks synchronized from 2025.06.02 to 2026.07.27
2026.07.29 18:21:38.970 Core 01 EURUSD.p : real ticks begin from 2025.06.02 00:00:00
2026.07.29 18:21:48.535 Core 01 final balance 500.00 EUR
2026.07.29 18:21:48.535 Core 01 XAUUSD.p,M15: 4739798 ticks, 1733 bars generated. Environment synchronized in 0:00:00.022. Test passed in 0:00:16.038 (including ticks preprocessing 0:00:00.312).
2026.07.29 18:21:48.535 Core 01 XAUUSD.p,M15: total time from login to stop testing 0:00:16.060 (including 0:00:00.022 for history data synchronization)
2026.07.29 18:21:48.535 Core 01 6422778 total ticks for all symbols
2026.07.29 18:21:48.535 Core 01 EURUSD.p: generate 1684288 ticks in 0:00:00.078, passed to tester 1682981 ticks
2026.07.29 18:21:48.535 Core 01 XAUUSD.p: generate 4739798 ticks in 0:00:00.234, passed to tester 4739799 ticks
2026.07.29 18:21:48.535 Core 01 275 Mb memory used including 2 Mb of history data, 192 Mb of tick data
2026.07.29 18:21:48.535 Core 01 log file "C:\Users\ldeha\AppData\Roaming\MetaQuotes\Tester\73B7A2420D6397DFF9014A20F1201F97\Agent-127.0.0.1-3000\logs\20260729.log" written
2026.07.29 18:21:48.542 Core 01 connection closed
 
Test on cent account Trading has not opened since yesterday.#7
have demo raw, 2 trades since yesterday, don't look good(circled result's are from math quant, other result's are from different testing ea's), ea needs some tuning, but before that need to know if there is expiry date ?
 

Attachments

  • math quant not good.PNG
    math quant not good.PNG
    103.4 KB · Views: 6
Back
Top