ChrisMoody

CM_Laguerre PPO PercentileRank - Markets Topping

Custom Code that Finds Market Tops!!!

CM_Laguerre PPO PercentileRank - Markets Topping

Original Laguerre PPO code was Created by TheLark.

I found if I applied a Percent Rank of the PPO to view Extreme Moves in the PPO it was great at showing Market Tops.

Features via Inputs Tab:
Ability to set all PPO Indicator Values.
Ability to set Warning Threshold Line Value and Extreme Percentile Threshold Line Values.
Ability to turn On/Off Warning and Extreme Percentile Rank Lines.

***I’ve found this Indicator to be Valid…However, I have NOT Extensively tested the Settings. Initially setting the LookBack Period to 200 on A Daily chart with a 90 Extreme Percentile Rank Value works Good. Some charts changing the Lookback period to 50 an draisisng the Extreme Percentile Rank Line to 95 Works Great.

***To Be Blunt…When I look at the underlying Indicator…I don’t know why this Shows Us What It Does When the Percentile Rank Function is applied to it…But For Whatever Reason…It Just Works.

***If you Find Very Useful Settings Please Post Below

Other Indicators That Show Market Bottoms Well.

CM             ATR PERCENTILERANK - GREAT FOR SHOWING MARKET BOTTOMS!
CM ATR PercentileRank - Great For Showing Market Bottoms!


GREAT CONFIRMING INDICATOR FOR THE WILLIAMS VIX             FIX
Great Confirming Indicator For The Williams Vix Fix


TWO TRADING SYSTEMS - BASED ON EXTREME MOVES!!!
Two Trading Systems - Based on Extreme Moves!!!

Remove from Favorite Scripts Add to Favorite Scripts
//Created by ChrisMoody on 10/28/2014...Original PPO Code Created by TheLark
//Great for Spotting Tops.
study(title = "CM_Laguerre PPO PercentileRank", overlay=false)
pctile = input(90, title="Percentile Threshold Extreme Value, Exceeding Creates Colored Histogram")
wrnpctile = input(70, title="Percentile Threshold Warning Value, Exceeding Creates Colored Histogram")
Short = input(0.4, title="PPO Setting")
Long = input(0.8, title="PPO Setting")
lkb = input(200,title="Look Back Period Percent Rank is based off of?")
sl=input(true,title="Show Threshold Line?")
swl=input(true,title="Show Warning Threshold Line?")

//Laguerre PPO Code from TheLark
lag(g, p) =>
    L0 = (1 - g)*p+g*nz(L0[1])
    L1 = -g*L0+nz(L0[1])+g*nz(L1[1])
    L2 = -g*L1+nz(L1[1])+g*nz(L2[1])
    L3 = -g*L2+nz(L2[1])+g*nz(L3[1])
    f = (L0 + 2*L1 + 2*L2 + L3)/6
    f
lmas = lag(Short, hl2)
lmal = lag(Long, hl2)
//PPO Plot
ppo = (lmas - lmal)/lmal*100
//PercentRank of PPO 
pctRank = percentrank(ppo, lkb)
//Color Definition of Columns
col = pctRank >= pctile ? red : pctRank >= wrnpctile and pctRank < pctile ? orange : gray
//Plot Statements.
plot(pctRank,title="Percentile Rank Columns", color=col,style=columns,linewidth=2)
plot(sl and pctile ? pctile : na, title="Extreme Move Percentile Threshold Line", color=red, style=linebr, linewidth=4)
plot(swl and wrnpctile ? wrnpctile : na, title="Warning Percentile Threshold Line", color=orange, style=line, linewidth=4)
Which one you find the best to predict bottoms/entry points? Gann?
Reply
Go To The Link under Related Ideas...On that page I added Links to Market Bottom Indicators
+1 Reply
ChrisMoody PRO ChrisMoody
Hadn't seen coondawg 71's post below yet...Combining Both Indicators might be the best alternative.
+1 Reply
2use ChrisMoody
I know which you coded, but i wonder which ones YOU like the most /or find work best on stocks?:)
Reply
Laguerre is great! Add if users wish to use this same indicator for bottoms....we can alter line 23 regarding ppo plotting. Just reverse the equation to "(lmal - lmas)". Thanks Chris for another useful indicator! Love the way your mind works, always thinking, always tinkering.
+2 Reply
snapshot


Here is my understanding of how to utilized this tool. What we are trying to do is trade one extreme to another by utilizing the PPO oscillators ability to highlight extremes. NOT when the extreme begins, but when it ENDS. So look at where the highlights cross back towards the mean and that is where I would enter a trade. Much like a stochastic signal but smoother. See arrows on chart are based on extreme signals changing direction.
+5 Reply
2use coondawg71
Interesting! Cant this be made into one indicator?
Reply
ChrisMoody PRO coondawg71
OUTSTANDING FIND!!! Using Both Versions Hits Tops and Bottoms!!! We should code both and a Upper Indicator Plotting Arrows Showing Upside and Downside entries
+1 Reply
coondawg71 PRO ChrisMoody
Thanks! But I'm no Coder, I'm a Idea/Concept guy. Signals would be great. One notation to make would be this...value of the PPO would have to Close outside the extreme threshold, not just touch it, that would be a false signal. Example of this would be the False Top given just after the beginning of 2013.
Reply
ChartArt coondawg71
This is so simple, yet genius! Although in my test it seems it works better finding tops than bottoms. Here is comparison. Bad signals are marked in red and good signals are marked in green:

snapshot
Reply
ChartArt ChartArt
The inverted PPO seems to be at least more reliable to find bottoms than the VIX Fix:

snapshot
+1 Reply
15 of 21 is a pretty nice ratio! Nice work.
+2 Reply
ChartArt coondawg71
I didn't even count and calculate it. With those numbers this example would have been 71% accurate. Which is ok, but I always search for 100% :D
Reply
Man more than 50% is amazing...what you talkin bout? :p
Reply
ChartArt IvanLabrie
More than 50% is easy. More than 90% is hard.
Reply
Then you are rich by now :p
I've gotten an awful lot of correct directional predictions yet trading them is not as easy as it may appear.
With that being said, proper tools like this one are a nice thing to have.
+1 Reply
ChartArt IvanLabrie
Easier said than done... But as you say, good tools can help having fewer losing trades.
+1 Reply
Still experimenting with this one, it's rather interesting, seems really good. :D
Reply
2use ChartArt
If even possible
Reply
2use ChartArt
Nice testing - but did you test with different values? ill try to do that combining some other to see if i can get a better ratio
Reply
Yes I did and some other values are better. But with Laguerre I never found a optimal setting so far in the last months, it's much harder to fine-tune than classic periods.
Reply
And that is just straight up PPO signals. throw a 200 smoothed simple average on there and see what you can weed out. Or better yet get stronger signals by increasing your extreme threshold to a higher number including up to 99, that will throw out a lot of noise.
Reply
ChartArt coondawg71
In that high area I also got better signals. It misses some opportunities then, but the noise is also reduced a lot. But I also noticed that it's starts lagging much more with higher numbers. The highlighting areas get more precise in terms of smaller, but also farther away from the optimal entry/exit.
Reply
I tried with a 44 day lookback for forex, in the daily chart...you'll have to ignore a few tops in a row with a trend following indicator, or going by the absence of signaled bottoms in the reverse PPO thing. Great stuff :D
Reply
gatorNic coondawg71
How are you getting the inverse PPO chart? not sure I am seeing the code or where you would switch the settings
Reply
Oh boy, you just created a dream indicator. Let's see how popular this gets on Tradingview.
+1 Reply
ChartArt ChartArt
I wonder if your version of the PPO with Laguerre from TheLark works better than this version from pekipek without this filter:

Pekipek
+1 Reply
No idea...all I can say is I Vouch for TheLark's Skills. I have Laguerre PPO on another platform...later I'll see if TheLarks version matches up perfectly...My guess is his will
Reply
ChartArt ChrisMoody
Here is a simple comparison. The Laguerre filter ... filters out more noise:

snapshot
Reply
With coondawg71's find above...It could be great
Reply
ShaunP ChartArt
wow... That looks amazing well done Chris!
Reply
Thanks....Great collaboration with coondawg71's find.
+2 Reply
coondawg71 PRO ChrisMoody
snapshot


So I wanted to dig a little deeper to see if we can be more precise with entries. I added a few indicator panels for comparison sake. I commonly use CCI indicator for precise entries upon values that close beyond +-200 barriers, especially once the CCI value exits those zones. Then we have Willams %R (Wpr) and Zscore which really smooths price values and is great for confirmation. I set the Laguerre PPO indicator to a maximum setting of 99 so we can illustrate exactly what we want, extremes, especially since this version of the indicator has a built in warning trigger we might as well keep the 99 setting in play. I apologize for all the chart notations but hopefully you will see it as the "picture speaks a thousand words" manner of explaining the situations. I see that we can utilized Laguerre PPO in a few different manners. On its own, it works very very well with solid signals as expected. Using additional filters for signal confirmation does prove useful. Especially using Wpr as a tool to pick out divergence opportunities. Buy/Sell vertical markers on the price chart: broken green means Extreme Signal start, solid green Extreme Signal end for Buy and vice versa for red markers indicating Sell. Corresponding check marks indicate signal has been confirmed by one of the lower indicator panels and these are obviously the best signals. There are two highlighted areas in the price panel which are colored with ellipses due to the fact the Wpr indicator showed a divergence/signal that was not confirmed by any of the other indicators. These are actionable as signals. Compare the readings of Wpr and CCI to the PPO and we see several points of interest. In conclusion, I believe Wpr would be a good option to add in future coding for confirmation of PPO signals as well as offering Divergent signals which very well may occur between our ideal Buy/Sell PPO signals and it will help decipher the difference between the two.
+5 Reply
2use coondawg71
is ...that a buy in crude oil :)?
Reply
We have ENTERed an Extreme zone....so this would be a heads up. Exiting the zone would be a true signal.
+2 Reply
2use coondawg71
On which indicator Inv-Laguerre or z-score?
Reply
All four. And its really hard to Zscore to get to these extremes. But notice how WPR is hanging out in the Oversold zone for quite a while, that is a lot of selling taking place.
Reply
coondawg71 PRO coondawg71
But given what BOJ just announced....markets will need to rebalance
Reply
2use coondawg71
Well, they all went up like hot cakes. I don't see any market in red...and this is after such a rally. Pity ive sat on my hands
Reply
This will make a great combo with your bottom picker indicator.
Reply
AndrewFaulkner AndrewFaulkner
Also, the laguerre filter works really well in all timescales due to the fact it filters smoothly even on very few bars.
Reply
Thanks Guys....Here is new Indicator...More to come...

CM_Laguerre PPO PercentileRank Mkt Tops & Bottoms
+2 Reply
ChrisMoody PRO ChrisMoody
snapshot
+1 Reply
IvanLabrie PRO ChrisMoody
Looks great!
Reply
ChrisMoody PRO IvanLabrie
No Problem...my contribution was small on this one
Reply
Alphaoptions ChrisMoody
Really nice. I am a new user so I may be incorrect, but it appears the format Input for the Percentile Threshold seems to only adjust the colored histogram above the zero line. Is there a way to adjust the one below the line. Also have you experimented with a shorter look back period? Does it make it more accurate / sensitive to the turns or do you need the longer period?
Reply
ChrisMoody PRO Alphaoptions
If your speaking of the new indicator I posted today...when you adjust the Percentile Threshold it adjusts the top and bottom.. The only input that you can set different for both is the Lookback period. As far as settings...adjsut and see...on a daily chart I set default to 200 b/c that's almost a year. shortening them will give more signals. Remember...Indicator is designed to filter out only the Top Percentile of Extreme Moves...so be careful not to plot too many signals. Lowering the Look back period and lowering the Thresholds will both give more signals.

If you trade one or two markets I would say adjust to your liking. If you trade several markets leave the settings as strict as possible...and only take the EXTREME Moves...
Reply
Alphaoptions ChrisMoody
Thank you.
Reply
Alphaoptions ChrisMoody
Create visuals. Is there a link to make the updated version here as a favorite?
Reply
Alphaoptions Alphaoptions
I found it - great work
Reply
rahulanand ChrisMoody
hello sir
in my system vertical lines are not coming in the price graph as shown above and where to enter & exist is not clear w/o that line,since histogram only gives the range.
could you help me???????
Reply
2use ChrisMoody
Wow, thanx!
Reply
Any Time
+1 Reply
coondawg71 PRO ChrisMoody
Thanks for the acknowledgement Chris, glad I could help in something that will be really useful for Trading View!
+1 Reply
ChrisMoody PRO coondawg71
You did more than help...you created it...All I did was add the inverted histogram so it wouldn't be so cluttered up...Great Job
Reply
Great implementation man!
+1 Reply
Hey guys...it's TheLark AKA The Coding Genius. Who wrote the Original code. Without you man...none of this would have been possible
+2 Reply
Hey would you please tell me where can I get the codes for mt4 platform?
Reply
Hi everyone!
I'm hoping someone can explain why nz is used in this code?

L0 = (1 - g)*p+g*nz(L0)
L1 = -g*L0+nz(L0)+g*nz(L1)
L2 = -g*L1+nz(L1)+g*nz(L2)
L3 = -g*L2+nz(L2)+g*nz(L3)

Thanks in advance!
Reply
JohanVanNiekerk JohanVanNiekerk
Thanks, figured it out...
Reply
Incredible mate. This indicator really helped me get out of a trade before it reversed. Thanks Chris. When I'm rich from trading I'll be sending you a nice donation for all your generous work.
PS: If there is any more info on this indy I'd love to read up on it please.
Reply
DimiAverilla DimiAverilla
Sorry Chris I meant to put this reply into the CM_Laguerre PPO PercentileRank V2 Mkt Tops & Bottoms page!
CM_Laguerre PPO PercentileRank Mkt Tops & Bottoms
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out