76 Commits
Author SHA1 Message Date
Neo Malesa 7794c91e68 Polish README to match project style (badges + lead + MIT) 2026-08-06 21:00:51 +10:00
Neo Malesa 0f1fd6ad73 Add MIT License 2026-08-06 21:00:19 +10:00
Neo MalesaandGitHub 8620dc2bad Merge pull request #3 from n30dyn4m1c/claude/gold-m1-profitable-ea-98uayd
Add TickRobust EA: mean reversion built to survive Every Tick modelling
2026-07-11 23:39:10 +10:00
Claude f83171af94 Add TickRobust EA: mean reversion built to survive Every Tick modelling
The existing Z-Score EAs test profitable on M1 OHLC but fail under
Every Tick because they decide on individual ticks: noise fires the
Z-exit at the worst price, market-order exits pay spread twice, and
no minimum-edge check means quiet-market trades only ever pay spread.

XAU_Quant_Reversion_TickRobust.mq5 closes that gap:
- All decisions (entry, exits, breakeven, TP retarget) run exactly
  once per bar on closed-bar data, so OHLC and Every Tick converge
- Cost gate: StdDev >= 3x and TP distance >= 4x the round-trip cost
  (live spread + commission points) or the trade is skipped
- Server-side limit TP placed at the mean, retargeted per bar with a
  cost-covering floor (no spread paid on exit)
- Turn-confirmation bar before entry (no knife-catching)
- Volatility-aware SL: max(800 pts, 2.5x ATR) against tick spikes

Docs: README section for the new EA, CLAUDE.md overview updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012knbN7oGPQ7K4TnRroZjWF
2026-07-11 13:26:27 +00:00
$N30andGitHub a67b53c24d Merge pull request #2 from n30dyn4m1c/claude/session-gos49m
Add regime/probability filters and fix stale-signal, restart, and coo…
2026-06-11 01:33:29 +10:00
Claude 7559945962 Add regime/probability filters and fix stale-signal, restart, and cooldown gaps
OHLC EA improvements:
- Add ADX regime filter (InpADXMax, default 25): block mean-reversion
  entries in trending markets, restoring the documented ADX gate
- Require live Z-Score (>= 90% of threshold) alongside the closed-bar
  signal so entries no longer chase price after an intra-bar snap-back,
  and no instant re-entry fires after a Gravity Exit win
- Add loss cooldown (InpCooldownMins, default 10): pause entries after
  a losing trade instead of re-entering the same extended move
- Remove the soft 0.75x Z threshold that entered at weak extremes
  (~1.5 sigma) in stable markets; full threshold always applies
- Recover open position on restart (adopt ticket + rebuild trade record)
  and seed Z-Score at init so a recovered position is managed instead of
  being orphaned or instantly closed on a bogus Z=0
- Restore the absolute spread cap (InpMaxSpreadPts was declared but unused)
- Give the velocity filter a 10-second time window so slow drift across
  10 ticks in quiet markets no longer false-triggers the spike block
- Capture position ticket via DEAL_POSITION_ID with ordered fallbacks
- Extend news load window past midnight for early-next-day events
- Guard daily-loss check against zero starting balance

EveryTick EA: remove dead no-op confirmation block

https://claude.ai/code/session_01GPhWxikvDKmDNwQGhs6gFp
2026-06-10 15:20:41 +00:00
$N30andGitHub d48c2e48d0 Merge pull request #1 from n30dyn4m1c/feature/gemini-suggestions
Feature/gemini suggestions
2026-03-27 14:45:22 +10:00
Neo MalesaandClaude Opus 4.5 eb6b5e258b Replace EAs with M1-specific variants (EveryTick and OHLC)
Remove old XAU_Quant_Reversion.mq5 and RT variant, add new M1 timeframe
optimized versions with separate EveryTick and OHLC modeling modes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-27 14:44:13 +10:00
Neo MalesaandClaude Sonnet 4.6 4c990eb88b Add tick-level entry filters, gravity exit, and RT variant EA
- Entry confirmation gate: signal must persist 3+ ticks or 2+ seconds before firing
- Price velocity filter: blocks entry for 3s when price moves >25% of ATR in 10 ticks
- Soft Z-Score threshold (0.75x) for stable volatility regimes
- Gravity exit: Z-Score exit target decays toward 0 as trade ages (floors at 0 after 15 mins)
- Breakeven trigger extended by configurable InpMinProfitBuffer points
- Trailing stop minimum move raised to 0.3*ATR (from 0.2*ATR)
- Add XAU_Quant_Reversion_RT.mq5: real-time tick-based variant

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 11:05:22 +10:00
Neo MalesaandClaude Sonnet 4.6 9e47b96211 Add breakeven lock and time-decay trailing stop to exit logic
- CheckBreakeven(): moves SL to entry+10pts once price gains 1.5*ATR,
  guaranteeing a no-loss trade; runs every tick with broker stop-level safety
- HandleTrailingStop(): halves ATR trail multiplier after 50% of
  InpMaxHoldMinutes has elapsed to tighten gains before time-exit fires

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 08:57:46 +10:00
Neo MalesaandClaude Sonnet 4.6 c7aaa635de Add volatility-adaptive Z-Score and ATR-relative spread filter
- Dynamic Z threshold: raises InpEntryZ by 0.5 when current ATR > 1.5x
  its 100-bar average, avoiding premature entries in high-volatility spikes
- ATR-relative spread gate: blocks entry when spread exceeds 12% of current
  ATR in points (transaction cost too high relative to expected M1 move),
  replacing the fixed 1.0x ATR cap
- Comment() now displays Volatility Ratio, Dynamic Z-Target, and MaxAllowed
  spread for real-time filter visibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 08:50:35 +10:00
Neo MalesaandClaude Sonnet 4.6 b56a68387d Add CSV trade log and ticket-based position tracking
Introduces a per-trade CSV log (N30_TradeLog_SYMBOL_MMAGIC.csv) that
captures full entry context and exit metrics on every closed position.
Position selection now uses a cached ticket (glTicket) via
PositionSelectByTicket for efficiency and correctness in both live
trading and Strategy Tester.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 08:46:48 +10:00
Neo MalesaandClaude Sonnet 4.6 ec0c4329ef Fix compile errors and code review issues in XAU_Quant_Reversion
- Replace invalid SYMBOL_STOPLEVEL with correct SYMBOL_TRADE_STOPS_LEVEL
- Add SymbolSelect() in OnInit to ensure symbol is in Market Watch
- Fix NormalizeLot digit calculation (log10-based, removes fragile float ==)
- Add minimum lot guard in ExecuteTrade to prevent oversized clamped lots
- Add defensive SelectOwnPosition() re-call in HandleTrailingStop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 07:57:22 +10:00
Neo Malesa 7ff7086b55 Simplify EA for high frequency, add time-based and Friday exits
- Removed ADX, Volatility, and Z-Score Hook filters for faster entry
- Updated defaults: InpEntryZ = 2.0, InpExitZ = 0.5
- Added InpMaxHoldMinutes (30m) for time-based exit
- Added InpFridayCloseHour and IsWeekendRisk for weekend safety
- Cleaned up HUD Comment to show Z-Score, H1 Trend, News, and Duration
2026-03-27 02:20:11 +10:00
Neo MalesaandClaude Sonnet 4.6 1f6d4629d6 Increase trade frequency: relax filters and update defaults
- Remove Marubozu filter entirely
- Relax spread check from 0.5x to 1.0x ATR
- Lower InpEntryZ default: 2.4 → 2.0
- Raise InpADXFilter default: 20 → 30 (wider ranging threshold)
- Reduce InpFilterPeriodH1 default: 200 → 50 (more responsive H1 SMA)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:58:14 +10:00
Neo MalesaandClaude Sonnet 4.6 f8ef6ef59c Add Marubozu filter, enhanced spread check, and filter status Comment
- Marubozu filter: skips entry if last M1 candle body > 90% of range (high-momentum breakout guard)
- Spread check: now also blocks if spread > 50% of current ATR in points, preventing entries in illiquid conditions
- Comment refactored to show real-time status of all filters: Z-Hook, Vol-Filter, H1 Trend, Marubozu, Spread, Session, News

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:36:51 +10:00
Neo MalesaandClaude Sonnet 4.6 d7de5d4850 Add worship comment convention to CLAUDE.md
Instructs Claude to place "// This work is my worship unto GOD" as the very last line after every EA file update.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:18:00 +10:00
Neo MalesaandClaude Sonnet 4.6 59aa663c0e Add H1 trend filter to prevent counter-trend M1 entries
Adds InpFilterPeriodH1 input (default 200) and handleMA_H1 to filter
mean-reversion entries against the H1 structural trend. BUY signals
require price above H1 SMA; SELL signals require price below it.
Set InpFilterPeriodH1=0 to disable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:15:25 +10:00
Neo MalesaandClaude Sonnet 4.6 49a6864884 Update README to document both EAs
Adds full documentation for XAU_Quant_Reversion_Breakout.mq5 including
dual strategy overview, all input parameters, and design notes. Also
adds missing InpMaxPositions param to the primary EA's parameter table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 22:56:23 +10:00
Neo MalesaandClaude Sonnet 4.6 1b7a0b8c71 Remove deprecated EA files (bitcoin, gold-quant-m5-scalper, simple variants)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 22:52:12 +10:00
Neo MalesaandClaude Sonnet 4.6 7eff763c82 Fix news reload date check and MR Z-TP exit logic
- Use day_of_year instead of day in IsNearNews() to avoid skipping
  news reloads on same-numbered days across different months (both EAs)
- Remove alreadyPartial requirement from MR Z-TP condition in Breakout
  EA so position closes when Z reverts even if scale-out zone was skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 22:51:25 +10:00
Neo MalesaandClaude Sonnet 4.6 d77db617cc Fix critical bugs and moderate issues in both EAs
Critical bugs fixed:
- Breakout EA: early `return` in MR/TB entry blocks now conditional so
  both strategies run independently regardless of each other's position count
- Breakout EA: partial close detection replaced comment-based tracking
  (broken in MQL5) with partialClosedTicket global variable
- Breakout EA: cooldown now triggers correctly via lastTBCount change
  detection instead of never resetting barsSinceClose

Moderate issues fixed:
- Both EAs: symbol validated on init with XAUUSD fallback
- Both EAs: magic number comparisons cast to long to fix type mismatch
- Both EAs: fill mode now includes ORDER_FILLING_RETURN as fallback
- Both EAs: margin check added before trade execution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 22:48:47 +10:00
Neo MalesaandClaude Opus 4.5 276fb0fa2b Fix bugs and sync features across both EAs
- Fix CalendarValueHistory return type bug (was int, should be bool)
- Add dynamic risk tiers to breakout EA (synced from primary)
- Replace ATR-based SL with fixed-point SL/TP in breakout EA
- Add Z-Score full exit to breakout EA's mean reversion
- Add new-bar trailing (reduces broker modify requests)
- Add max positions limit input to both EAs
- Add comment truncation (MT5 31-char limit)
- Fix explicit ulong cast for position ticket
- Add CLAUDE.md for codebase documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 22:31:38 +10:00
Neo MalesaandClaude Opus 4.6 a068fa55d7 Rewrite README for N30 Gold Reversion v5
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:46:01 +10:00
Neo MalesaandClaude Opus 4.6 9cc7685708 Aggressive dynamic risk tiers: stay at 10% until $500
< $500: 10%/25% | $500-2k: 7%/20% | $2k-5k: 5%/15%
$5k-20k: 3%/10% | $20k+: 1.5%/7%

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:29:57 +10:00
Neo MalesaandClaude Opus 4.6 74f310257c Add dynamic risk tiers: auto-scale risk down as equity grows
< $100: 10% risk, 20% DLL | $100-500: 5%, 15% | $500-2k: 3%, 10%
$2k-10k: 2%, 8% | $10k+: 1%, 5%. Toggleable via InpUseDynamicRisk.
Chart display shows current equity, active risk tier, and DLL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:22:43 +10:00
Neo MalesaandClaude Opus 4.6 0089cfcc97 Switch to fixed-point SL and Z-Score TP for gold spike resilience
- SL: fixed 800 points instead of ATR-based (survives gold spikes)
- TP: close when Z-Score reverts to ±0.3 (natural mean reversion exit)
- Hard TP: 1500 points server-side safety net
- Trailing stop still active on new bars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:09:47 +10:00
Neo MalesaandClaude Opus 4.6 2615ab7f0f Tune SL/TP/trail for mean reversion: SL 2.5, TP 2.5, trail 2.0 ATR
Wider SL gives room for gold whipsaws, closer TP is reachable for
mean reversion snap-backs, trail won't choke winners early.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:54:34 +10:00
Neo MalesaandClaude Opus 4.6 053f8b7bd3 Rebrand XAU_Quant_Reversion to N30 Gold Reversion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:45:07 +10:00
Neo MalesaandClaude Opus 4.6 b6f16bf4ea Overhaul XAU_Quant_Reversion v5: hard TP, new-bar trailing, cleanup
- Add server-side hard TP (4x ATR) to survive disconnects
- Remove dead scale-out/partial close code (unusable at 0.01 lots)
- Trail stop only on new bar close instead of every tick
- Add CountOwnPositions() guard against duplicate entries
- Cache volatility filter result instead of calling twice
- Fix header filename and version to v5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:40:01 +10:00
Neo MalesaandClaude Opus 4.6 1af93bda4f Update all EAs: Z-Score 2.4, daily loss limit 20%
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:27:50 +10:00
Neo MalesaandClaude Opus 4.6 4512ee0f14 Update README: 3% risk, 30% daily loss, 10-20h window, red-folder news filter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:15:40 +10:00
Neo MalesaandClaude Opus 4.6 98fcfca360 Simplify news filter: only filter red folder (CALENDAR_IMPORTANCE_HIGH)
MQL5 calendar MODERATE importance doesn't match Forex Factory orange
folder — it includes CFTC positioning and Baker Hughes rig counts which
don't move gold. Removed two-tier VHI/HI split, now single 60-min
pause window for all red-folder USD events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:12:49 +10:00
Neo MalesaandClaude Opus 4.6 5860c2387b Update all EAs: 3% risk, 30% daily loss limit, trade window 10-20h
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:01:53 +10:00
Neo MalesaandClaude Opus 4.6 b1a7f0202c Revert news filter to TimeCurrent(): calendar API uses broker server time
TimeGMT() was incorrect — CalendarValueHistory() and MqlCalendarValue.time
both use broker server time, not UTC. Reverts to TimeCurrent() for
consistent time base.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 22:56:07 +10:00
Neo MalesaandClaude Opus 4.6 cd784041cd Rename news labels: VHI → (red folder) very-high-impact, HI → (orange folder) high-impact
Update Print logs, trade comments, dashboard text, and code comments
to use descriptive Forex Factory folder color labels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 22:48:34 +10:00
Neo MalesaandClaude Opus 4.6 874a114293 Fix news classification: red folder → VHI, orange folder → HI, ignore yellow
Previously all CALENDAR_IMPORTANCE_HIGH events were split by keyword into
VHI/HI tiers, and moderate-impact (orange) events were ignored entirely.
Now maps directly to Forex Factory colors: red (HIGH) → VHI with 60-min
window, orange (MODERATE) → HI with 15-min window, yellow (LOW) → ignored.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 22:46:36 +10:00
Neo MalesaandClaude Opus 4.6 9e5dc2ca2d Fix news filter timezone bug: use TimeGMT() for calendar queries
CalendarValueHistory() returns events in UTC, but the day window and
time comparisons were using TimeCurrent() (broker server time), causing
the EA to pick up wrong-day news events due to timezone offset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 22:42:55 +10:00
Neo MalesaandClaude Opus 4.6 8dd6feffd5 Lower breakout strategy risk: separate 3% risk, stricter entry filters
Reduce breakout losses by cutting risk from 10% to 3%, raising ADX
threshold to 30, extending Donchian period to 30, doubling cooldown to
10 bars, widening ATR stop to 2.5x, and adding min DI spread filter (5.0).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:35:41 +10:00
Neo MalesaandClaude Opus 4.6 f98765dfa7 Add XAU Dual Strategy EA: Mean Reversion + Trend Breakout
Fix MQL5 compilation errors: proper enum casts for PositionGetInteger(),
ulong cast for POSITION_TICKET, and replace goto with inverted condition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:25:47 +10:00
Neo MalesaandClaude Opus 4.6 6195fdee2a Tune XAU Quant Reversion: raise Z-score to 2.5, widen trade window to 1-22h
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:31:58 +10:00
Neo MalesaandClaude Opus 4.6 1babcf8633 Add XAU Quant Reversion EA with meaningful trade comments
Trade comments encode signal context (direction, Z-score, ADX, ATR)
for post-trade analysis. Scale-out, news close, and daily loss close
actions also get descriptive comments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 08:26:49 +10:00
Neo MalesaandClaude Opus 4.6 916f70487d Rewrite README to match current simplified EAs
Old README described features that no longer exist (partial closes,
trailing stops, news filter, scaled entry, weekly/equity stops,
volatility filter). Updated to accurately document both gold and BTC
EAs with their current parameters and design rationale.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:19:38 +10:00
Neo MalesaandClaude Opus 4.6 49ea4c98bd Simplify gold EA for $50 micro account, add BTC EA
Gold EA: remove dead partial close/trailing code (impossible at 0.01 lots),
add mandatory hard TP at 2.0 ATR, tighten SL to 1.2 ATR, lower daily
loss limit to 25%.

BTC EA: new file adapted for BTCUSD M15 with RSI filter enabled,
ADX 22, Z-score 2.2, hard TP 1.5 ATR for fast mean reversion scalps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:54:34 +10:00
Neo Malesa b3a9826a05 Revert "Add dynamic risk scaling: 10% below $200, 5% above"
This reverts commit 7f582672c4.
2026-03-08 12:02:54 +10:00
Neo MalesaandClaude Opus 4.6 7f582672c4 Add dynamic risk scaling: 10% below $200, 5% above
Smooths compounding curve after initial aggressive ramp.
Set InpRiskReduceAt=0 to disable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:00:46 +10:00
Neo MalesaandClaude Opus 4.6 e915ce3d67 Raise daily loss limit to 40% for aggressive running
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:44:40 +10:00
Neo MalesaandClaude Opus 4.6 d31c57fab9 Maximize opportunities: wider session, higher spread limit, RSI off
Window 9-20, spread 80pts, RSI disabled for max trade frequency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:43:26 +10:00
Neo MalesaandClaude Opus 4.6 a18aa4d758 Tighten exit timers: loser cut at 3 bars, stall at 6 bars / 0.15 ATR
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:42:07 +10:00
Neo MalesaandClaude Opus 4.6 a14aa4111b Boost reward side: TP1 to 1.5 ATR, trailing to 2.0 ATR for bigger winners
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:40:59 +10:00