MCPInstall

mql5-indicator-patterns

MQL5 indicator development patterns. TRIGGERS - MQL5 indicator, OnCalculate, indicator buffers, MetaTrader 5.

Installs
501
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/terrylica/cc-skills --skill mql5-indicator-patterns
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads mql5-indicator-patterns automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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.

FAQ

What does the mql5-indicator-patterns skill do?

MQL5 indicator development patterns. TRIGGERS - MQL5 indicator, OnCalculate, indicator buffers, MetaTrader 5.

How do I install mql5-indicator-patterns?

Run npx skills add https://github.com/terrylica/cc-skills --skill mql5-indicator-patterns in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mql5-indicator-patterns/ (personal) or .claude/skills/mql5-indicator-patterns/ (project).

Which AI agents can use mql5-indicator-patterns?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is mql5-indicator-patterns safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains mql5-indicator-patterns?

It is published by terrylica in terrylica/cc-skills. It has 501 recorded installs.

More from terrylica/cc-skills

View all →

mise-tasks

terrylica/cc-skills

Orchestrate multi-step project workflows using mise task definitions with dependency management and argument handling. Use whenever the user.

pandoc-pdf-generation

terrylica/cc-skills

PDF generation from markdown via Pandoc/XeLaTeX. TRIGGERS - markdown for PDF, print document, pandoc

Docs & Writing547 installs

Python logging with loguru, structlog, and orjson. TRIGGERS - loguru, structlog, structured logging

DevOps & Cloud402 installs

gdrive-access

terrylica/cc-skills

Access Google Drive via CLI with 1Password OAuth: list files, download, and sync folders. TRIGGERS - google drive, gdrive, drive folder, download drive, sync drive.

Backend & APIs356 installs

chezmoi-workflows

terrylica/cc-skills

Dotfile backup and sync with chezmoi. TRIGGERS - chezmoi, dotfiles, sync dotfiles, backup configs, cross-machine sync.

297 installs

disk-hygiene

terrylica/cc-skills

Open the skill to read its SKILL.md instructions.

268 installs

Popular other skills

View category →

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.3M installs

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1M installs

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

778.4K installs

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

508.9K installs

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

459.7K installs

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

447.9K installs