Login Page - Create Account

Technical Studies Reference


Market Structure MSL/MSH

This study identifies Market Structure Lows and Highs on the chart. The bars where these occur will be colored. The color to use is controlled through the Subgraph color settings. You can also optionally show Labels on the bars.

Let \(O_t\), \(H_t\), \(L_t\), and \(C_t\) be the Open, High, Low, and Close Prices, respectively, at Index \(t\). We denote the Market Structure High and Market Structure Low functions at Index \(t\) as \(MSH_t\) and \(MSL_t\), respectively, and we compute them for \(t \geq 2\) as follows.

\(\displaystyle{MSH_t = \left\{ \begin{matrix} 1 & (O_{t - 1} < C_{t - 1} \space and \space O_t < C_t \space and \space O_{t + 1} > C_{t + 1}) \space and \space (H_{t - 1} < H_t \space and \space H_{t + 1} < H_t) \\ 0 & otherwise \end{matrix}\right .}\)

\(\displaystyle{MSL_t = \left\{ \begin{matrix} 1 & (O_{t - 1} > C_{t - 1} \space and \space O_t > C_t \space and \space O_{t + 1} < C_{t + 1}) \space and \space (L_{t - 1} > L_t \space and \space L_{t + 1} > L_t) \\ 0 & otherwise \end{matrix}\right .}\)

The Label at Index \(t\), if there is one, is denoted as \(Label_t\). A bar has a Label only if either \(MSH\) or \(MSL\) has a value of \(1\) at that bar. The possible values of the Labels are \(HH\) (Higher High), \(LH\) (Lower High), \(LL\) (Lower Low), and \(HL\) (Higher Low). These labels are displayed only if the Draw Labels Input is set to Yes. Below we describe in detail how the value of the Label for a given bar is determined.

  • Case 1: \(MSH_t = 1\)

    We enumerate the values of the Index \(t\) at which \(MSH_t = 1\) as \(T^{(MSH)}_i\), where \(i = 1, 2, 3, ...\). The Labels \(HH\) and \(LH\) can only appear at these values of the Index.

    For \(i = 1\), we have \(Label_{T^{(MSH)}_1} = HH\)

    For \(i > 1\), we have the following.

    \(\displaystyle{Label_{T^{(MSH)}_i} = \left\{ \begin{matrix} HH & H_{T^{(MSH)}_{i - 1}} < H_{T^{(MSH)}_i} \\ Label_{T^{(MSH)}_{i - 1}} & H_{T^{(MSH)}_{i - 1}} = H_{T^{(MSH)}_i} \\ LH & H_{T^{(MSH)}_{i - 1}} > H_{T^{(MSH)}_i} \end{matrix}\right .}\)

    The bars with Indices \(T^{(MSH)}_i\) are colored purple by default. If the labels are displayed, then they appear above their corresponding bars at a vertical position \(H_{T^{(MSH)}_i} + \frac{k}{100}\left(H_{T^{(MSH)}_i} - L_{T^{(MSH)}_i}\right)\), where \(k\) denotes the Text Labels Percentage Offset Input.

    If the Display Price Values Input is set to Yes, then the High Price \(H_{T^{(MSH)}_i}\) appears in the Label at Index \(t = T^{(MSH)}_i\)

  • Case 2: \(MSL_t = 1\)

    We enumerate the values of the Index \(t\) at which \(MSL_t = 1\) as \(T^{(MSL)}_i\), where \(i = 1, 2, 3, ...\). The Labels \(LL\) and \(HL\) can only appear at these values of the Index.

    For \(i = 1\), we have \(Label_{T^{(MSL)}_1} = LL\)

    For \(i > 1\), we have the following.

    \(\displaystyle{Label_{T^{(MSL)}_i} = \left\{ \begin{matrix} LL & L_{T^{(MSL)}_{i - 1}} > L_{T^{(MSL)}_i} \\ Label_{T^{(MSL)}_{i - 1}} & L_{T^{(MSL)}_{i - 1}} = L_{T^{(MSL)}_i} \\ HL & L_{T^{(MSL)}_{i - 1}} < L_{T^{(MSL)}_i} \end{matrix}\right .}\)

    The bars with Indices \(T^{(MSL)}_i\) are colored orange by default. If the labels are displayed, then they appear below their corresponding bars at a vertical position \(L_{T^{(MSL)}_i} - \frac{k}{100}\left(H_{T^{(MSL)}_i} - L_{T^{(MSL)}_i}\right)\), where \(k\) denotes the Text Labels Percentage Offset Input.

    If the Display Price Values Input is set to Yes, then the Low Price \(L_{T^{(MSL)}_i}\) appears in the Label at Index \(t = T^{(MSL)}_i\)

Inputs

  • Draw Labels: If this is set to Yes, then HH (Higher High), LH (Lower High), LL (Lower Low), HL (Higher Low) labels will be displayed.
  • Text Labels Percentage Offset: This is the actual price value that you want to offset the labels from the Highs or Lows of the price bars. Usually 0 is fine unless the labels are too close.
  • Display Price Values: When this Input is set to Yes and the Draw Labels Input is also set to Yes, then the low or high price for the bar will be displayed as well.

Spreadsheet

The spreadsheet below contains the formulas for this study in Spreadsheet format. Save this Spreadsheet to the Data Files Folder.

Open it through File >> Open Spreadsheet.

Market_Structure_MSL_MSH.212.scss


*Last modified Friday, 26th April, 2019.