Re: 🔺 MT5 XARD - Simple Trend Following Trading System

1921
xard777 wrote: Sun Apr 12, 2026 1:00 pm RE: Changing Two color 336 line
Dear @Xard777

First of all, thank you for the incredible work on XU EFFECT. I’ve been testing v7.97 since you have released and digging into the code to understand the Genome and Hebbian learning systems. I used an AI to help me understand the logic, and I’d like to share my observations and ask for a few clarifications.

1. Genome stuck at 0.5000
With default settings on Gold or Bitcoin, Forex pairs, the Genome remains gray at exactly 0.5000.
I added debug prints and found the reason:

The TRIT Ratio (raw) is extremely small – e.g., on XAUUSD: 0.000149
After scaling, it becomes 0.003736
The memory (5‑period EMA) is almost identical, so Surprise = 5.86e-7

The default InpTRITDeadZone = 0.0005 – surprise is far below it
→ Learning never activates → Genome stays at 0.5

Suggestion: Would it make sense to make the deadzone adaptive (e.g., based on ATR or instrument digits) or reduce the default to ~1e-7 for crypto/metals?

2. The “New Optional Randomization” flag
When I set InpUseCoilRandomization = true, the Genome starts fluctuating immediately instead of staying fixed at 0.5.

Without randomization: Genome is stuck (as above).

With randomization: the added random term pushes the surprise above the deadzone, forcing learning to activate and Genome values start to fluctuate a lot.

Question: Is this intended as a “break‑loose” mechanism for low‑volatility markets? Or should randomization be used only for testing?

3. How I understand the Genome & Hebbian (from the code)
I want to confirm my understanding. Based on the code, this is what I think happens:

Hebbian component (13‑period EMA of price):

Acts as a “memory trace” of recent price.

Genome bias = 0.5 + (price - hebbianEMA)/hebbianEMA * 0.5.

TRIT Genome (when InpUseTRITGenome = true):

Computes (Trigger - SlowEMA) / (Trigger + SlowEMA) * 2

Adaptive scaling when ratio is small (<0.05)

Maintains a 5‑period memory of the scaled ratio

Surprise = current ratio – memory

Only if |surprise| > deadzone, Genome = 0.5 + surprise * sensitivity

Coil bias (when coil_tightness > 50): amplifies the Genome by 0.62×(genomeRaw‑0.5)

Final Genome is clamped to [0,1].

Do I have that right? Is the coil bias multiplier (0.62) derived from the Feigenbaum constant as the code comments suggest?

4. Price rounding in VCD panel (forex pairs)
On 5‑digit brokers (ICMarkets), the VCD panel shows price with only 2 decimals – e.g., GBPUSD 1.34252 → 1.34.
The code uses StringFormat("%.2f", sig.price).

I changed it locally to DoubleToString(sig.price, _Digits) and now it works correctly.
Would you consider updating the indicator to respect _Digits?

Also the same rounding applies to VWAP and Trigger labels.

5. Log message “Hebbian reset due to time gap of 1970.01.06 …”
I see these in the Experts tab:
2026.04.13 10:16:00.629 XU EFFECT (XAUUSD,M5) CRITICAL FIXES: VWAP accumulation, division by zero, file I/O, Hebbian reset
2026.04.13 09:56:38.175 XU EFFECT (XAGUSD,M5) XU EFFECT: Hebbian reset due to time gap of 1970.01.06 13:00:00 seconds

No Idea about these

My environment:
MT5 build 5430
Broker: ICMarkets (5‑digit quotes)
Tested on EURUSD, XAUUSD, BTCUSD

Any clarification on the points above would be greatly appreciated.

Thank you again for this amazing tool.

XARD: Thanks for the feedback -- Try this version out...
These users thanked the author mazibee for the post (total 3):
Danielsam, shrii, eduarescobar

Re: 🔺 MT5 XARD - Simple Trend Following Trading System

1922
I asked AI to expalin VCD Panel, Hebbian and Genome for my own understanding, hope it is helpful for others too.

XU EFFECT v7.98 – COMPLETE USER GUIDE (VCD PANEL, TERNARY, GENOME & TRADING WORKFLOW)

This post explains everything you need to know about the updated XU EFFECT v7.98 indicator.
Special thanks to Xard777 (Dan) for the fixes based on community feedback.

----------------------------------------------------------------------------------------
1. WHAT’S NEW IN v7.98
----------------------------------------------------------------------------------------

- Adaptive DeadZone: the old fixed 0.0005 is now multiplied by (symbol point * 1000).
This makes the Genome learn correctly on Gold, Bitcoin and other instruments.
- Price display now respects broker digits (e.g. 1.34252 instead of 1.34).
- Hebbian reset log shows seconds/minutes – no more “1970” date.
- Genome ramp‑up (0 → 0.5 → fluctuation) is now documented as normal behaviour.

----------------------------------------------------------------------------------------
2. VCD PANEL – LINE BY LINE (with colors & scenarios)
----------------------------------------------------------------------------------------


The VCD (Visual Control Display) panel is your real‑time trading dashboard.

[ROW 1 – HEADER]
LIVE DATA STREAM // v7.98 ATOMIC
– “ATOMIC” pulses to cyan every second, “SYNC” is dim gray. Confirms indicator is alive.

[ROW 2 – SYMBOL & TIME]
EURUSD H1 TF STATUS 14:32:05
– Symbol/Timeframe in bright yellow, broker time in cyan.

[ROW 3 – CANDLE & TREND]
CANDLE: [BUY] (BULLISH) TREND: [BULLISH]
– Candle color:
Cyan = BUY (bullish)
Red = SELL (bearish)
Dim gray = WAIT (neutral)
– Trend (MT ternary):
Cyan = MT = +1 (bullish)
Red = MT = -1 (bearish)
Dim gray = MT = 0 (neutral)

[ROW 4 – LAST UPDATE]
LAST UPDATE: 14:32:05
– Shows when panel was refreshed (every 1 second).

[ROW 5 – GENOME & PRICE]
GENOME: 0.7234 PRICE: 1.08932
– Genome colors:
Bright green = >0.70 (strong bullish learning)
Cyan = 0.55–0.70 (moderate bullish)
Dim gray = 0.45–0.55 (neutral)
Red = 0.30–0.45 (moderate bearish)
Bright red = <0.30 (strong bearish)
– Price uses full broker digits (fixed in v7.98).

[ROW 6 – VWAP INFORMATION]
VWAP: 1.08715 [ABOVE VWAP]
– VWAP status:
Cyan = above VWAP (LT = +1) → bullish
Red = below VWAP (LT = -1) → bearish
Dim gray = no VWAP (LT = 0)

[ROW 7 – TERNARY MATRIX]
TERNARY: ST:1 MT:1 LT:1 [CONSENSUS]
– Each ternary (+1,0,-1) is colored cyan for +1, red for -1, dim gray for 0.
– Consensus:
Cyan “FULL BULL” when all three are +1
Red “FULL BEAR” when all three are -1
Dim gray “MIXED” otherwise.

[ROW 8 – TRIGGER INFORMATION]
TRIGGER: 1.08845 [ABOVE TRIGGER]
– Trigger status:
Cyan = price above trigger → bullish pressure
Red = price below trigger → bearish pressure
Dim gray = no trigger value.

[ROW 9 – ACTION SIGNAL (FINAL OUTPUT)]
ACTION: [BUY SIGNAL]
– Cyan = BUY SIGNAL
– Red = SELL SIGNAL
– Dim gray = NEUTRAL – WAIT

[ROW 10 – FOOTER]
JSON -> HomeLAB VAULT-READY
– Informational (ignore for manual trading).

----------------------------------------------------------------------------------------
3. ST, MT, LT – WHAT THEY MEAN
----------------------------------------------------------------------------------------


ST (Short‑Term Ternary) – Execution signal
+1 : price > VWAP AND price > (Fast+Slow EMA)/2 → strong immediate bullish
-1 : price < VWAP AND price < (Fast+Slow EMA)/2 → strong immediate bearish
0 : mixed conditions → do NOT enter.

MT (Medium‑Term Ternary) – Trend signal
+1 : Fast EMA (11) > Slow EMA (13) → bullish trend
-1 : Fast EMA < Slow EMA → bearish trend
0 : EMAs equal (rare) → trendless.

LT (Long‑Term Ternary) – Institutional signal
+1 : price > VWAP → smart money is long
-1 : price < VWAP → smart money is short
0 : price = VWAP or invalid.

CONSENSUS = (ST == MT == LT) and not zero.
– This is the highest‑probability trade setup.

----------------------------------------------------------------------------------------
4. HEBBIAN & TRIT GENOME – DEEP DIVE
----------------------------------------------------------------------------------------

The Genome is a learning system that adapts to market conditions.

A) Simple Hebbian mode (InpUseTRITGenome = false)
– 13‑period EMA of price.
– Genome = 0.5 + (price - hebbianEMA)/hebbianEMA * 0.5
– Moves above 0.5 when price is consistently above the EMA.

B) TRIT Genome (default, recommended)
Step 1 – TRIT Ratio = (Trigger - SlowEMA)/(Trigger + SlowEMA)*2
Step 2 – Adaptive scaling if ratio < 0.05 (zooms in on compressed markets)
Step 3 – 5‑period memory of the scaled ratio
Step 4 – Surprise = current ratio - memory
Step 5 – If |surprise| > adaptive DeadZone, learning occurs:
genomeRaw = 0.5 + surprise * sensitivity
Step 6 – Coil bias (when price compressed between VWAP and Trigger):
coilBias = 0.62 * (genomeRaw - 0.5)
Step 7 – Final Genome = clamp(genomeRaw + coilBias, 0, 1)

The adaptive DeadZone in v7.98 is:
deadzone = InpTRITDeadZone * max(symbol point * 1000, 1e-9)
For EURUSD point=0.00001 → deadzone ≈ 1e-8 (very sensitive)
For Gold point=0.001 → deadzone ≈ 1e-6 (still works)

WHY THE GENOME “RAMPS UP” (0 → 0.5 → fluctuation)
– First bar: buffers empty → shows 0.0000
– After 1 closed bar: Hebbian EMA seeds to price, memory set to 0.5 → Genome jumps to 0.5
– Bars 2–4: memory building, surprise small → stays near 0.5
– Bars 5–12: may start moving if volatility high
– After 13+ bars: full fluctuation (0.3–0.7). This is normal and intended.

----------------------------------------------------------------------------------------
5. HOW TO USE THE VCD PANEL FOR TRADE DECISIONS (Step‑by‑Step)
----------------------------------------------------------------------------------------

Step 1 – Check CONSENSUS
– If [CONSENSUS] (cyan or red) → proceed.
– If [MIXED] (gray) → DO NOT TRADE.

Step 2 – Check CANDLE and TREND colors
– Both cyan → favour LONG
– Both red → favour SHORT
– Mixed colours → reduce conviction or wait.

Step 3 – Check GENOME value
– >0.70 (bright green) → strong bullish confirmation for LONG
– <0.30 (bright red) → strong bearish confirmation for SHORT
– 0.45–0.55 (gray) → neutral – reduce position size.

Step 4 – Check VWAP and TRIGGER status
– For LONG: both [ABOVE VWAP] and [ABOVE TRIGGER] (cyan)
– For SHORT: both [BELOW VWAP] and [BELOW TRIGGER] (red)

Step 5 – Execute based on ACTION field
– [BUY SIGNAL] → place LONG with stop below recent swing low
– [SELL SIGNAL] → place SHORT with stop above recent swing high
– [NEUTRAL – WAIT] → stay flat.

----------------------------------------------------------------------------------------
6. EXAMPLE TRADE SCENARIOS
----------------------------------------------------------------------------------------

Strong Bullish Setup (High Confidence)
CANDLE: [BUY] (cyan)
TREND: [BULLISH] (cyan)
TERNARY: ST:1 MT:1 LT:1 – [CONSENSUS] cyan
GENOME: 0.78 – bright green
VWAP: [ABOVE VWAP] cyan
TRIGGER: [ABOVE TRIGGER] cyan
ACTION: [BUY SIGNAL] cyan
→ Aggressive BUY, 2x normal size.

Mixed Setup – NO TRADE
CANDLE: [WAIT] (gray)
TREND: [BULLISH] (cyan)
TERNARY: ST:0 MT:1 LT:-1 – [MIXED] gray
GENOME: 0.51 – gray
VWAP: [BELOW VWAP] red
TRIGGER: [ABOVE TRIGGER] cyan
ACTION: [NEUTRAL – WAIT] gray
→ Stay out.

Bearish with Divergent Genome – Cautious Short
CANDLE: [SELL] red
TREND: [BEARISH] red
TERNARY: ST:-1 MT:-1 LT:-1 – [CONSENSUS] red
GENOME: 0.62 – cyan (bullish divergence!)
VWAP: [BELOW VWAP] red
TRIGGER: [BELOW TRIGGER] red
ACTION: [SELL SIGNAL] red
→ Cautious SHORT, reduce size to 0.5x, tighten stop.

----------------------------------------------------------------------------------------
7. QUICK REFERENCE TABLE (VCD COLORS & SIGNALS)
----------------------------------------------------------------------------------------


Component Bullish Signal Bearish Signal Neutral/Wait
------------------------------------------------------------------------------------------------------------------------
CANDLE [BUY] (cyan) [SELL] (red) [WAIT] (gray)
TREND [BULLISH] (cyan) [BEARISH] (red) NEUTRAL (gray)
GENOME >0.55 (cyan/green) <0.45 (red) 0.45-0.55 (gray)
VWAP STATUS [ABOVE VWAP] (cyan) [BELOW VWAP] (red) [NO VWAP] (gray)
TERNARY [CONSENSUS] cyan [CONSENSUS] red [MIXED] gray
TRIGGER STATUS [ABOVE TRIGGER] (cyan) [BELOW TRIGGER] (red) [NO TRIGGER] (gray)
ACTION [BUY SIGNAL] (cyan) [SELL SIGNAL] (red) [NEUTRAL – WAIT] (gray)

----------------------------------------------------------------------------------------
8. FINAL TRADING RULE
----------------------------------------------------------------------------------------


Only take a trade when:
- ACTION matches CONSENSUS (both bullish or both bearish)
- GENOME confirms ( >0.55 for long, <0.45 for short)
- VWAP and TRIGGER status align with the trade direction.

Use the VCD panel as your dashboard , it combines all timeframes and learning into one
actionable signal.

------------------------------------------------------------------------------------------------------------------------
Happy trading, and thank you again to Xard777 for the continuous improvements.
------------------------------------------------------------------------------------------------------------------------
These users thanked the author mazibee for the post (total 7):
Danielsam, shrii, Shockr, ashdays, waal69, Sarj, horizon202

Re: 🔺 MT5 XARD - Simple Trend Following Trading System

1924
xard777 wrote: Sun Apr 12, 2026 1:00 pm RE: Changing Two color 336 line
As I was trying to say earlier, you can change the two-color EMA line from 336 to the following:

EMA 12 on the M15 timeframe

EMA 48 on the M4 timeframe

EMA 192 on the M1 timeframe

On the M4 and M1 timeframes, this would serve as a temporary bias for intraday trading.

In theory, you could then run three M4 charts i.e. Bitcoin, Gold & Dow (or whatever markets you follow)

Best,
Xard777
xard777 wrote: Tue Apr 14, 2026 7:28 am Updated the EMA+Candles
Ideal for M4 Trading
Enjoy!
Best
XARD777
Good Morning @Xard,

Last night while checking the code for my understanding, I found that this line in the code is hard coded (Also the setting used is 12 instead of 16)

int EMA16Period = 12;

For changing EMA16 settings , I have to do it from the code instead of input parameters (There is an option to change settings for EMA4Period)

When I tried changing it to

input int EMA16Period = 12;

and compiled, code generated following errors so I reverted back to

int EMA16Period = 12;
XU EMA+CANDLES.mq5
'EMA16Period' - constant cannot be modified XU EMA+CANDLES.mq5 188 7
'EMA16Period' - constant cannot be modified XU EMA+CANDLES.mq5 193 7
'EMA16Period' - constant cannot be modified XU EMA+CANDLES.mq5 198 7
'EMA16Period' - constant cannot be modified XU EMA+CANDLES.mq5 203 7
'EMA16Period' - constant cannot be modified XU EMA+CANDLES.mq5 208 7
'EMA16Period' - constant cannot be modified XU EMA+CANDLES.mq5 213 7
6 errors, 0 warnings 6 0

Re: 🔺 MT5 XARD - Simple Trend Following Trading System

1926
Sarj wrote: Tue Apr 14, 2026 9:00 pm Hi Xard , Can you please post your latest system you are using a zip file. Sarj
Hello @Sarj

@Xard posted his latest setup on 12-04-2026, which can be dowloaded from here post1295581849.html#p1295581849


Also need to replace these two indictators below
1) XU EFFECT v7.98.mq5
post1295581884.html#p1295581884
2) XU EMA+CANDLES.mq5
post1295581908.html#p1295581908

Hope this helps.
These users thanked the author mazibee for the post:
Sarj

Re: 🔺 MT5 XARD - Simple Trend Following Trading System

1927
xard777 wrote: Sun Apr 12, 2026 1:00 pm XU Effect 7.98
Best,
Xard777
First of all, a big thank you to @Xard for the continued work on the XU Effect indicator and for releasing updated version 7.98 with the latest enhancements.

However, I am still experiencing a strange behavior with the Genome (Hebbian) value on the VCD Panel.
What I have observed:
When I attach the indicator to a chart, the Genome starts at 0.00000.
Within less than a minute, it slowly increments step by step and eventually reaches 0.50000.
Once it hits 0.50000, it stops moving – it never goes above 0.5 or below 0.5, regardless of market conditions or time passed.

I have tested
Symbols: XAUUSD, BTCUSD, ETHUSD, GBPUSD, and several other forex pairs.
Timeframes: M5, M15 (also tried M30 and H1 – same result).
Settings: Default parameters, but I also tried tweaking TRIT Sensitivity, DeadZone, Memory Period, AutoScale, etc. No change in the behavior.

In the expert Tab I can see this
2026.04.14 13:22:29.577 XU EFFECT v7.98 (XAUUSD,M5) XU EFFECT v7.98 Initializing...
2026.04.14 13:22:29.577 XU EFFECT v7.98 (XAUUSD,M5) XU EFFECT v7.98: Symbol XAUUSD Point=0.01 Digits=2
2026.04.14 13:22:29.579 XU EFFECT v7.98 (XAUUSD,M5) XU EFFECT v7.98: State buffer full, reusing index 0
2026.04.14 13:22:29.593 XU EFFECT v7.98 (XAUUSD,M5) XU EFFECT v7.98 Initialized - Vault-Ready Edition
2026.04.14 13:22:29.593 XU EFFECT v7.98 (XAUUSD,M5) Atomic JSON I/O | Coil Metrics | Hebbian Delta | Per-chart isolation
2026.04.14 13:22:29.593 XU EFFECT v7.98 (XAUUSD,M5) CRITICAL FIXES: VWAP accumulation, division by zero, file I/O, Hebbian reset
2026.04.14 13:22:29.593 XU EFFECT v7.98 (XAUUSD,M5) v7.98 FIXES: Adaptive deadzone, _Digits price display, timestamp logs

The VCD Panel uses this color logic for the Genome:

color hebColor = (sig.hebbian > 0.7) ? GTC_NEON_GREEN : (sig.hebbian > 0.5) ? GTC_NEON_CYAN : GTC_TEXT_DIM;

bright green → > 0.70 (strong bullish learning)
cyan → 0.55–0.70 (moderate bullish)
dim gray → 0.45–0.55 (neutral)

I have never seen the Genome go above 0.55 or below 0.45, it is permanently locked at 0.50000 after the initial ramp up.

Has anyone else witnessed the Genome value change color and move above 0.50000 (or below)?

If yes, on which symbol / timeframe / settings did you see that?

I’d really appreciate confirmation from @Xard and other users.

If this is a universal issue, maybe there is a small bug in the TRIT Genome update logic (possibly the adaptive deadzone or the seeding mechanism).

If it’s just me, I’d love to know what I’m missing.

Thanks in advance.

Re: 🔺 MT5 XARD - Simple Trend Following Trading System

1928
xard777 wrote: Tue Apr 14, 2026 7:28 am Updated the EMA+Candles
Ideal for M4 Trading
Enjoy!
Best
XARD777
this indicator has good settings,

thanks for it

if you convert it to mtf, then it should yield good results i think, like h4 candle on h1 , h1 candle on m15, m15 candle on m5 and m5 candle on m1

like this yours mt4 attached indicator xu ma v3. this had great settings in mtf

as always great coding by you.
These users thanked the author rijay for the post (total 2):
Tsar, ManilaSpurs

Re: 🔺 MT5 XARD - Simple Trend Following Trading System

1930
SOLESHOE wrote: Wed Apr 15, 2026 6:44 pm it would be great if EMA indicator could adapt itself to any timeframe incliuding current time frame, instead having to recompile it for each desired timeframe...
Let's just say I'm not exactly a computer whiz, but if you want to, you can do it yourself. Just save the average with the value you need for as long as you need it. Sometimes the basics slip your mind—here's an example attached. I hope I understood what you wanted correctly.
So, save the value 192 for 1 minute on the 4M, 48, and 12 for the 15M.