EWOk: Elliot Wave Oscillator

stable
By Kobalt in Oscillators Published June 2020 👁 1,900 views 💬 0 comments

Description

https://www.tradingview.com/script/uculwCTj-Indicator-ElliotWave-Oscillator-EWO/ -- [LazyBear] Elliot Wave Oscillator -- Converted by pshai/SMA_Re-EMAnated by kobalt
HaasScript
-- [LazyBear] Elliot Wave Oscillator
-- Converted by pshai/SMA_Re-EMAnated by kobalt

DefineCommand('EWOkEMA', 'LB_EWO_Elliot_Wave_Oscillator, EMA')
-- Define command parameters.
local chartIndex = DefineParameter(NumberType, 'chartIndex', 'The index on which to chart', true, 0, 'Number')
local name = DefineParameter(StringType, 'name', 'Unique name of the indicator.', false, 'LB_EWOk', 'Text')
local interval = DefineParameter(NumberType, 'interval', 'Used interval for price data. Default is 0 and the main interval will be used.', false, 0, 'Number,InputInterval')

-- This will improve our backtest speed when using the command.
DefineIntervalOptimization(interval)

-- Input fields for the indicator. Tip: spacing can be used to sort your menu items from top to bottom add an extra space for each item (bottom no space then z,x,y also no space,EWOk,     Interval places Interval above EWOk 
local length1 = Input("  EWOk Fast Period Length", 5,'','EWOk')
local length2 = Input(" EWOk Slow Period Length", 35,'','EWOk')
local interval = InputInterval('   Interval',6,'','EWOk')
--local bsignal = InputSignalTypes('signal', IndicatorCenterCrossType,'','EWOk')
local close = ClosePrices(interval)
local s2 = EMA(close, length1) - EMA(close, length2)
local l1 = Plot(1, "EWOk", s2, Green)
PlotHistogram(l1, Red, true)

--if IsRising(s2, 3) then
   -- DoBuy()
--elseif IsFalling(s2, 3) then
   --DoSell()
--end

DefineOutput(NumberType,s2)

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!