TradingView
abhijeetdesai14
Dec 17, 2022 4:10 PM

CM_Williams_Vix_Fix - Market Top and Bottom with multi-timeframe 

Australian Dollar/U.S. DollarFXCM

Description

This is a modification of CM_Williams_Vix_Fix indicator to include both market tops and bottoms with multi-timeframe support. The original indicator only finds market bottoms.

All credits go to the original author ChrisMoody.
Original script link

Working:
The histogram above 0 signifies the trend of market going UP and the histogram below 0 signifies the trend of market going DOWN.

The histogram bar is calculated using "LookBack Period Standard Deviation High" number of candles. A threshold is calculated using bollinger bands and based on percentile of "Look Back Period Percentile High" number of candles.

If the histogram bar above 0 crosses the up threshold then we have market top which is signified by histogram bar having the color green. If the histogram bar below 0 crosses the down threshold then we have market bottom which is signified by histogram bar having the color red.

The market tops and bottoms can also be calculated across multiple timeframes.

Sample usage:
Suppose the market is in an uptrend and the indicator displays red market bottom bar, this might be an indication that the market has reached the end of a pullback. We can use additional indicators like stochastic or rsi to get additional confluence.

This indicator does not repaint but you need to wait for the candle to close.

Release Notes

Alerts added
Comments
uma_dent
Thanks for your script, Alert function, it works!. but it works only "Bottom reached". It doesn't work on "Top reached".
Could you check its function for me?
rboepple
Hi @abhijeetdesai14, Thanks for this great indicator. It is pretty good in confluence with others. One question. Is there a way you can set an alert when the indicator is starting to start or stop flashing the red or green signal? I have tried to signal bottom or top but doesn't seem to confluence with the color indication on the chart. Maybe I am missing something. Any chance you could point in the right direction?

Thanks a lot.
Ralf
abhijeetdesai14
@rboepple, Hi thanks for your feedback. You can use something like if (col[0]==color.red and col[1]== color.gray ) then show alert. Similarly for col1 use (col1[0]==color.green and col1[1]== color.gray ). Without candle close this might result in unexpected results.
If you want these alerts on candle close only you need to use barstate.isconfirmed
col =barstate.isconfirmed and ( wvf >= upperBand or wvf >= rangeHigh) ? color.red : color.gray
col1 = barstate.isconfirmed and (wvf1 <= lowerBand1 or wvf1 <= rangeLow1) ? color.lime: color.gray
rboepple
@abhijeetdesai14, Thanks for the reply :). Much appreciated. I am not much of a coder but do I understand you correct that I would have to modify the code of your script to have this function added?

Thanks a lot for the reply.

Ralf
abhijeetdesai14
@rboepple, I have added alerts in the latest version. Feel free to modify according to your needs. Happy trading, become profitable!
rboepple
@abhijeetdesai14, Hey thank you so much. I have just updated the script and will test it and see. You are a legend!
Jaymo312
Nice
More