KVO - Klinger Volume Oscillator [Custom Command]

stable
By Bunka in Oscillators Published March 2022 👁 1,250 views 💬 0 comments

Description

Klinger Volume Oscillator (KVO) The Klinger Oscillator (KO) was developed by Stephen J. Klinger. Learning from prior research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Mr. Klinger set out to develop a volume-based indicator to help in both short- and long-term analysis. The KO was developed with two seemingly opposite goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security. The KO is based on the following tenets: Price range (i.e. High - Low) is a measure of movement and volume is the force behind the movement. The sum of High + Low + Close defines a trend. Accumulation occurs when today's sum is greater than the previous day's. Conversely, distribution occurs when today's sum is less than the previous day's. When the sums are equal, the existing trend is maintained. Volume produces continuous intra-day changes in price reflecting buying and selling pressure. The KO quantifies the difference between the number of shares being accumulated and distributed each day as "volume force". A strong, rising volume force should accompany an uptrend and then gradually contract over time during the latter stages of the uptrend and the early stages of the following downtrend. This should be followed by a rising volume force reflecting some accumulation before a bottom develops. USAGE: kvo_all = CC_KVO(CurrentInterval(),13,34,55,PriceMarket(),true) kvo = kvo_all[1] kvo_trigger = kvo_all[2]
HaasScript
-- Author of haasscript version: Bunka

-- Klinger Volume Oscillator (KVO)

-- The Klinger Oscillator (KO) was developed by Stephen J. Klinger. Learning 
-- from prior research on volume by such well-known technicians as Joseph Granville, 
-- Larry Williams, and Marc Chaikin, Mr. Klinger set out to develop a volume-based 
-- indicator to help in both short- and long-term analysis.
-- The KO was developed with two seemingly opposite goals in mind: to be sensitive 
-- enough to signal short-term tops and bottoms, yet accurate enough to reflect the 
-- long-term flow of money into and out of a security.
-- The KO is based on the following tenets:
-- Price range (i.e. High - Low) is a measure of movement and volume is the force behind 
-- the movement. The sum of High + Low + Close defines a trend. Accumulation occurs when 
-- today's sum is greater than the previous day's. Conversely, distribution occurs when 
-- today's sum is less than the previous day's. When the sums are equal, the existing trend 
-- is maintained.
-- Volume produces continuous intra-day changes in price reflecting buying and selling pressure. 
-- The KO quantifies the difference between the number of shares being accumulated and distributed 
-- each day as "volume force". A strong, rising volume force should accompany an uptrend and then 
-- gradually contract over time during the latter stages of the uptrend and the early stages of 
-- the following downtrend. This should be followed by a rising volume force reflecting some 
-- accumulation before a bottom develops.
------------------------------------------------------------

DefineCommand("KVO","Klinger Volume Oscillator - KVO")

local interval = DefineParameter(NumberType,"KVO interval", "KVO inteval", false, InputInterval("KVO interval", 1, "KVO interval", "KVO indicator"))

local TrigLen = DefineParameter(NumberType, "Trigger Length", "Trigger Length", false, Input("Trigger Length", 13, "Trigger Length", "KVO indicator"))
local FastX = DefineParameter(NumberType, "FastX", "FastX", false, Input("FastX", 34, "FastX", "KVO indicator"))
local SlowX = DefineParameter(NumberType, "SlowX", "SlowX", false, Input("SlowX", 55, "SlowX", "KVO indicator"))

local market = DefineParameter(StringType, "Market", "Market", false, Input("Market", PriceMarket(), "Market", "KVO indicator"))

local plot_or_not = DefineParameter(BooleanType, "plot KVO", "enable or disable plot", false, Input("plot KDJ", true, "enable or disable plot", "KVO indicator"))

DefineIntervalOptimization(interval)


local hlc3 = HLCPrices()
local volume = Grab(GetVolume(),0,SlowX*2)

local xTrend = Load("xTrend", HNC(#volume,0))
local volume2 = volume * 100
if hlc3[1] > hlc3[2] then
    xTrend = ArrayUnshift(xTrend, ArrayGet(volume2, 1))
    xTrend = ArrayPop(xTrend)
else
    xTrend = ArrayUnshift(xTrend, -ArrayGet(volume2, 1))
    xTrend = ArrayPop(xTrend)
end

--Save("xTrend",xTrend)

local xFast = EMA(xTrend, FastX)
local xSlow = EMA(xTrend, SlowX)

local xKVO = xFast - xSlow
local xTrigger = EMA(xKVO, TrigLen)

if plot_or_not then
    Plot(6, "KVO", xKVO, Cyan)
    Plot(6, "Trigger", xTrigger, Red)
    PlotHorizontalLine(6,"zero",DarkGray(50),0,Dashed)
end


local results = {
    KVO = xKVO,
    Trigger = xTrigger,
    }
 
DefineOutput(ListDynamicType, results, 'KVO & Trigger lines')
DefineOutputIndex(1,ListNumberType,"KVO","Klinger Volume Oscillator - KVO")
DefineOutputIndex(2,ListNumberType,"Trigger","Trigger, ema over KVO")

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!