Example: The trading range (in points) for each of the last 5 trading days for asset A is: 5,21,2,15,32 and for asset B is: 5,6,5,5,5. Is there an indicator that ranks assets based on variation of trading ranges over a certain time period? (I don’t mean average).

P.S: Not for predictive purposes, just to identify historical characteristics of certain assets.


1 Answer 1


In this case, you could consider the quadratic variation of the asset price paths to indicate trading range. By quadratic variation, I make reference to the mathematics used in Stochastic Calculus, which is compute path-by-path (Steven E. Shreve, 2008).


Using your example above, Asset A variation is calculated as 1075 whereas Asset B variation is 2.

import numpy as np

# Quadratic Variation
quadratic_variation = lambda x: np.square(x[:-1]-x[1:]).sum()

asset_A = np.array([5,21,2,15,32])
asset_B = np.array([5,6,5,5,5])

variation_A = quadratic_variation(asset_A)
variation_B = quadratic_variation(asset_B)

  • $\begingroup$ Thanks for that answer. Yes, but what I asked about is variation of given ranges. An indicator that would show me that asset B have a more consistent daily range value of 5, so the variation is almost to zero. Asset A has a large variation in each day range, so it’s variation would be far from zero. @ASX Portfolio $\endgroup$
    – user59094
    Oct 1, 2021 at 10:33
  • $\begingroup$ With that same example in my question, the ATR would give me a value of around 5(in points) for asset B and that’s not what I am looking for. Instead I expect an answer close to 0(in points). $\endgroup$
    – user59094
    Oct 1, 2021 at 10:37
  • $\begingroup$ Another example: Asset C has the following weekly trading ranges for each of the last 5 weeks as: week1: 10pips, week2: 10.5pips, week3: 10pips, week4: 9.5pips, week5: 10pips. If I was to use the ATR, the indicator would show me 10pips because that is the average range over the last 5 weeks. Instead I expect the indicator to show a value of approximately 0pips, because there is almost no variations in trading range. I apologize if my initial question was not clear enough. I believe it’s clear now, right? @ASX Portfolio $\endgroup$
    – user59094
    Oct 1, 2021 at 10:46
  • $\begingroup$ @immediate_blood hopefully my ammended answer helps. $\endgroup$ Oct 1, 2021 at 11:30
  • $\begingroup$ Thanks. It did. $\endgroup$
    – user59094
    Oct 1, 2021 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.