Any one correct this afl...

#1
Any one correct this afl

Thanks in advance

//Created by ChrisMoody on 11/03/2014...Original PPO Code Created by TheLark
//Thanks to coondawg71 and ChartArt for Great Insights
//Great for Spotting Tops & Bottoms.
Study(Title = "CM_Laguerre PPO PercentileRank Mkt Tops & Bottoms", shorttitle="CM_Laguerre PPO PctRank Tops-Bottoms", overlay=False, precision=1) 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")
lkbT = input(200,Title="Look Back Period For 'Tops' Percent Rank is based off of?")
lkbB = input(200,Title="Look Back Period For 'Bottoms' 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)

pctileB = pctile * -1
wrnpctileB = wrnpctile * -1

//PPO Plot
ppoT = (lmas-lmal)/lmal*100
ppoB = (lmal - lmas)/lmal*100
//PercentRank of PPO
pctRankT = PercentRank(ppoT, lkbT)
pctRankB = PercentRank(ppoB, lkbB) * -1
//Color Definition of Columns
colT = pctRankT >= pctile ? red : pctRankT >= wrnpctile AND pctRankT < pctile ? orange : gray
colB = pctRankB <= pctileB ? lime : pctRankB <= wrnpctileB AND pctRankB > pctileB ? green : silver
//Plot Statements.
Plot(pctRankT,Title="Percentile Rank Columns", color=colT, 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)

Plot(pctRankB,Title="Percentile Rank Columns", color=colB, style=columns, linewidth=2)
Plot(sl AND pctileB ? pctileB : na, Title="Extreme Move Percentile Threshold Line", color=lime, style=linebr, linewidth=4)
Plot(swl AND wrnpctileB ? wrnpctileB : na, Title="Warning Percentile Threshold Line", color=green, style=line, linewidth=4)
Plot(0, Title="0 Line Circles Plot", style=circles, linewidth=4, color=silver)
Plot(0, Title="0 Line-Line Plot", style=linebr, linewidth=4, color=gray)
 

mastermind007

Well-Known Member
#2
This code is not AFL
 

Similar threads