Hi all
The code given below is CM_LAGUERRE PPO PERCENTILERANK - MARKETS TOPPING from tradingview.com
I am trying to convert into afl code with partial afl code taken from marketcalls,
Please check it out whether the conversions from trading view code to afl is correct or not
//Tradingview code
pctile = input(90, title="Percentile Threshold Extreme Value, Exceeding Creates Colored Histogram")
sl=input(true,title="Show Threshold Line?")
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)
//Afl code
pctile = 90;
sl=1;
pctRank = percentrank(ppo, lkb);
//Color Definition of Columns
Col=IIf(pctRank >= pctile,colorRed,IIf(pctRank >= wrnpctile and pctRank < pctile,colorOrange,colorGrey50));
//Plot Statements.
plot(pctRank,title="Percentile Rank Columns", color=col,styleHistogram | styleThick);
plot(sl and pctile , title="Extreme Move Percentile Threshold Line", colorred,styleHistogram | styleThick);
plot(swl and wrnpctile , title="Warning Percentile Threshold Line",colorOrange,styleHistogram| styleThick);
It would of big help if anybody can please help
Thank you
Sudha
The code given below is CM_LAGUERRE PPO PERCENTILERANK - MARKETS TOPPING from tradingview.com
Code:
//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)
I am trying to convert into afl code with partial afl code taken from marketcalls,
Please check it out whether the conversions from trading view code to afl is correct or not
//Tradingview code
pctile = input(90, title="Percentile Threshold Extreme Value, Exceeding Creates Colored Histogram")
sl=input(true,title="Show Threshold Line?")
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)
//Afl code
pctile = 90;
sl=1;
pctRank = percentrank(ppo, lkb);
//Color Definition of Columns
Col=IIf(pctRank >= pctile,colorRed,IIf(pctRank >= wrnpctile and pctRank < pctile,colorOrange,colorGrey50));
//Plot Statements.
plot(pctRank,title="Percentile Rank Columns", color=col,styleHistogram | styleThick);
plot(sl and pctile , title="Extreme Move Percentile Threshold Line", colorred,styleHistogram | styleThick);
plot(swl and wrnpctile , title="Warning Percentile Threshold Line",colorOrange,styleHistogram| styleThick);
It would of big help if anybody can please help
Thank you
Sudha