This script adds an aggregate input to Supertrend to provide a Supertrend that approximates a higher time frame, but updates on the current time frame and therefore is more responsive.
The aggregate input acts as a multiplier on the current time frame, so an aggregate of 4 on a 1h chart would approximate a supertrend with the same parameters on a 4h chart by aggregating the last 4 bars into one bar.
The aggregate input acts as a multiplier on the current time frame, so an aggregate of 4 on a 1h chart would approximate a supertrend with the same parameters on a 4h chart by aggregating the last 4 bars into one bar.