Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 17:37:00 +0000



Post From: EWMA and VWEMA

[2023-04-20 12:08:53]
User411320 - Posts: 289
anyway the EWMA and VWEMA can be put into Sierra?

https://corporatefinanceinstitute.com/resources/capital-markets/exponentially-weighted-moving-average-ewma/

//@version=4

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RezzaHmt

//...VWEMA...
study(title="Volume Weighted Exponential Moving Average", shorttitle="VWEMA", overlay=true, resolution="")

period = input(34, minval=1, title="Period")
simulate = input(false, title="Simulative Volume")
src = input(hlc3, title="Source")
offset = input(title="Offset", type=input.integer, defval=0, minval=-500, maxval=500)

vol = if simulate
abs(close - close[1])
+ abs(high - max(open, close)) * 2
+ abs(min(open, close) - low) * 2
else
volume

out = ema(src * vol, period) / ema(vol, period)

plot(out, title="VWEMA", color=color.blue, linewidth=2, offset=offset)