Motgench

Expected Move Occurrence Test [Ba_Pig]

Expected Move Occurance Test is not an indicator itself.
It's a tool to test the accuracy of the expected move.

The user can choose the Standard Deviation on Count type for the backtest.

The theoretical probability of the chosen standard deviation will be shown
as a straight line called "Expected Probability".

The actual occurrence probability is based on the occurrence. Every time a bar that closes equal or above the upper range of the expected move or below the lower range of the expected move based on the chosen standard deviation will count as 1 occurrence. If the bar closes between the range, it counts as 0 occurrences. We add the sum of all occurrences within the count period (default 365) and divide the occurrence by 365. E.g., If the sum is 100, it means there are 100 out of 365 bars that price closes outside of expected range. Then we divide 365 to 100 to get the 27% actual probability of price closing outside of the range in every bar for the past 365 days.
After that, we use 1 - that probability we get to make the probability easier to compare with the theoretical probability. For the previous example, it's 1 - 27% = 73%.

When the user chooses SDx in count type, Manually entered standard deviation is used. The probability of the input SD will also be shown on the expected probability line.

"Assume non zero mean" is not recommended for the test because the drift is insignificant in one bar estimation.
Autocorrelation adjustment is removed here because we are only testing one bar, and the adjustment only happens in future bars greater than one.

Probability MA is the moving average based on occurrence probability.

The result of the test shows many important characteristics of the distribution of returns, and the numbers explains the warning mentioned in the expected move.

Warning on Expected Move:
"People should not blindly trust the probability. They should be aware of the risk evolves by using the normal distribution assumption. The real return has skewness and high kurtosis. While skewness is not very significant, the high kurtosis should be noticed. The Real returns have much fatter tails than the normal distribution, which also makes the peak higher. This property makes the tail ranges such as range more than 2SD highly underestimate the actual range and the body such as 1 SD slightly overestimate the actual range. For ranges more than 2SD, people shouldn't trust them. They should beware of extreme events in the tails. "

The effect of high kurtosis and fat tails is shown in the result. Based on several tests, the real probability of 1 SD is always higher than 68%, about 70% to 80%. Real probability of 2 SD is around 92% to 96% which is close to and slightly lower than the theoretical probability 95%. And 3 SD is around 96% to 98%. It's always lower than the theoretical probability 99.7%.
The 3 Sd is the least reliable range. The real occurrence probability only shows the occurrence. But in real life, the magnitude of these 4% to 2% extreme moves (100% - 96% to 98%) out of 3 SD is way beyond 3 SD. It's very dangerous to assume 3 standard deviation range as it's the real probability. A lot of funds blow up due to the underestimation of risk in the tails under the normal distribution assumption.

Different volatility models provide different properties. The backtest results are also slightly different. People can try to test all these models and pick the ones they love the most based on the backtest result.

Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?