Models#

The indexes app has one model: the concrete asset type Index.

Index#

Concrete subclass of Item via Django multi-table inheritance. Carries no additional fields beyond what Item / BaseItem already provide.

The update_cache override invalidates the index-specific transaction-performance / profit-performance cache keys and re-warms them by re-running Performance.

class richy.indexes.models.Index(id, symbol, type, is_discontinued, item_ptr)[source]#

Bases: Item

Index.update_cache()[source]#

Updates cached values cached by:

  • self.get_last_days_change(…)

  • self.get_sma(…)

  • self.get_ath()

  • self.get_drawdown()

  • self.get_52_weeks_low_high()

  • ItemWithPrices.refresh()