Market Profile Examination

quant
trading
Author

Ray Lai

Published

March 8, 2025

1 Understanding distribution of price of Selected ETFs

The measurement of distribution of price is very important in price analysis, as it can tell us at what range the asset class is trading with certain confidence interval. We can also examine whether the market is range-bound or trending by examining the skewness of the distribution.

The objective of doing price distribution analysis is to know what to expect.

  • If QQQ today is $500, we would have a higher level of confidence that it will fall between $200 to $700, but less confidence that it will fall $400 to $600.

  • We can also know which prices are mostly traded at different timeframe, and usually these prices will be close to support or resistance. The most frequent occurrences are at the price where supply and demand are balanced, also known as equilibrium.

This post aims to use this techniques to analyse my selected universe of trading for my algo strategies. I am trying to replicate the methodology on Trading Systems and Methods, 5th Edition (Ch. 2). To start simple, I will collect the data and plot the histogram of the following:

  • 1-month (30-day) closing price histogram - Day bar

  • 1-year closing price histogram - Day bar

  • 5-year closing price histogram - Week bar

  • 10-year closing price histogram - Week bar

1.1 Selection of ETFs

My goal is to cover all the asset classes with either ETFs or futures. My selection are as follow:

  • Equity:

    • US: IYY, SPY, QQQ, IWM

    • Asia: FXI, EWJ, VNM, INDA, EWY, EWT

    • Europe: EWQ, EWI, EWG, EWU

    • South America: ARGT, EWW, EWZ

    • Emerging markets: ACWX, EEM

  • Bonds: SHY(1-3 years TBond), TLT (20+ Year Treasury Bond)

  • Commodities: GC, SI, HG, CL, NG, HO, RB, CT, ZC, ZS, ZL, ZW, SB

  • Forex: 6A, 6B, 6C, 6E, 6J, 6S, 6N, DX

Code
build_histograms <- function(symbol) {
  tk <- Ticker$new(symbol)
  tk_6m <- tk$get_history(period = "6mo", interval = '1d') %>% mutate(chart = "6m")
  tk_1y <- tk$get_history(period = "1y", interval = '1d')  %>% mutate(chart = "1y")
  tk_5y <- tk$get_history(period = "5y", interval = '1d')  %>% mutate(chart = "5y")
  tk_10y <- tk$get_history(period = "10y", interval = '1wk') %>% mutate(chart = "10y")
  
  all <- tk_6m %>%
    rbind(tk_1y) %>%
    rbind(tk_5y) %>%
    rbind(tk_10y)
  
  
  cat("### Price Chart \n\n")
  
  print(ggplot(as.data.frame(all), aes(x = date, y = close)) +
                              geom_line() +
                              theme_ipsum() + 
                              facet_wrap(~ chart, scales = 'free'))
  cat("\n\n")
  
  cat("### Price Distribution \n\n")

  print(ggplot(as.data.frame(all), aes(x = close)) +
          geom_histogram(bins = 20, fill="#69b3a2", col="#e9ecef", alpha=0.6) +
          labs(x="Close Price", y="Frequency of price",
               title=sprintf("Frequency distribution of %s", symbol)) +
          theme_ipsum() + 
          facet_wrap(~ chart, scales = "free"))

  cat("\n\n")

}

2 US Equity

Let’s first take a look at US equity indices. As we can see from the Long term 10-year plot, the equity market is a long trending market. I am not sure it would be right to see the Long term distribution in this way, or instead we should normalise it with price/earnings (P/E ratios) to adjust the “inflation”

2.1 IYY

2.2 SPY

2.3 QQQ

2.4 IWM

3 Asia

3.1 FXI (China)

3.2 EWJ (Japan)

3.3 VNM (Vietnam)

3.4 INDA (India)

3.5 EWY (Korea)

3.6 EWT (Taiwan)

4 Europe

4.1 EWQ (France)

4.2 EWI (Italy)

4.3 EWG (Germany)

4.4 EWU (UK)

5 South America

5.1 Argentina (ARGT)

5.2 EWW (Mexico)

5.3 EWZ (Brazil)

6 Emerging Markets

6.1 ACWX (Emerging Markets ex China)

6.2 EEM (Emerging Markets)

7 Bonds

The bonds market is an important market as it is traded a lot with institutions. Comparing to the equity market, the bonds market is not a trending market in long term.

7.1 BIL (1-3 year T-Bills)

The T-bill has a very close trading range between 91.3 to 91.8 across all timeframes. It is more common to trade at the range between 91.4 to 91.5.

7.2 SHY (1-3 year Tresury Bonds)

Similarly, the SHY has also a quite tight trading range between $78 to $88. In the last 5 years, the price of SHY slumped from the range of $86 to the range of $82, and trading around this range. In the past 6 months, it is more common to trade between the range of $82 to $82.5, where $82 is the key level.

7.3 TLT

Similar observation for TLT (Long term bonds), where the trading range has been falling from the range of $150 to around $92.

8 Commodities

8.1 Gold

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

8.2 Silver

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

8.3 Copper

8.4 Crude Oil

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

8.5 Natural Gas

8.6 Heating Oil

8.7 Gasoline

8.8 Corn

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

8.9 Soybean

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

8.10 Soybean Oil

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

8.11 Wheat

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

8.12 Sugar

9 Forex

9.1 Australian Dollar (6A)

9.2 British Pound (6B)

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

9.3 Canadian Dollad (6C)

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

9.4 Euro (6E)

Warning: Removed 1 row containing non-finite outside the scale range
(`stat_bin()`).

9.5 Japanese Yen (6J)

9.6 Swiss Franc

9.7 Mexican Peso (6M)

9.8 NZ Dollar (6N)

9.9 USD