How are EMA's calculated on charts up to the previous candle. #528
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
If you examine the formula for EMA you'll see this concept of historical "smoothing". In a nutshell:
If you read it carefully, EMA value is mostly derived from historical EMAs. The library is quite fast, so I'd suggest recalculating the whole results series instead of trying to do incremental EMA values if that was your goal. See #396 for more discussion on incremental calculations. I'll be looking at the streaming and incremental use cases in v2 of the library, where we'll add a method like As a side note, this smoothing also presents a convergence issue worth noting. Since EMA is initialized with a Simple Moving Average, which is essentially a guess, there is also an initial warmup window where there is convergence to a precision value. For that reason, it is good to also use the |
Beta Was this translation helpful? Give feedback.
If you examine the formula for EMA you'll see this concept of historical "smoothing". In a nutshell:
If you read it carefully, EMA value is mostly derived from historical EMAs.
The library is quite fast, so I'd suggest recalculating the whole results series instead of trying to do incremental EMA values if that was your goal. See #396 for more discussion on incremental calculations. I'll be looking at the streaming and incremental use cases in v2 of the library, where we'll add a method like
GetEmaIncrement(..)
. See #…