Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
terrylica avatar

Mql5 Indicator Patterns

  • 436 installs
  • 62 repo stars
  • Updated August 3, 2026
  • terrylica/cc-skills

mql5-indicator-patterns is a Claude Code skill that supplies battle-tested MetaTrader 5 indicator patterns for developers who need correct OnCalculate buffers, warmup, and display scaling.

About

mql5-indicator-patterns is an MQL5 development skill in terrylica/cc-skills with production patterns for custom MetaTrader 5 indicators. It covers explicit IndicatorSetDouble scaling for small values under 1.0, visible plus hidden SetIndexBuffer layouts, static new-bar detection to prevent rolling-window drift, and PLOT_DRAW_BEGIN warmup alignment. A troubleshooting table maps eight common failures—blank windows, drifting values, misaligned plots, reversed arrays, buffer type mistakes, compile mismatches, stale updates, and performance issues—to concrete fixes. Four reference docs expand display-scale, buffer-patterns, recalculation, complete-template, and debugging guidance. The skill is self-evolving: agents update SKILL.md when reproducible MT5 edge cases appear. Reach for mql5-indicator-patterns when authoring or debugging custom indicators where official docs leave buffer lifecycle and display scaling ambiguous.

  • mql5-indicator-patterns

Mql5 Indicator Patterns by the numbers

  • 436 all-time installs (skills.sh)
  • +4 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #963 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/terrylica/cc-skills --skill mql5-indicator-patterns

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs436
repo stars62
Last updatedAugust 3, 2026
Repositoryterrylica/cc-skills

How do you fix blank MQL5 indicator windows?

Use mql5-indicator-patterns for development tasks

Who is it for?

Developers building or debugging custom MetaTrader 5 indicators who hit blank charts, drift, or misaligned plot starts in production.

Skip if: Teams only needing Python parquet ingestion or log parsing in the same cc-skills MQL5 plugin without writing indicator code.

When should I use this skill?

User mentions MQL5 indicator, OnCalculate, indicator buffers, blank indicator window, or MetaTrader 5 plot misalignment.

What you get

Production-ready OnCalculate templates, buffer setup snippets, warmup-aligned plots, and a troubleshooting checklist for MT5 indicators.

  • OnCalculate pattern snippets
  • buffer architecture templates
  • indicator troubleshooting checklist

By the numbers

  • Includes an 8-row troubleshooting table for common MT5 indicator failures
  • Documents 4 reference guides for display, buffers, recalculation, and templates
  • Lists 6 essential production patterns from scaling through forward-indexed arrays

Files

SKILL.mdMarkdownGitHub ↗

MQL5 Visual Indicator Patterns

Battle-tested patterns for creating custom MQL5 indicators with proper display, buffer management, and real-time updates.

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use This Skill

Use this skill when:

  • Creating custom MQL5 indicators for MetaTrader 5
  • Debugging indicator display or buffer issues
  • Setting up OnCalculate with proper warmup handling
  • Implementing new bar detection patterns

Quick Reference

Essential Patterns

Display Scale (for small values < 1.0):

IndicatorSetDouble(INDICATOR_MINIMUM, 0.0);
IndicatorSetDouble(INDICATOR_MAXIMUM, 0.1);

Buffer Setup (visible + hidden):

SetIndexBuffer(0, BufVisible, INDICATOR_DATA);        // Visible
SetIndexBuffer(1, BufHidden, INDICATOR_CALCULATIONS); // Hidden

New Bar Detection (prevents drift):

static int last_processed_bar = -1;
bool is_new_bar = (i > last_processed_bar);

Warmup Calculation:

int StartCalcPosition = underlying_warmup + own_warmup;
PlotIndexSetInteger(0, PLOT_DRAW_BEGIN, StartCalcPosition);

---

Common Pitfalls

Blank Display: Set explicit scale (see Display Scale reference)

Rolling Window Drift: Use new bar detection with hidden buffer (see Recalculation reference)

Misaligned Plots: Calculate correct PLOT_DRAW_BEGIN (see Complete Template reference)

Forward-Indexed Arrays: Always set ArraySetAsSeries(buffer, false)

---

Key Patterns

For production MQL5 indicators:

1. Explicit scale for small values (< 1.0 range) 2. Hidden buffers for recalculation tracking 3. New bar detection prevents rolling window drift 4. Static variables maintain state efficiently 5. Proper warmup calculation prevents misalignment 6. Forward indexing for code clarity

These patterns solve the most common indicator development issues encountered in real-world MT5 development.

---

Troubleshooting

IssueCauseSolution
Blank indicator windowScale not set for small valuesSet INDICATOR_MINIMUM/MAXIMUM explicitly
Values drifting over timeRolling window not resetUse new bar detection with hidden buffer
Misaligned plot startWrong PLOT_DRAW_BEGINCalculate: underlying_warmup + own_warmup
Reversed array indexingSeries mode enabledCall ArraySetAsSeries(buffer, false)
Buffer values incorrectWrong INDICATOR_DATA typeUse INDICATOR_CALCULATIONS for hidden buffers
Compile error on bufferBuffer count mismatchMatch #property indicator_buffers with SetIndexBuffer
Indicator not updatingOnCalculate return wrongReturn rates_total to signal successful calculation
Performance issuesRecalculating all barsOnly recalculate from prev_calculated onwards

---

Reference Documentation

For detailed information, see:

  • Display Scale - Fix blank indicator windows for small values
  • Buffer Patterns - Visible and hidden buffer architecture
  • Recalculation - Bar detection and rolling window state management
  • Complete Template - Full working example with all patterns
  • Debugging - Checklist for troubleshooting display issues

Post-Execution Reflection

After this skill completes, check before closing:

1. Did the command succeed? — If not, fix the instruction or error table that caused the failure. 2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match. 3. Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

Related skills

How it compares

Use mql5-indicator-patterns for MT5 indicator buffer and display issues; pick generic MQL5 EA skills when strategy logic—not indicator rendering—is the blocker.

FAQ

Why do MQL5 indicators show blank windows for small values?

mql5-indicator-patterns explains that MetaTrader 5 auto-scales poorly for values under 1.0. Set IndicatorSetDouble on INDICATOR_MINIMUM and INDICATOR_MAXIMUM explicitly, as documented in the display-scale reference, to render small-range plots.

How does mql5-indicator-patterns prevent indicator drift?

mql5-indicator-patterns recommends static last_processed_bar tracking with hidden INDICATOR_CALCULATIONS buffers so OnCalculate only advances on new bars. This stops rolling-window state from accumulating errors across ticks.

What references ship with mql5-indicator-patterns?

mql5-indicator-patterns links four references—display-scale, buffer-patterns, recalculation, and complete-template—plus a debugging checklist. Together they cover warmup math, forward-indexed arrays, and full working indicator templates.

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.