# Variation of the trading range

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.

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).

$$[M,M]_k=\sum^{k}_{j=1}{(M_j-M_{j-1})^2}$$

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

import numpy as np

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

print(variation_A,variation_B)

• 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
– user59094
Oct 1, 2021 at 10:33
• 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).
– user59094
Oct 1, 2021 at 10:37
• 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
– user59094
Oct 1, 2021 at 10:46
• @immediate_blood hopefully my ammended answer helps. Oct 1, 2021 at 11:30
• Thanks. It did.
– user59094
Oct 1, 2021 at 14:50