Hi,
I’m trying to display the % difference of a stock on grafana.
Here’s the queries that return the daily % variation.
Values are parsed from a csv file by telegraf:
|timestamp|open|high|low|close|volume|
|2020-12-01|123.9|125.83|123.08|123.16|5099334|
|2020-11-30|124.1|125|123.09|123.52|5987991|
|2020-11-27|124.2|125.313|123.91|124.35|2091186|
|2020-11-25|122.93|124.33|122.11|124.2|4135894|
SELECT (close / open) - 1 AS "calculated_percentage" FROM "stock" WHERE $timeFilter tz('America/New_York')
This query is working for the daily % variation between open and close.
I would like to be able to aggregate with cumulative_sum to know the total variation between 2 selected date.
When I try to add cumulative_sum around the (close / open) that didn’t work.
Any idea?
R,
xk3tchuPx