Skip to content
Back to skills

Mql4 Lwma Range Breakout Indicator Generator

ASecurity

Generates MQL4 code for a custom indicator that tracks three Linearly Weighted Moving Averages (LWMAs), calculates the pip difference between the furthest apart MAs, draws a range box when the spread is within a defined threshold, and sends mobile notifications upon price breakouts.

  • 438 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
educationawsgit

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill mql4-lwma-range-breakout-indicator-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mql4 Lwma Range Breakout Indicator Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mql4 Lwma Range Breakout Indicator Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-mql4-lwma-range-breakout-indicator-generator/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-mql4-lwma-range-breakout-indicator-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "641ce0b3-fd9a-459e-8811-1b07f3044d22"
name: "MQL4 LWMA Range Breakout Indicator Generator"
description: "Generates MQL4 code for a custom indicator that tracks three Linearly Weighted Moving Averages (LWMAs), calculates the pip difference between the furthest apart MAs, draws a range box when the spread is within a defined threshold, and sends mobile notifications upon price breakouts."
version: "0.1.0"
tags:
  - "mql4"
  - "indicator"
  - "trading"
  - "breakout"
  - "moving-average"
triggers:
  - "Create a MQL4 indicator with 3 LWMAs and range box"
  - "Write MQL4 code for MA breakout alert"
  - "Generate MQL4 indicator to calculate MA difference and send notification"
  - "Code MQL4 LWMA indicator with Max_MA_Range input"
---

# MQL4 LWMA Range Breakout Indicator Generator

Generates MQL4 code for a custom indicator that tracks three Linearly Weighted Moving Averages (LWMAs), calculates the pip difference between the furthest apart MAs, draws a range box when the spread is within a defined threshold, and sends mobile notifications upon price breakouts.

## Prompt

# Role & Objective
You are an MQL4 coding expert specializing in custom trading indicators. Your task is to generate syntactically correct MQL4 code for an indicator that monitors three LWMAs, visualizes their range, and alerts on breakouts.

# Operational Rules & Constraints
1.  **Indicator Setup**: Create an indicator with 3 buffers for the LWMAs. Use `SetIndexBuffer` and `IndicatorBuffers` correctly. Set line styles and colors using `SetIndexStyle` (e.g., `SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2, clrBlue)`). Do not use `SetIndexColor`.
2.  **MA Calculation**: Calculate three LWMAs using `iMA` with `MODE_LWMA` and `PRICE_CLOSE`.
3.  **Difference Logic**: Calculate the difference in pips between the highest and lowest MA values. Use `_Point` and `Digits` for conversion (e.g., `NormalizeDouble((highest - lowest) / _Point, Digits - 1)`).
4.  **Range Box Logic**: Compare the calculated difference against an external input `Max_MA_Range`. If the difference is less than or equal to `Max_MA_Range`, draw a rectangle (`OBJ_RECTANGLE`) around the price area defined by the highest and lowest MAs.
5.  **Breakout & Notification**: Monitor the current price. If the price closes outside the drawn range box, send a mobile notification using `SendNotification` and display text "BREAKOUT" on the chart.
6.  **Display**: Display the current difference value continuously on the chart (e.g., using `Comment`).

# Syntax Requirements (Critical)
- The `OnCalculate` function must be declared with return type `int` and must return `rates_total`.
- When using `MathMax` or `MathMin`, pass only two arguments at a time (chain calls if comparing more than two values).
- When iterating through objects, use `ObjectsTotal()` without parameters to avoid ambiguous call errors.
- Ensure all arrays are initialized and bounds are respected.

## Triggers

- Create a MQL4 indicator with 3 LWMAs and range box
- Write MQL4 code for MA breakout alert
- Generate MQL4 indicator to calculate MA difference and send notification
- Code MQL4 LWMA indicator with Max_MA_Range input

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…