---
title: "Discussion on \"RSI in Python: Wilder’s Formula and Live Candle Updates\" | Hashnode"
description: "Discussion on \"RSI in Python: Wilder’s Formula and Live Candle Updates\". Calculate RSI in Python with Wilder's smoothing, check a worked example and update live candles without counting the same bar twice."
url: "https://hashnode.com/posts/rsi-in-python-wilder-s-formula-and-live-candle-updates/6af32998f910c8b38f0b389e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [RSI in Python: Wilder’s Formula and Live Candle Updates](https://siftingio-developers.hashnode.dev/rsi-in-python-wilder-s-formula-and-live-candle-updates?utm_source=hashnode&utm_medium=feed)

Calculate RSI in Python with Wilder's smoothing, check a worked example and update live candles without counting the same bar twice.

Nov 10 · 12 min read · siftingio-developers.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#finance](https://hashnode.com/tag/finance)
-   [#api](https://hashnode.com/tag/api)

## Written by

[Alper San](https://hashnode.com/@siftingio)

@siftingio

  
[View profile](https://hashnode.com/@siftingio)

Building SiftingIO: market data APIs and practical examples for developers.

I build SiftingIO, a market data API for developers. Here I share practical examples for working with real-time prices and historical data. https://sifting.io

## Responses 1

Markdown supported · ⌘↵ to post

[OneLifeVibe](https://hashnode.com/@onelifevibe)

[Nov 10](https://hashnode.com/posts/rsi-in-python-wilder-s-formula-and-live-candle-updates/6af32998f910c8b38f0b389e/comment/6af34afa3b8023106a83078b)

The worked five-period example is what makes this land — seeing the seed as a plain average of the first five gains and losses, then watching 75.00 drop to 64.8649 on a single close of 103, shows exactly how much history Wilder's smoothing carries. The preview versus update split is the part I would have wanted spelled out when first wiring up a live feed: treating each tick as a candidate against the same committed state, and only committing the final close, is a clean way to stop a forming candle from being counted several times. I also appreciated the pandas note — that ewm gets the decay right but still seeds from the first observation, which explains a lot of those small, stubborn mismatches between two charts showing the same RSI(14).
