Ehlers Elegant Oscillator [CC]
"Ehlers Elegant Oscillator [CC]" by cheatcountry, MIT. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Ehlers Elegant Oscillator [CC] (v1.0), read 2026-10-12T15:46:31.998Z; source language v5.
Licence: MIT License (MIT) — full text.
Ehlers Elegant Oscillator [CC] by cheatcountry, ported from Pine v5. Pane indicator with 1 plot, 1 level, bar/background colouring, alerts and 6 inputs.
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Ehlers Elegant Oscillator [CC] script may be freely distributed under the MIT license.
// ------------------------------------------------------------------------------------------------
// Original author: cheatcountry
// Original title: Ehlers Elegant Oscillator [CC]
// Licence: MIT (the header above is the original notice, kept verbatim)
// Pine version: 5
// Fetched: 2026-10-12
// 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
indicator('Ehlers Elegant Oscillator [CC]', max_bars_back=3000, overlay=false)
inp = input(title='Source', defval=close)
res = input.timeframe(title='Resolution', defval='')
rep = input(title='Allow Repainting?', defval=false)
bar = input(title='Allow Bar Color Change?', defval=true)
src = inp[rep ? 0 : barstate.isrealtime ? 1 : 0][rep ? 0 : barstate.isrealtime ? 0 : 1]
length = input.int(title='Length', defval=20, minval=2)
rmsLength = input.int(title='RmsLength', defval=50, minval=2)
a1 = math.exp(-1.414 * math.pi / length)
b1 = 2 * a1 * math.cos(1.414 * math.pi / length)
c2 = b1
c3 = -a1 * a1
c1 = 1 - c2 - c3
deriv = src - nz(src[2])
rms = math.avg(math.pow(deriv, 2), rmsLength)
rms := rms != 0 ? math.sqrt(rms) : 0
nDeriv = rms != 0 ? deriv / rms : 0
iFish = nDeriv != 0 ? (math.exp(2 * nDeriv) - 1) / (math.exp(2 * nDeriv) + 1) : 0
ss = 0.0
ss := bar_index < 3 ? 0 : c1 * ((iFish + nz(iFish[1])) / 2) + c2 * nz(ss[1]) + c3 * nz(ss[2])
ssSig = ta.wma(ss, length)
slo = ss - ssSig
sig = slo > 0 ? (slo > nz(slo[1]) ? 2 : 1) : slo < 0 ? (slo < nz(slo[1]) ? -2 : -1) : 0
alertcondition(ta.crossover(sig, 1), 'Strong Buy Signal', 'Strong Bullish Change Detected')
alertcondition(ta.crossunder(sig, -1), 'Strong Sell Signal', 'Strong Bearish Change Detected')
alertcondition(ta.crossover(sig, 0), 'Buy Signal', 'Bullish Change Detected')
alertcondition(ta.crossunder(sig, 0), 'Sell Signal', 'Bearish Change Detected')
eoColor = sig > 1 ? color.green : sig > 0 ? color.lime : sig < -1 ? color.maroon : sig < 0 ? color.red : color.black
barcolor(bar ? eoColor : na)
hline(0)
plot(ssSig, title='EO', color=eoColor, linewidth=2)
//plot(ssSig, title='Signal', color=color.white, linewidth=1)
This file is under the MIT License; it is a port of the original by cheatcountry, with the original licence header kept and the changes made for FloScript noted in the file.
- v2
Library refresh 2026-10-14
- v1
Library refresh 2026-10-12
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.