The "Median Speed Bar" is a custom trading indicator designed to classify market candlesticks based on their volatility relative to historical price ranges. It calculates two median price ranges: a short-term median using a customizable period and a long-term median over a much larger timeframe. These medians are based on either the difference between the opening and closing prices or the high and low prices of the candlesticks, depending on user input. The percentage ratio of the short-term median to the long-term median is used to categorize the current candlestick into one of four types: EXTREME, FAST, NORMAL, or SLOW. Each category is linked to customizable thresholds, which are set by the user as percentages.
The script then displays the classification of the current bar in a table at the bottom right corner of the chart, offering an easily readable overview of current market conditions. If the bar's percentage exceeds the extreme threshold, it's classified as "EXTREME" and highlighted in red. Other categories—FAST, NORMAL, and SLOW—are visually distinguished by different colors (orange, green, and blue, respectively). This allows traders to quickly assess volatility and make informed decisions based on how the current price action compares to historical medians.