vendettaMoving Average Indicator
Updated 2023-02-17
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- forked from 0abc5464-d852-47b4-9fe5-9c1f6d0c295f
WITH avalanche_Price AS
(
SELECT
date_trunc('day', HOUR) as timestamps,
AVG(PRICE) as avax_Price
FROM
ethereum.core.fact_hourly_token_prices
WHERE
SYMBOL = 'WAVAX'
GROUP BY
1
),
moving_avg_50 AS
(
SELECT
timestamps,
'moving_Avg_50' as timeline,
AVG(SUM(avax_Price)) over (order by
timestamps rows between 50 PRECEDING
and current row) as moving_Avg_50
FROM
avalanche_Price
WHERE
timestamps >= CURRENT_DATE - 50
GROUP BY
1
),
moving_avg_20 AS
(
SELECT
timestamps,
'moving_Avg_20' as timeline,
Run a query to Download Data