Attachments forums

List of attachments posted on this forum.


All files on forums: 159943

Re: Bollinger Bands type indicators for MT4

mrtools, Wed Aug 20, 2025 3:06 am

TransparentTrader wrote: Sun Apr 14, 2024 11:17 am kvak, mrtools, or any of the master coders here, would it be possible to port this indicator to MT4/MT5?

The UltimateChannel2 pdf comes with Pinescript code for TradingView and I can't imagine it would be too difficult to convert it into MQL4/MQL5 code.

I'm sure PineCodersTASC on TradingView will eventually publish the code since they do so for every monthly magazine's featured indicator, but I've included the code to Ehler's Ultimate Smoother that was published in the April 2024 issue.

Hopefully that makes things easier for you!

Code: Select all

// This Pine Scriptâ„¢ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © PineCodersTASC

//  TASC Issue: April 2024 - Vol. 42, Issue 4
//     Article: The Ultimate Smoother.
//              Smoothing data with less lag.
//  Article By: John F. Ehlers
//    Language: TradingView's Pine Scriptâ„¢ v5
// Provided By: PineCoders, for tradingview.com


//@version=5
string title  = 'TASC 2024.04 The Ultimate Smoother'
string stitle = 'US'
indicator(title, stitle, true)


// --- Inputs ---
int   periodInput = input.int(20, "Critical Period:")
float sourceInput = input.source(close, "Source Series:")


// --- Functions ---
// @function      The UltimateSmoother is a filter created
//                by subtracting the response of a high-pass 
//                filter from that of an all-pass filter.
// @param src     Source series.
// @param period  Critical period.
// @returns       Smoothed series.
UltimateSmoother (float src, int period) =>
    float a1 = math.exp(-1.414 * math.pi / period)
    float c2 = 2.0 * a1 * math.cos(1.414 * math.pi / period)
    float c3 = -a1 * a1
    float c1 = (1.0 + c2 - c3) / 4.0
    float us = src
    if bar_index >= 4
        us := (1.0 - c1) * src + 
              (2.0 * c1 - c2) * src[1] - 
              (c1 + c3) * src[2] + 
              c2 * nz(us[1]) + c3 * nz(us[2])
    us


// --- Plotting ---
plot(UltimateSmoother(sourceInput, periodInput), 'US', color.blue, 2)

Hello, I apologize saw the code and automatically thought it was super smoother but finally realized it was super smoother's faster cousin anyway, made this version using Ultimate smoother.
All files in topic