TradingView
palitoj_endthen
6 aug 2022 09:07

deseasonalized_mod 

Tesla, Inc.NASDAQ

Beskrivning

Description:
As in the decomposition of time series data, the indicator was modified from the deseasonalized process, to avoid overfitting as in the original format, aiming to exclude seasonal component (shorter time-period in consideration), thus leaving trend and irregularity. The indicator is expected to identify short-term trends, based on the given timeframe.


Notes:
Length set to 10-bar as default, while reducing the length to e.g. 8 increase more responsive of the fitted data, however inline to increase a false trend identification (bias-variance trade-off). To be noted, the indicator wasn't a momentum indicator, thus can only expect the trend identifier instead. If the price is above the fitted line (indicator), and experiencing a retracement, regularly expected to be bounced around the fitted line (support), while if breaks to the downside, expected a trend reversal, and become a (resistance).


Feature:
  • Buy/Long overlay signal
  • Sell/Short overlay signal
  • Alert
Kommentarer
tarasenko_
Hello. Thanks for the indicator, but I noticed that you did an extra move in deseasonalize() function:
19 wma = ta.wma(s, l)
20 seasonality_mod = s / ta.wma(wma, l)
21 deseasonalized_mod = s / seasonality_mod
But deseasonalized_mod = s / seasonality_mod = s / (s / ta.wma(wma, l)) = ta.wma(wma, l).
So my little proposition is to delete this function and instead just do something like this:
deseasonalized = ta.wma(ta.wma(s, l), l)
This line will produce exactly the same result.
Just to save up a little time and code space :)
palitoj_endthen
@tarasenko_, hi, sure you could try, thanks, I found it neat in a function
syracusepro
It is meant to be used at any time frame but plot of the study will be daily by default of as per user selected?
palitoj_endthen
@syracusepro, it is meant to be used at any tf (however I most likely recommended to 4H or 2H at the very least), let me know if you testing on lower tf. per default, tf input is daily, and you can switch to 'chart'
syracusepro
@palitoj_endthen, No problem. Just taught there was a preference or meant to be used at a certain criteria, but testing at any timeframe. It just that the plot looks like bollinger bands when used at a lower timeframe, but working fine. Thanks.
palitoj_endthen
@syracusepro, your welcome
Mer