Pine script (Tradingview Indicator) Conversion to MT4/MT5 required

Specifiche

MT5 Indicator Conversion Specification

Zero-Lag MA Trend Levels — TradingView/Pine Script to MT5

1. Project Objective

Convert the supplied TradingView Pine Script v5 indicator:

"Zero-Lag MA Trend Levels [ChartPrime]"

into a fully functional MetaTrader 5 (MT5) custom indicator written in MQL5.

The objective is to reproduce the TradingView indicator's calculations, signals, visual appearance, trend levels, and behavior as closely as technically possible.

The final product must operate directly on an MT5 chart without requiring external indicators, DLLs, or additional files.


2. Original Indicator Logic

The original Pine Script uses:

  • EMA

  • Zero-Lag Moving Average (ZLMA)

  • ATR

  • Bullish/bearish crossovers

  • Trend-level zones

  • Secondary bullish/bearish signals

Default inputs:

  • Length = 15

  • ATR Period = 200

  • Trend Levels = ON

  • Bullish color = #30D453

  • Bearish color = #4043F1


3. Core Calculations

The MT5 version must reproduce the following calculations.

EMA

Calculate:

EMA = EMA(Close, Length)

Default:

Length = 15

Zero-Lag Correction

Calculate:

Correction = Close + (Close - EMA)

ZLMA

Calculate:

ZLMA = EMA(Correction, Length)

The ZLMA calculation must match TradingView's ta.ema() behavior as closely as possible.


4. Trend Direction

The original indicator determines the ZLMA trend using the value three bars previously.

Bullish ZLMA:

ZLMA > ZLMA[3]

Bearish ZLMA:

ZLMA < ZLMA[3]

If neither condition is true, the neutral state may be used.

Colors

Bullish:

#30D453

Bearish:

#4043F1


5. EMA Color

The EMA changes color according to its relationship with ZLMA.

Bullish

When:

EMA < ZLMA

EMA should use the bullish color.

Bearish

When:

EMA >= ZLMA

EMA should use the bearish color.


6. Crossover Signals

Bullish Signal

A bullish signal occurs when ZLMA crosses above EMA:

ZLMA crosses above EMA

Equivalent to:

ZLMA > EMA

on the current closed candle while:

ZLMA(previous) <= EMA(previous)

Bearish Signal

A bearish signal occurs when ZLMA crosses below EMA:

ZLMA crosses below EMA

Equivalent to:

ZLMA < EMA

on the current closed candle while:

ZLMA(previous) >= EMA(previous)


7. Crossover Visualization

At every bullish crossover:

  • Plot a small diamond at the ZLMA price.

  • Use the bullish color.

At every bearish crossover:

  • Plot a small diamond at the ZLMA price.

  • Use the bearish color.

The diamonds must remain visible historically.

They must not disappear when the indicator is reloaded.


8. ZLMA and EMA Lines

The chart must display:

  1. ZLMA

  2. EMA

Both should be plotted directly on the main price chart.

The ZLMA color should change according to its direction.

The EMA color should change according to whether it is above or below ZLMA.


9. Fill Between ZLMA and EMA

The area between ZLMA and EMA should be visually filled.

Bullish

When:

ZLMA > EMA

Use the bullish color with transparency.

Bearish

When:

ZLMA < EMA

Use the bearish color with transparency.

The fill should update automatically as the relationship between the two lines changes.


10. ATR Calculation

Calculate:

ATR = ATR(200)

Default ATR period:

200

The ATR is used to determine the height of the trend-level zone.

The ATR period should be exposed as an MT5 input.


11. Bullish Trend-Level Zone

When a bullish ZLMA/EMA crossover occurs:

Top

ZLMA

Bottom

ZLMA - ATR

Create a bullish rectangular zone between these two prices.

The zone should use the bullish color with transparency.

The price associated with the signal should also be displayed where practical.


12. Bearish Trend-Level Zone

When a bearish ZLMA/EMA crossover occurs:

Top

ZLMA + ATR

Bottom

ZLMA

Create a bearish rectangular zone between these prices.

The zone should use the bearish color with transparency.


13. Trend-Level Extension

The trend-level zone should extend to the right after its creation.

The default extension is approximately 4 bars, matching the TradingView implementation.

The developer should ensure that the zone remains visually consistent with the TradingView version.


14. Secondary Bullish Signal

The original indicator creates a bullish ▲ signal when price crosses above the top of the active bullish trend-level zone.

Conditions should reproduce the Pine logic:

  • Price crosses above the trend-level top.

  • There was no new crossover signal on the current or previous bar.

  • EMA is below ZLMA.

The ▲ should be plotted around the relevant candle.

The signal must remain visible historically.


15. Secondary Bearish Signal

The original indicator creates a bearish ▼ signal when price crosses below the bottom of the active bearish trend-level zone.

Conditions:

  • Price crosses below the trend-level bottom.

  • There was no new crossover signal on the current or previous bar.

  • EMA is above ZLMA.

The ▼ should be plotted around the relevant candle.

The signal must remain visible historically.


16. Non-Repainting Requirement

This is important.

The MT5 indicator should not repaint historical signals.

Signals should preferably be confirmed using the closed candle.

Once a crossover or secondary signal has been confirmed on a closed candle:

  • It must remain on the chart.

  • It must not move to another historical candle.

  • It must not disappear after refreshing MT5.

  • It must not change simply because new candles appear.

The developer should clearly identify if any part of the original TradingView logic inherently behaves differently in real time.


17. Historical Data

When the indicator is attached to an existing MT5 chart, it must calculate historical data.

For example, if the chart contains 5,000 candles, the indicator should calculate and display historical:

  • ZLMA

  • EMA

  • crossover diamonds

  • trend-level zones

  • ▲ signals

  • ▼ signals

It must not only display signals generated after the indicator is attached.


18. Inputs

The MT5 indicator should have the following inputs:

Main Settings

Length = 15

ATR Period = 200

Display

Show Trend Levels = true

Show Secondary Signals = true

Colors

Bullish Color = #30D453

Bearish Color = #4043F1

Alerts

Enable Alerts = false

Enable Push Notifications = false

Alert On Closed Candle = true


19. Alerts

Optional alerts should be provided for:

Bullish crossover

"Symbol / Timeframe — Bullish ZLMA crossover"

Bearish crossover

"Symbol / Timeframe — Bearish ZLMA crossover"

Optionally provide alerts for:

  • ▲ secondary bullish signal

  • ▼ secondary bearish signal

Alerts should be one-time per signal.

The indicator must not repeatedly alert on every tick while the same signal remains active.


20. Performance

The indicator should be lightweight.

Avoid:

  • unnecessary calculations on every tick

  • excessive chart objects

  • infinite object creation

  • unnecessary recalculation of the entire history on every tick

Historical calculations may be performed when the indicator first loads, while subsequent calculations should preferably process only newly available data.

The indicator should be suitable for:

  • XAUUSD

  • Forex pairs

  • indices

  • CFDs

  • multiple MT5 timeframes


21. Object Management

All chart objects created by the indicator must have a unique naming prefix.

For example:

ZLMA_TL_

When the indicator is removed from the chart, its objects should be removed automatically.

The indicator must not delete or modify objects belonging to other indicators or the trader.


22. Timeframes

The indicator should work on all standard MT5 timeframes, including:

  • M1

  • M5

  • M15

  • M30

  • H1

  • H4

  • D1

  • W1

  • MN1

No hard-coded timeframe should be used unless specifically required by the original Pine Script.


23. Symbol Compatibility

The indicator should work with different broker symbol formats, including symbols such as:

  • XAUUSD

  • XAUUSDm

  • XAUUSD.a

  • EURUSD

  • GBPUSD

  • US30

  • NAS100

  • and Synthetic Indices from Deriv broker

The code must use the current chart's symbol and price precision automatically.


24. Compilation Requirements

The final source code must compile in the current MetaEditor/MT5 environment with:

  • 0 errors

  • 0 warnings where reasonably possible

The developer must provide the complete .mq5 source code.

No DLL dependency should be required.

No external indicator should be required.


25. Testing Requirements

Before delivery, the developer should test the indicator on:

XAUUSD M1

and at least one:

EURUSD M15/H1

Testing should verify:

  1. ZLMA matches the TradingView calculation.

  2. EMA matches TradingView.

  3. Crossovers occur on the same candles.

  4. Diamonds appear on the same candles.

  5. Trend-level zones appear on the same signals.

  6. Secondary ▲/▼ signals correspond to the Pine logic.

  7. Historical signals remain visible.

  8. Signals do not unnecessarily repaint.

  9. Alerts trigger only once.

  10. Removing/reloading the indicator does not destroy historical signal integrity.


26. TradingView Comparison

The developer should compare the MT5 version against the supplied TradingView indicator using the same:

  • Symbol

  • Timeframe

  • Length

  • ATR period

  • Historical date range

The developer should aim for candle-by-candle agreement between TradingView and MT5.

Small differences caused by broker price feeds may be expected.


27. Deliverables

The developer should provide:

Required

  1. Complete .mq5 source code.

  2. Compiled .ex5 indicator.

  3. List of configurable inputs.

  4. Brief installation instructions.

  5. Confirmation that the indicator compiles without errors.

Optional

  1. Screenshots comparing TradingView and MT5.

  2. Explanation of any unavoidable differences.

  3. Alert configuration instructions.


28. Acceptance Criteria

The project will be considered complete when:

  • The indicator compiles successfully.

  • ZLMA and EMA calculations reproduce the Pine logic.

  • Bullish and bearish crossovers are correctly identified.

  • Crossover diamonds are visible.

  • Trend-level zones are correctly generated.

  • Secondary ▲/▼ signals are correctly generated.

  • Historical signals are visible.

  • The indicator does not unnecessarily repaint.

  • Alerts work correctly and do not repeat continuously.

  • The indicator works on XAUUSD and standard Forex symbols.

  • The indicator does not significantly slow down MT5.

  • All objects are properly managed when the indicator is removed.

Source Code

The developer will be provided with the original TradingView Pine Script v5 source code for:

Zero-Lag MA Trend Levels [ChartPrime]

The Pine Script should be treated as the reference implementation. The MT5 implementation should reproduce its behavior rather than merely translating Pine syntax line-by-line.


Con risposta

1
Sviluppatore 1
Valutazioni
(623)
Progetti
727
34%
Arbitraggio
47
49% / 40%
In ritardo
14
2%
Caricato
2
Sviluppatore 2
Valutazioni
(64)
Progetti
144
46%
Arbitraggio
21
38% / 24%
In ritardo
32
22%
Gratuito
3
Sviluppatore 3
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Pubblicati: 2 codici
4
Sviluppatore 4
Valutazioni
(436)
Progetti
646
53%
Arbitraggio
35
63% / 20%
In ritardo
7
1%
In elaborazione
5
Sviluppatore 5
Valutazioni
(22)
Progetti
28
7%
Arbitraggio
9
33% / 33%
In ritardo
1
4%
In elaborazione
6
Sviluppatore 6
Valutazioni
(400)
Progetti
518
24%
Arbitraggio
61
57% / 25%
In ritardo
60
12%
In elaborazione
7
Sviluppatore 7
Valutazioni
(3)
Progetti
4
0%
Arbitraggio
0
In ritardo
0
Gratuito
8
Sviluppatore 8
Valutazioni
(83)
Progetti
97
32%
Arbitraggio
9
22% / 56%
In ritardo
5
5%
In elaborazione
9
Sviluppatore 9
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
10
Sviluppatore 10
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
11
Sviluppatore 11
Valutazioni
(3)
Progetti
9
67%
Arbitraggio
0
In ritardo
0
In elaborazione
12
Sviluppatore 12
Valutazioni
(13)
Progetti
22
41%
Arbitraggio
8
0% / 50%
In ritardo
3
14%
In elaborazione
13
Sviluppatore 13
Valutazioni
(211)
Progetti
274
21%
Arbitraggio
25
52% / 16%
In ritardo
0
Caricato
14
Sviluppatore 14
Valutazioni
(183)
Progetti
197
46%
Arbitraggio
4
50% / 25%
In ritardo
1
1%
In elaborazione
15
Sviluppatore 15
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
0
In ritardo
0
Gratuito
Pubblicati: 2 codici
16
Sviluppatore 16
Valutazioni
(14)
Progetti
15
40%
Arbitraggio
3
0% / 100%
In ritardo
0
Gratuito
Pubblicati: 1 articolo
17
Sviluppatore 17
Valutazioni
(319)
Progetti
571
35%
Arbitraggio
84
31% / 44%
In ritardo
206
36%
In elaborazione
18
Sviluppatore 18
Valutazioni
(2)
Progetti
2
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
19
Sviluppatore 19
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
20
Sviluppatore 20
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
21
Sviluppatore 21
Valutazioni
(7)
Progetti
6
0%
Arbitraggio
4
25% / 75%
In ritardo
2
33%
Gratuito
22
Sviluppatore 22
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
23
Sviluppatore 23
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
24
Sviluppatore 24
Valutazioni
(9)
Progetti
11
27%
Arbitraggio
0
In ritardo
2
18%
In elaborazione
Pubblicati: 1 codice
25
Sviluppatore 25
Valutazioni
(19)
Progetti
22
18%
Arbitraggio
9
33% / 44%
In ritardo
3
14%
In elaborazione
Pubblicati: 1 codice
Ordini simili
Gold robot 30 - 1000 USD
Hello everyone, I’m looking for a developer who has an algorithm in their arsenal that generates quick profits over the long term. I’m interested in a scalping expert advisor—it can be a one-shot, averaging, or grid strategy, with or without TP/SL. Please share your ideas and results; I’ll consider all options. The most important thing is the result. Good luck
Zwivhuya 100+ USD
I would like to be part of this trade because i want to help my family out of the hopeless life we are living now . i thoughts going to school will help me get better job but no i am still sitting for us to eat at home i have to sell my body to someone and get pay with that small money i can buy bread and cooldrink for my family that we can not sleep with emyter stomach
I need an Expert Advisor that trades by signal of ADX and Moving Average indicators. It must check and correctly process possible errors in trading operations. The main criteria of opening and closing positions , direction of Moving Average, Price of last bar . Set the number of lots to trade as an input parameter
I need you to develop an MT5 Expert Advisor (EA) in MQL5 specifically for BTCUSD , primarily trading on the 1-minute timeframe (M1) . The goal is to build a professional, rule-based automated trading system that trades strong impulsive BTCUSD moves in the direction of the trend , while using strict risk and money management. 1. CORE STRATEGY The EA should NOT randomly buy or sell. The basic sequence should be: Trend
seller must provide the following to be considered... i will answer to all who fit this description, and can purchase more than 1 EA... - brief strategy description - overall EA expectancy - 1 week limited trial version, with whatever settings you consider best (can be blocked on demo, i don't really care) - investor password from a reputable broker (if history is available... live / demo, same thing, doesn't really
Expert Needs to integrate Volume Density ( Ticks Per Point ) Adaptive Volume Baseline ( Apply with experience ) , Order Flow Tick Volume Based ( required integration is for smooth execution ) , Every other requirement already exists by the expert , True Objective : To identify the true transition from Accumulation to Expansion/Distribution leading to Breakout capturing participation while eliminating false breakouts
I need a professional XAUUSD signal indicator for MetaTrader 5, written entirely in MQL5 (.mq5). IMPORTANT: This is NOT an auto-trading EA. It must never open, close or modify trades. It only analyzes XAUUSD and generates signals + MT5 push notifications. 1. Multi-timeframe analysis: H4 → H1 → M30 → M15 → M10 → M5 → M1. 2. Detect market structure: - Swing High / Swing Low - BOS - MSS - CHOCH - Bullish/Bearish HTF
Hi. I am looking for an experienced MQL5 developer for an advanced XAUUSD MT5 indicator. Before choosing a developer, I would like to see a small proof-of-concept or an example of a similar indicator you have already developed. My final indicator must be written from scratch in MQL5 and I must receive the complete .mq5 source code + compiled .ex5 . Main requirements: XAUUSD MT5 / MQL5 Indicator only — NO AutoTrading
Title: Advanced XAUUSD MT5 Indicator – MQL5 Source Code Required I need a professional MT5 indicator written from scratch in MQL5 (.mq5) for XAUUSD. The indicator must be signals/analysis only — AutoTrading must remain OFF . I need the complete editable .mq5 source code, not only an .ex5 file. The system should analyze multiple timeframes: H4 → H1 → M30 → M15 → M5 → M1 . Required logic: Higher-timeframe
I need a professional XAUUSD signal indicator for MetaTrader 5, written entirely in MQL5 (.mq5). IMPORTANT: This is NOT an auto-trading EA. It must never open, close or modify trades. It only analyzes XAUUSD and generates signals + MT5 push notifications. 1. Multi-timeframe analysis: H4 → H1 → M30 → M15 → M10 → M5 → M1. 2. Detect market structure: - Swing High / Swing Low - BOS - MSS - CHOCH - Bullish/Bearish HTF

Informazioni sul progetto

Budget
31+ USD
Scadenze
da 1 a 3 giorno(i)

Cliente

(5)
Ordini effettuati14
Numero di arbitraggi0