Zone Of The Price
The script displays the area where the price is to be found within one hour to one week with the highest probability. This important data allows you to plan trading operations, set price targets and define position closing levels.
The script displays the area where the future closing price is to be found. Also, the levels that can be reached with a certain probability are calculated for each point in time. The chart displays the average price expected at the end of the period. In addition, a user can set the two levels (below and above the current price), for which the script calculates the probabilities of the following events:
- event 1: the price reaches the upper level without reaching the lower one at the current point of time;
- event 2: the price reaches the lower level without reaching the upper one at the current point of time;
- event 3: the price remains within the two levels without reaching any of them during a specified time interval;
- event 4: the price reaches the upper level regardless of whether the lower level was reached before that;
- event 5: the price reaches the lower level regardless of whether the upper level was reached before that.
The first three events cover all possible price movement scenarios, thus forming a complete group of events.
Knowledge of these probabilities allows you to set stop loss and take profit levels, as well as limit orders in a more precise manner. In case of a long position, the upper level can be considered as a take profit, while the lower one as a stop loss. The opposite is true for a short position.
The calculation is based on the Black-Scholes model which assumes a random character of the movement and the lognormal distribution of a symbol price increments. The model considers trend, symbol volatility and time interval, for which probability assessments are made.
The equation from the following work are used for the calculation: Antoon Pelsser. Pricing Double Barrier Options: An Analytical Approach. January 15, 1997. ABN-Amro Bank Structured Products Group (AA 4410).
- Period (bars) - number of bars before the end of the forecast period
- Probability of Close - probability for a closing price
- Touch Probability - probability of reaching (touching) a level
- high level(points) - number of points to the upper level from the current price
- low level(points) - number of points to the lower level from the current price
- distance to the comment from the left - distance from the left edge of the screen to a comment in pixels
- distance to the comment from the top - distance from the upper edge of the screen to a comment in pixels
How to use
The script works on H1 timeframe of any symbol.
According to the calculation results, the chart field displays the following objects:
- the vertical line sets the end of the time interval, for which the calculation is performed
- the upper green and lower red dotted lines display the levels with touching probability set in the Touch Probability value
- Average option marks the expected average price at the end of the interval
- the solid lines limit the area, within which the closing prices are to be located with the probability set in Probability of Close
- events and their probabilities are enumerated in the upper right corner of the chart.
If the Average mark is located above the current price, then the growing trend is expected, otherwise the falling one is more probable. If the mark is near the current price, the flat movement is expected. The farther the level from the current price, the lower the probability of achieving it. This probability is also affected by a symbol volatility and duration of the period, on which the forecast is performed. The higher the volatility and longer the period, the higher the probability of reaching the level.
The forecast period is limited by an interval from 3 to 120 hours.
If the comment for the calculations does not fit the screen, then change the distance to it from the left margin (the 'distance to the comment from the left' parameter). The 'distance to the comment from the top' parameter allows moving the comment downwards.