TradingView
fareidzulkifli
4 Th12 2020 23:17

SDev Adjusted Stochastic 

Alphabet Inc.NASDAQ

Mô tả

Description : This Stochastic variant will auto-adjust stochastic period based on volatility measured by standard deviation.
The idea behind it are in highly volatile market, %K period will be reduced to account for recent price range,
while in low volatility market, %K period will be increased to account less of the recent price range.

This idea is based on one of medium article written by Sofien Kaabar with slight modification on the adjusting logic implementation. Any ideas to further improve this indicator are welcome :)

Disclaimer:
I always felt Pinescript is a very fast to type language with excellent visualization capabilities, so I've been using it as code-testing platform prior to actual coding in other platform.
Having said that, these study scripts was built only to test/visualize an idea to see its viability and if it can be used to optimize existing strategy.
While some of it are useful and most are useless, none of it should be use as main decision maker.
Bình luận
emersongazzoli
Line 45 should be:

stochlength = nz(get_period(n_sdev) == 0 ? 3 : get_period(n_sdev),1)

It works this way.
Yelian
Is it just me or does this no longer work? Thank you for sharing!
Thêm nữa