Closed cometta closed 3 months ago
Hello.
You are totally correct. First value in SMA::new(3, &1.0)
is the same value as in the next line.
Yes, there is no reason to provide first input again. It will not change internal state of a MA. The only reason to provide first input again is to get resulting value (and use it somewhere else).
What's the second argument of SMA::new function?
What's the second argument of SMA::new function?
Again, it's just the very first value of time series you want to process.
i saw the example look like below, what is the purpose to repeating inputing the first value?