TradingView
ImmortalFreedom
11 jan 2020 10:46

TrendFlex Oscillator - Dr. John Ehlers 

PNC Financial Services Group, Inc. (The)NYSE

Beskrivning

Hot off the press, I present this NEW "TrendFlex Oscillator" employing PSv4.0, originally formulated by Dr. John Ehlers for TASC - February 2020 Traders Tips. John Ehlers might describe it's novel characteristics as being a reversal sensitive near zero-lag averaging indicator retaining the TREND component. Also, I would add that irregardless of the sampling interval, this indicator has a bound range between +/-2.0 on "1 second" candles all the way up to "1 month" candle durations. This indicator also has a companion indicator entitled "Reflex Oscillator". I have published it in tandem with this one in my scripts profile.

One notable difference between this and the original formulation is that I have added an independent control for the Super Smoother. This "tweak" is enabled by applying the override and adjusting it's period. There is a "Post Smooth" input() that "tweaks" the internal TrendFlex EMA too. Keep in mind that my intention of adding tweaks is solely for experimentation with the original formulation.

I also added adjustable levels for those of you that may wish to employ alertcondition()s to this indicator somehow. Providing a more utilitarian approach, I created this with an easy to use reusable function named trendflex(). As always, I have included advanced Pine programming techniques that conform to proper "Pine Ettiquette". Being this is one of John Ehlers' first two simultaneously released indicators for 2020, I felt a few more bells and whistles were appropriate as a proper contribution to the Tradingview community.

Features List Includes:
Dark Background - Easily disabled in indicator Settings->Style for "Light" charts or with Pine commenting
AND much, much more... You have the source!

The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... regarding only this indicator, not others. When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!

Versionsinformation

Correction to for loop end point

Versionsinformation

WOOPS! I spilled some corona color on TrendFlex. It needed some flare anyways. I reckon it's time for a complete rewrite translating to PSv5, along with a facelift... Also, I resolved a rounding error issue occurring on micro assets that reduces TFO to a consistent value of 0.
Kommentarer
PineCoders
TheSnowFox
great indicator. hope you add divergence detection to it
blackcat1402
Thanks for sharing such a powerful oscillator! it would clear to have a lag version line compared to the fast line,
Alphaoptions
@blackcat1402, Do you have the script that you added to the TFO - TrendFlex Oscillator?
CJMann
@blackcat1402, Hey buddy, - how do I post a chart here? I'd like to share how similar this is to the awesome oscillator....
CryptoHouseGuru
Is there a way i can take the zero line and make it solid and change thickness and color? Thanks
CJMann
Love it, thank you! But can anyone point me toward any reading material on how this is suppose to be used? All I found was a very brief write-up by Ehlers. As of now, I basically using it as a zero-lag awesome oscillator....as it appears to be just that. Adding in the Reflex has been very helpful thru analyzing the divergences.
repsolal
Would it be possible to change settings or edit scripts to show solid color below/above threshold levels and a different solid color when not above/below threshold levels ?
ie: green when 0 to 1 and blue when above 1
red when 0 to -1 and orange when below -1
ImmortalFreedom
@repsolal, I thought about that, but I'm saving it for later... It requires more messy logic to accommodate thresholds. I'm confident it is very possible to achieve, because I already did it once years ago. We didn't have a gradient fill() back then though.
repsolal
@ImmortalFreedom, I experimented......... adding a 2nd slower Osc and added a crossover line for each, using the Lorenzian kernel regression
drive.google.com/file/d/1-k4So8045L-F7vR5K2lyFK87momGoCMU/view?usp=sharing
Mer