Kagi on price chart

Category: Indicators By: Nicolas Created: September 5, 2019, 1:54 PM
September 5, 2019, 1:54 PM
Indicators
12 Comments

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:

  • The line is again in the same direction and the same color as the previous line when prices go in the same direction.
  • The color remains the same, but the direction of the line is opposite when the prices exert a reversal of a fixed amount in advance (we speak of threshold of reversal).
  • The color and the direction of the line change when there is a break of a lower or higher observed in the past.

There are two methods of using Kagi:

  1. We buy when there is a turnaround and sell when there is a downturn. In other words, color changes are buying and selling signals.
  2. We expect confirmation of two or three breaks higher or lower after a change of color to switch to the long or short order.

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)

 

Download
Filename: PRC_Kagi-on-price-chart.itf
Downloads: 402
Download
Filename: kagi-on-price-chart-prorealtime.png
Downloads: 114
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...