Skip to content

Instantly share code, notes, and snippets.

@alphazwest
Created November 29, 2021 23:21
Show Gist options
  • Save alphazwest/3e808abcf872edbef8f4513a44b7a24a to your computer and use it in GitHub Desktop.
Save alphazwest/3e808abcf872edbef8f4513a44b7a24a to your computer and use it in GitHub Desktop.
# Get High/Low for each period
daily_ranges = [d[1] / d[0] for d in data]
# Get SMA of daily Ranges
sma = mean(daily_ranges)
# Calculate
modified_adr = 100 * (sma - 1)
>>> 85.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment