Ehlers Reflex Indicator [CC]The Reflex Indicator was created by John Ehlers (Stocks and Commodities Feb 2020) and this is a zero lag indicator that works similar to an overbought/oversold indicator but with the current stock cycle data. I find that this indicator works well as a leading indicator as well as a divergence indicator. Generally speaking, this indicator indicates a medium to long term downtrend when the indicator is below the line and a medium to long term uptrend when the indicator is above the line. Ehlers has created a few complementary indicators that I will release in the next few days but just keep in mind that this indicator focuses on the underlying cycle component while removing as much noise with no lag. I have color coded the lines to show strong signals with the darker colors and normal signals with the lighter colors. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Trendflex
Medium Term Weighted Stochastic (STPMT) by DGTLa Stochastique Pondérée Moyen Terme (STPMT) , or Mᴇᴅɪᴜᴍ Tᴇʀᴍ Wᴇɪɢʜᴛᴇᴅ Sᴛᴏᴄʜᴀꜱᴛɪᴄꜱ created by Eric Lefort in 1999, a French trader and author of trading books
█ The STPMT indicator is a tool which concerns itself with both the direction and the timing of the market. The STPMT indicator helps the trader with:
The general trend by observing the level around which the indicator oscillates
The changes of direction in the market
The timing to open or close a position by observing the oscillations and by observing the relative position of the STPMT versus its moving average
STPMT Calculation
stpmt = (4,1 * stoch(5, 3) + 2,5 * stoch(14, 3) + stoch(45, 14) + 4 * stoch(75, 20)) / 11.6
Where the first argument of the stoch function representation above is period (length) of K and second argument smoothing period of K. The result series is then plotted as red line and its moving average as blue line. By default disabled gray lines are the components of the STPMT
The oscillations of the STPMT around its moving average define the timing to open a position as crossing of STMP line and moving average line in case when both trends have same direction. The moving average determines the direction.
Long examples
█ Tʜᴇ CYCLE Iɴᴅɪᴄᴀᴛᴏʀ is derived from the STPMT. It is
cycle = stpmt – stpmt moving average
It is indicates more clearly all buy and sell opportunities. On the other hand it does not give any information on market direction. The Cycle indicator is a great help in timing as it allows the trader to more easily see the median length of an oscillation around the average point. In this way the traders can simply use the time axis to identify both a favorable price and a favorable moment. The Cycle Indicator is presented as histogram
The Lefort indicators are not a trading strategy. They are tools for different purposes which can be combined and which can serve for trading all instruments (stocks, market indices, forex, commodities…) in a variety of time frames. Hence they can be used for both day trading and swing trading.
👉 For whom that would like simple version of the Cycle indicator on top of the main price chart with signals as presented below.
Please note that in the following code STMP moving average direction is not considered and will plot signals regardless of the direction of STMP moving average. It is not a non-repainting version too.
here is pine code for the overlay version
// © dgtrd
//@version=4
study("Medium Term Weighted Stochastic (STPMT) by DGT", "STPMT ʙʏ DGT ☼☾", true, format.price, 2, resolution="")
i_maLen = input(9 , "Stoch MA Length", minval=1)
i_periodK1 = input(5 , "K1" , minval=1)
i_smoothK1 = input(3 , "Smooth K1", minval=1)
i_weightK1 = input(4.1 , "Weight K1", minval=1, step=.1)
i_periodK2 = input(14 , "K2" , minval=1)
i_smoothK2 = input(3 , "Smooth K2", minval=1)
i_weightK2 = input(2.5 , "Weight K2", minval=1, step=.1)
i_periodK3 = input(45 , "K3" , minval=1)
i_smoothK3 = input(14 , "Smooth K3", minval=1)
i_weightK3 = input(1. , "Weight K3", minval=1, step=.1)
i_periodK4 = input(75 , "K4" , minval=1)
i_smoothK4 = input(20 , "Smooth K4", minval=1)
i_weightK4 = input(4. , "Weight K4", minval=1, step=.1)
i_data = input(false, "Components of the STPMT")
//------------------------------------------------------------------------------
// stochastic function
f_stoch(_periodK, _smoothK) => sma(stoch(close, high, low, _periodK), _smoothK)
//------------------------------------------------------------------------------
// calculations
// La Stochastique Pondérée Moyen Terme (STPMT) or Medium Term Weighted Stochastics calculation
stpmt = (i_weightK1 * f_stoch(i_periodK1, i_smoothK1) + i_weightK2 * f_stoch(i_periodK2, i_smoothK2) + i_weightK3 * f_stoch(i_periodK3, i_smoothK3) + i_weightK4 * f_stoch(i_periodK4, i_smoothK4)) / (i_weightK1 + i_weightK2 + i_weightK3 + i_weightK4)
stpmt_ma = sma(stpmt, i_maLen) // STPMT Moving Average
cycle = stpmt - stpmt_ma // Cycle Indicator
//------------------------------------------------------------------------------
// plotting
plotarrow(change(sign(cycle)), "STPMT Signals", color.green, color.red, 0, maxheight=41)
alertcondition(cross(cycle, 0), title="Trading Opportunity", message="STPMT Cycle : Probable Trade Opportunity {{exchange}}:{{ticker}}-> Price = {{close}}, Time = {{time}}")
[blackcat] L2 Ehlers Trendflex CrossLevel: 2
Background
John F. Ehlers introuced Trendflex indicator in Feb, 2020.
Function
In “Reflex: A New Zero-Lag Indicator” in Feb, 2020, John Ehlers introduces a new averaging indicator that he has designed with reducing lag in mind. According to the Dr. Ehlers, this new indicator can be used to generate signals in a more timely manner than other lagging calculations. The script displays the trendflex indicator discussed in the article. The reflex indicator synchronizes with the cycle component in the price data. Its companion, the trendflex oscillator, retains the trend component.
Key Signal
FastTF --> Ehlers Trendflex fast line
SlowTF --> Ehlers Trendflex slow line
Pros and Cons
100% John F. Ehlers definition translation, even variable names are the same. This help readers who would like to use pine to read his book.
Remarks
The 94th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
[e2] Reflex & TrendflexNew Indicator from John F. Ehlers issued in the February 2020 Technical Analysis of Stocks and Commodities article "Reflex: A New Zero-Lag Indicator"
This indicator includes both studies described in the article and intend to significantly reduce the lag of the signal compared to other oscillators.
Reflex for the cycle component and is more sensitive to major reversals, Trendflex for the trend component.
Pivot Max range as the borders for top and bottom reading of the indicators (the script will plot separate borders for both components) and divergences were added.
Divergence function is the interpretation of built-in divergence script, optimized the code and added option to show real-time divs (without offset), all credits to ...)
daily*tip: I must say that very quickly I began to realize how fragmented and imperfectly modern economic knowledge is and how little can be taken from fundamental science in terms of practical recipes. (c) Andrey Movchans.
stay safe ;)