The Vet [TFO]In collaboration with @mickey1984 , "The Vet" was created to showcase various statistical measures of price.
The first core measurement utilizes the Defining Range (DR) concept on a weekly basis. For example, we might track the session from 09:30-10:30 on Mondays to get the DR high, DR low, IDR high, and IDR low. The DR high and low are the highest high and lowest low of the session, respectively, whereas the IDR high and low would be the highest candle body level (open or close) and lowest candle body level, respectively, during this window of time.
From this data, we use the IDR range (from IDR high to IDR low) to extrapolate several, custom projections of this range from its high and low so that we can collect data on how often these levels are hit, from the close of one DR session to the open of the next one.
This information is displayed in the Range Projection Table with a few main columns of information:
- The leftmost column indicates each level that is projected from the IDR range, where (+) indicates a projection above the range high, and (-) indicates a projection below the range low
- The "First Touch" column indicates how often price has reached these levels in the past at any point until the next weekly DR session
- The "Other Side Touch" column indicates how often price has reached a given level, then reversed to hit the opposing level of the same magnitude. For example, the above chart shows that if price hit the +1 projection, ~33% of instances also hit the -1 projection before the next weekly DR session. For this reason, the probabilities will be the same for projection levels of the same but opposite magnitude (+1 would be the same as -1, +3 would be the same as -3, etc.)
- The "Next Level Touch" column provides insight into how often price reaches the next greatest projection level. For example, in the above chart, the red box in the projection table is highlighting that once price hits the -2 projection, ~86% of instances reached the -3 projection before the next weekly DR session
- The last columns, "Within ADR" and "Within AWR" show if any of the projection levels are within the current Average Daily Range, or Average Weekly Range, respectively, which can both be enabled from the Average Range section
The next section, Distributions, primarily measures and displays the average price movements from specified intraday time windows. The option to Show Distribution Boxes will overlay a box showing each respective session's average range, while adjusting itself to encapsulate the price action of that session until the average range is met/exceeded. Users can choose to display the range average by Day of Week, or the Total average from all days. Values for average ranges can either be shown as point or percent values. We can also show a table to display this information about price's average ranges for each given session, and show labels displaying the current range vs its average.
The final section, Average Range, simply offers the ability to plot the Average Daily Range (ADR) and Average Weekly Range (AWR) of a specified length. An ADR of 10 for example would take the average of the last 10 days, from high to low, while an AWR of 10 would take the average of the last 10 weeks (if the current chart provides enough data to support this). Similarly, we can also show the Average Range Table to indicate what these ADR/AWR values are, what our current range is and how it compares to those values, as well as some simple statistics on how often these levels are hit. As an example, "Hit +/- ADR: 40%/35%" in this table would indicate that price has hit the upper ADR limit 40% of the time, and the lower limit 35% of the time, for the amount of data available on the current chart.
Definingrange
DR/IDR Candles [LuxAlgo]This indicator displays defining ranges (DR) and implied defining ranges (IDR) constructed from two user set sessions (RDR/ODR) as graphical candles on the chart. The script introduces additional graphical elements to the original DR/IDR concept and as such can be thought as a graphical method in addition to a technical indicator.
Additionally, this script can display various Fibonacci retracements from the constructed DR/IDR if enabled within the settings.
Settings
Regular Session: Enable/disable regular session's DR/IDR alongside setting the session time. By default, 09:30 - 10:30 am.
Overnight Session: Enable/disable overnight session's DR/IDR alongside setting the session time. By default, 03:00 - 04:00 am.
UTC Offset: UTC offset for the time zone, by default -5 (EST)
Retracements
Reverse: Inverts source range upper/lower value for constructing the retracements.
From: Source range used to construct the retracements, by default DR is used.
By default, the 0.5 retracement (average line) is displayed.
Usage
The used sessions are highlighted by a gray background. DRs are highlighted by dashed lines while IDRs are highlighted by solid ones. The maximum/minimum price between each user set session is highlighted by solid wicks.
The color of the DRs/IDRs/wicks are determined by the price position relative to the DR; if price is above the DR maximum, then a blue color is used. If price is below, then an orange color is used, and if price is within the DR range, then a gray color is used.
Additionally, the area of the DR range is used to highlight the number of time price is located within the DR, with a longer background highlighting a higher number of occurrences. This can help highlight if the DR levels were potentially useful as support/resistance.
When price is outside the IDR range, the area between the price and IDR is highlighted, in blue if price is above the IDR, and orange if it is under.
The original author of the DR/IDR concept describes 3 rules using the price position relative to the DR/IDR levels:
1.) If price on the 5-minute timeframe closes above the DR high after 10:30 AM or 04:00 AM then the DR low will likely be the low of the trading session.
2.) If price on the 5-minute timeframe closes below the DR low after 10:30 AM or 04:00 AM then the DR high will likely be the high of the trading session.
3.) If price closes above the IDR high after 10:30 AM or 04:00 AM it is an early indication that the low of the DR will be the low of the day and vice versa.
We can see that the above rules are cases of conditional probabilities.
There is no significant data supporting or regarding any statistical probability of the above rules to be true, which are more than uncertain given the stochastic nature of prices. The lack of precision of these rules is also a concern (time zone dependance, applicable markets, etc...).
Credits
Credits to trader TheMas7er who originally created the DR/IDR concept in November of 2022. This script was derived from his proposed session times & rules for trading.
DR/IDR V1Defining Range DR and Implied Defining Range IDR for regular Session and overnight Session
This script is showing the IDR and DR for the regular trading session and for the overnight session based on the rules from the creator of the DR/IDR concept.
It works for all major Forex Pairs, BTC, ETH and the US Equity indices. This concept is based on rules and has a 80 % probability to be correct.
It should be applied in the 5 Min. Timeframe.
The timings for the RDR are from 09.30 - 10.30 am New York local time.
The timings for the ODR are from 03.00 - 04.00 am New York local time.
Rules:
1. If price in the 5 Min timeframe closes above the DR high after 10.30 am or 04.00 am then the DR low will be with 80 percent probability the low of the trading session. This is called confirmation.
2. If price in the 5 Min timeframe closes below the DR low after 10.30 am or 04.00 am then the DR high will be with 80 percent probability the high of the trading session. This is called confirmation.
3. If price closes above the IDR high after 10.30 am or 04.00 am it is an early indication that the low of the DR will be the low of the day and vice versa.
Credits:
This script imports the recently published (VisibleChart) library containing functions that return values calculated from the range of visible bars on the chart.
bmistiaen helped me a lot with this script. Thank you a lot.