OPEN-SOURCE SCRIPT
업데이트됨

Dynamic SMA

3 789
This script uses dynamic length to create a different sma type.

The length of the "Dynamic SMA" - "dSMA" can be:
'RSI', 'Stoch', 'ATR', 'MFI' or '%R'

For example 'RSI' -> the length of the sSMA will be the RSI itself

The biggest challenge was:
'Pine cannot determine the referencing length of a series. Try using max_bars_back' error

The writer of 'referencing length of a series' issue gave following solution:

bar_index == 0 ? 4999 : len
or in case of values which don't go above 100:
bar_index == 0 ? 100 : len

This assigns the necessary buffer to the function.
I'm most grateful for the given solution!

These dSMA's can give Support/Resistance levels, also crossovers of different dSMA's can give extra information

Examples:


RSI
스냅샷

ATR (close / atr(len)
스냅샷

Stoch
스냅샷

MFI
스냅샷

%R
스냅샷

"show regular SMA" will show the "SMA" with the same length (with default lighter color)
릴리즈 노트
Updated to v5
Due to evolution in Pine Script™, an error occurred,
should be fixed now.
릴리즈 노트
Update, bugfix (max len 5000 allowed)
릴리즈 노트
Further Bugfix, sorry guys!

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.