Kagi is a type of graphic representation that comes from Asia. This type of price chart is distinguished by the fact that one draws a Kagi type graph taking into account only the price. Indeed, even if time is represented on the abscissa axis, the time scale is not linear. This type of chart is convenient to follow the trend.
The horizontal lines have no real meaning, their role is to give continuity to the price. These horizontal lines are called inflection lines.
Two variables stand out with the Kagi, the color and the sense of the lines. These two variables depend on the direction of the market:
There are two methods of using Kagi:
In this indicator you can choose which type of reversal you want: a percentage amount of price , or a fix points/pips amount. Set one of the reversal setting to 0 will deactivate it to use the other one.
//PRC_Kagi on price chart | indicator
//05.09.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
// select one of the two possible setting (0=don't use)
ReversalAmountPercent = 1.5 //amount of price percent to inverse Kagi trend
ReversalAmountPoints = 0 //amount of points to inverse Kagi trend
// --- end of settings
once kagi=close
if ReversalAmountPercent>0 then
//percent retracement
pup = (close-kagi)/kagi
pdn = (kagi-close)/kagi
InvDec = 1/0.1
//bullish reversal
if pup>=ReversalAmountPercent/100 then
coeff = abs(pup/ReversalAmountPercent)*100
coeff = round(InvDec*coeff-0.5)/InvDec
kagi=kagi+(kagi*(ReversalAmountPercent/100)*coeff)
r=0
g=255
endif
//bearish reversal
if pdn>=ReversalAmountPercent/100 then
coeff = abs(pdn/ReversalAmountPercent)*100
coeff = round(InvDec*coeff-0.5)/InvDec
kagi=kagi-(kagi*(ReversalAmountPercent/100)*coeff)
r=255
g=0
endif
endif
if ReversalAmountPoints>0 then
//points retracement
pup = close-kagi
pdn = kagi-close
InvDec = 1
//bullish reversal
if pup>=ReversalAmountPoints*pointsize then
coeff = (pup/pointsize)/ReversalAmountPoints
coeff = round(InvDec*coeff-0.5)/InvDec
kagi=kagi+(ReversalAmountPoints*pointsize)*coeff
r=0
g=255
endif
//bearish reversal
if pdn>=ReversalAmountPoints*pointsize then
coeff = (pdn/pointsize)/ReversalAmountPoints
coeff = round(InvDec*coeff-0.5)/InvDec
kagi=kagi-(ReversalAmountPoints*pointsize)*coeff
r=255
g=0
endif
endif
RETURN Kagi coloured(r,g,0) style(line,3)