What this does
This plug reads a stored simple moving average value from the socket's sma map and adds it to a running price total. It asks the caller for token, today, days_back, and price_running_total. It fires each time the caller runs it, converting days_back into seconds, subtracting that from today to form the lookup timestamp, and reading the sma keyed by token and that timestamp. Computing the offset timestamp and summing by hand risks keying the wrong day and corrupting the accumulated total.
Actions · 5





Related plugs · 8