RedK_xMACD
"RedK_xMACD: Extending the classic MACD with a simple filter" by RedKTrader, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: RedK_xMACD: Extending the classic MACD with a simple filter (v1.0), read 2026-11-15T18:55:10.180Z; source language v4.
Licence: Mozilla Public License 2.0 (MPL-2.0) — full text. The source is published with it, modifications included, under the same licence.
RedK_xMACD: Extending the classic MACD with a simple filter by RedKTrader, ported from Pine v4. Pane indicator with 3 plots, 1 level and 5 inputs.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // (Notice added by FloSignals: the author's source carries none. It was published open-source on 2021-01-03; since 2019-07-26 the platform it was published on has released such a script under MPL-2.0 automatically.) // parts of this code are based on the original built-in indicator by TradingView - at least that was the starting point :) // this version of the eXtended MACD (xMACD) uses a fast & slow MA (similar to the classic MACD) but they are both plotted against a 3rd, long-term MA utilized as a "filter" // when the fast/slow MA pair is above the filter MA (this is represented by the Green/Red line), we consider that a (long-term) up-trend, and when below the filter MA, we're in a down-trnd // the delta between the fast and the slow MAs (represented by the histogram) is used to reflect the short-term momentum (bullish vs bearish) //RedKTrader // ------------------------------------------------------------------------------------------------ // Original author: RedKTrader // Original title: RedK_xMACD: Extending the classic MACD with a simple filter // Licence: MPL-2.0 (the notice above was added by FloSignals; the original carries none) // Pine version: 4 // Fetched: 2026-11-15 // Ported to FloScript by FloSignals; modifications under MPL-2.0. // Converter: @flosignals/floscript 0.1.0, strict mode, score 100/100 // ------------------------------------------------------------------------------------------------ //@floscript=1 //@version=5 // Converted by the FloScript converter from a Pine-compatible v4 source. indicator(title="RedK_xMACD", shorttitle="xMACD", timeframe="") // Getting inputs fast_length = input.int(title="Fast Length", defval=5) slow_length = input.int(title="Slow Length", defval=10) filter_length = input.int(title="Filter Length", defval=20) src = input.source(title="Source", defval=close) signal_length = input.int(title="Signal Smoothing", defval=5) // Plot colors col_grow_above = #26A69A col_grow_below = #FFCDD2 col_fall_above = #B2DFDB col_fall_below = #EF5350 col_trendup = #33ff00 col_trenddn = #ff1111 // Calculations fast_ma = ta.ema(src, fast_length) slow_ma = ta.ema(src, slow_length) filter_ma = ta.ema(src, filter_length) hist = fast_ma - slow_ma macd = slow_ma - filter_ma signal = ta.ema(macd, signal_length) // Plot Section hline(0, color=#ffee58aa, linestyle=hline.style_solid, editable=false) plot(hist, title="Histogram", style=plot.style_columns, color=color.new(hist >= 0 ? (hist[1] < hist ? col_grow_above : col_fall_above) : hist[1] < hist ? col_grow_below : col_fall_below, 60)) plot(signal, title="Signal", color=color.aqua, linewidth=2) plot(macd, title="MACD", color=macd >= 0 ? col_trendup : col_trenddn, linewidth=3)
This file is under the Mozilla Public License 2.0; it is a port of the original by RedKTrader, with the original licence header kept and the changes made for FloScript noted in the file.
- v1
Library refresh 2026-11-15
Disclaimer. Scripts are written and published by members, or ported by FloSignals from open-source originals, and are their authors' own work and opinion. FloSignals does not review them for correctness and nothing in a script is financial advice or a recommendation to buy or sell anything — read the Risk Disclaimer. Posting here is under the Community Rules; a script that is not the poster's to post can be reported as the Copyright & Takedowns page says.

Comments (0)
No comments yet. Members can leave one.