👨‍🔬 Cagliostro's MT5 Laboratory

1
Hello fellow traders.

I thought that could be interesting to share with you some of the MT5 stuff I am testing, researching and coding. As some of you know, I switched fully to MT5 last month, so am working to improve my MT5 arsenal.

Rules are simple.
-This is a testing lab, you don't pay to get and test stuff, it's all free.
-As per above, feedback and suggestions will be much appreciated.
-But no complaints or lamentations will be appreciated or considered.

Today's the Spring Equinox, the real start of the new year! So there is no better day to start sharing something!

The Oracle
In the shadowed depths of Delphi ancient ruins, where logic and mystery intertwine, lies The Oracle—an artifact of unfathomable power. Forged in an era when the stars whispered secrets to the bold, it transcends mere computation, unveiling glimpses of fate’s hidden currents. Its cryptic code, a relic of a lost civilization, pulses with esoteric wisdom, inviting the daring to pierce the veil of time—though its full mysteries remain tantalizingly out of reach.

It includes 7 indicators chosen, tested and optimized among hundreds in the last 4 months, including the Ehlers's Universal Strength indicator and my Rolling VWAP. Keep it at level 6 for M1/M3/M5 trading and let me know how it goes. Happy Equinox!

April 1 Update [Version 1.0], download it again.
-Incremental processing for all trend updates
-Buffer optimization
-VWAP pre-computation
-Added a Trend Strength Index

April 2 Update, download it again.
-Added customization for histograms and TSI label

April 8 Update, download it again.
-Added MTF validation
-Improved memory management
-Implemented incremental resizing for all buffers
-Fixed trend array stale impacting specific brokers
-Added Data Fetch Logging
-Added Error Handling for all indicators

April 9 Update, download it again.
-Removed redundant trend array shrink
-Improved FetchIndicatorData
-Aligned Local Timers to Server Timers
-Fixed MQL5’s native data sync in retry loop

April 13 Update, download it again.
-Added TF spec to Alerts
-Improved fault tolerance logic

April 19 Update [Version 2.0], download it again.
-Added multiple instances logic for calculations and alerts
-Replaced global variables with instance-specific storage
-Added MTF data sync checks with fallback
-Implemented instance-specific sync failure and anti-freeze mechanism
-Enhanced MTF data fetching with hybrid fetch resizing and index validation

April 25 Update, download it again.
-Instance complete isolation + timer-based handle sync to improve multi instance and multi chart setups.
-MTF sync watchdog with automatic fallback – prevents freezes when higher-timeframe series aren’t ready.
-Per bar indicator fetch cache – to cut CopyBuffer calls by ~50 %.
-Cumulative sum arrays – to reduce CPU load by ~ 40/50%
-Safe math guards – averts divide-by-zero exceptions and silent freezes.
-Histogram color/index refactor – ensures crisp visuals with zero repaint artefacts.
-Alert state isolation – blocks duplicate pop-ups and aligns messages with the correct chart.
"I conjure from shadows and shape fortunes from the unseen. The treasure lies hidden in plain sight, beneath the sunlight." - Cagliostro


Re: 👨‍🔬 Cagliostro's MT5 Laboratory

4
Cagliostro wrote: Sat Mar 22, 2025 2:19 am Hello fellow traders.

I thought that could be interesting to share with you some of the MT5 stuff I am testing, researching and coding. As some of you know, I switched fully to MT5 last month, so am working to improve my MT5 arsenal.
Hello Cagliostro!

Thank you for making this thread!
I have been hooked on your ideas since the Alkemix. I am looking forward to experiencing the evolution of the thread. This community is so powerful and with the positive attitude of the experienced traders and coders, this is just simply a new level in these weeks and months.

So grateful to see that selfless sharing in the era of fake gurus.

Before I saw and joined this forum I started coding for MT5, but I faced many issues and had to realize that almost everybody developing for MT4.
Your tireless work coding for MT5 gave me back the motivation to continue that journey!
These users thanked the author davidpont for the post (total 2):
Cagliostro, k_khan_bt


Re: 👨‍🔬 Cagliostro's MT5 Laboratory

6
Tradehunter wrote: Mon Mar 24, 2025 11:44 pm Repaints, at least in 'persisted' mode
running on the nas-100 after the gap up, printed up 7 candles back
Yes, it is possible in persisted mode, if you use MTF.

Did it happen on current TF, and what was the TF? None of the indicators repaint.

I will check tonight.
"I conjure from shadows and shape fortunes from the unseen. The treasure lies hidden in plain sight, beneath the sunlight." - Cagliostro

Re: 👨‍🔬 Cagliostro's MT5 Laboratory

8
Tradehunter wrote: Tue Mar 25, 2025 2:02 am yes, persisted mode, current TF, not MTF
Reviewed the code and could not find any logical flaw. Regarding your feedback, large price movements like a gap up (common in indices like NAS100) can prompt brokers or platforms to update historical data.

This might involve:
-Adjusting closing prices of past bars.
-Filling in missing bars.
-Correcting indicator values based on new price data.

I am using it since 2 months without facing issues, it is likely that you experienced not a real repaint but rather a recalculation due to the platform updating the historical data. If you want to be sure while using in with indices / high volatility, use the original mode.
These users thanked the author Cagliostro for the post (total 2):
davidpont, eduarescobar
"I conjure from shadows and shape fortunes from the unseen. The treasure lies hidden in plain sight, beneath the sunlight." - Cagliostro

Re: 👨‍🔬 Cagliostro's MT5 Laboratory

9
A-VWAP WITH BANDS

VWAP and ANCHORED VWAP in one indicator with three different band modes (beta version).

List of Features:
-Customizable VWAP Modes: Choose from Monthly, Weekly, Daily, 4-Hour, or Anchored modes.
-Multiple VWAP Sets: Plot up to three VWAP periods at once, each with distinct colors for quick and easy identification.
-Flexible Band Options: Enhanced with bands based on Standard Deviation (STDDEV), Average True Range (ATR), or Relative Strength Index (RSI).
-Anchored Mode: Define a specific anchor time (hour and minute) for accurate VWAP calculations starting from key market moments.

April 12 Update, download it again.
-Added option to customize colors.
These users thanked the author Cagliostro for the post (total 9):
iardavan, moey_dw, thomdel, davidpont, alexm, eduarescobar, Dimanche, Mundu19, Ricstar_8
"I conjure from shadows and shape fortunes from the unseen. The treasure lies hidden in plain sight, beneath the sunlight." - Cagliostro

Re: 👨‍🔬 Cagliostro's MT5 Laboratory

10
Cagliostro wrote: Sat Mar 22, 2025 2:19 am Hello fellow traders.

I thought that could be interesting to share with you some of the MT5 stuff I am testing, researching and coding. As some of you know, I switched fully to MT5 last month, so am working to improve my MT5 arsenal.

Rules are simple.
-This is a testing lab, you don't pay to get and test stuff, it's all free.
-As per above, feedback and suggestions will be much appreciated.
-But no complaints or lamentations will be appreciated or considered.

Today's the Spring Equinox, the real start of the new year! So there is no better day to start sharing something!

The Oracle
In the shadowed depths of Delphi ancient ruins, where logic and mystery intertwine, lies The Oracle—an artifact of unfathomable power. Forged in an era when the stars whispered secrets to the bold, it transcends mere computation, unveiling glimpses of fate’s hidden currents. Its cryptic code, a relic of a lost civilization, pulses with esoteric wisdom, inviting the daring to pierce the veil of time—though its full mysteries remain tantalizingly out of reach.

It includes 7 indicators chosen, tested and optimized among hundreds in the last 4 months, including the Ehlers's Universal Strength indicator and my Rolling VWAP. Keep it at level 6 for M1/M3/M5 trading and let me know how it goes. Happy Equinox!



The Oracle.ex5
Greetings to you! Thanks for your constant sharing. What fascinates me about you are the unique traits and characteristics you possess, along with the mention of the new year, which is very important for us Iranians! Nowruz, the new year, celebrations, and joy. Anyway, it’s an exciting and awesome topic—cheers to you!
These users thanked the author iardavan for the post:
Cagliostro
When your strategy is based on hope, it's a HOPELESS strategy!