vendettaMoving Average Indicator
    Updated 2023-02-17
    -- 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