# \[ANN\] TechnicalIndicatorCharts.jl

**URL:** https://discourse.julialang.org/t/ann-technicalindicatorcharts-jl/123873
**Category:** Package Announcements
**Tags:** package, announcement, plotting, finance, algorithmic-trading
**Created:** [December 16, 2024, 7:55am UTC](https://discourse.julialang.org/t/ann-technicalindicatorcharts-jl/123873 "2024-12-16T07:55:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![g-gundam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/g-gundam/32/47593_2.png) [@g-gundam](https://discourse.julialang.org/u/g-gundam)
#### Post date: [December 16, 2024, 7:55am UTC](https://discourse.julialang.org/t/ann-technicalindicatorcharts-jl/123873/1 "2024-12-16T07:55:11Z")

</div>

# TechnicalIndicatorCharts

[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://g-gundam.github.io/TechnicalIndicatorCharts.jl/dev/)  
[![Build Status](https://github.com/g-gundam/TechnicalIndicatorCharts.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/g-gundam/TechnicalIndicatorCharts.jl/actions/workflows/CI.yml?query=branch%3Amain)  
[![Coverage](https://codecov.io/gh/g-gundam/TechnicalIndicatorCharts.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/g-gundam/TechnicalIndicatorCharts.jl)

The purpose of this library is to bring  
[OnlineTechnicalIndicators.jl](https://github.com/femtotrader/OnlineTechnicalIndicators.jl) and  
[LightweightCharts.jl](https://github.com/bhftbootcamp/LightweightCharts.jl) together.

## Creating a Chart

```julia
using OnlineTechnicalIndicators
using TechnicalIndicatorCharts

golden_cross_chart = Chart(
    "AAPL", Week(1);
    indicators = [
        SMA{Float64}(;period=50), # Setup indicators
        SMA{Float64}(;period=200)
    ],
    visuals = [
        Dict(
            :label_name => "SMA 50", # Describe how to draw indicators
            :line_color => "#E072A4",
            :line_width => 2
        ),
        Dict(
            :label_name => "SMA 200",
            :line_color => "#3D3B8E",
            :line_width => 5
        )
    ]
)

```

## Feeding Your Chart Data

Adding new data to the chart is done with the `update!(chart, candle)` function.

```julia
using MarketData

for row in eachrow(AAPL)
    c = Candle(
      ts=DateTime(row.timestamp),
      o=row.Open,
      h=row.High,
      l=row.Low,
      c=row.Close,
      v=row.Volume
    )
    update!(golden_cross_chart, c)
end

```

Notice that `update!` took daily candles from `AAPL` and aggregated them into weekly candles.

> The `update!` function was designed to consume low timeframe candles to incrementally build higher timeframe charts. Imagine unfinished 1m candles from a websocket being consumed to generate multiple higher-timeframe charts for the same market. The hope was that this would facilitate realtime, multi-timeframe analysis.

## Visualization

The `visualize` function will take a chart and generate something that `lwc_show` from [LightweightCharts.jl](https://github.com/bhftbootcamp/LightweightCharts.jl) can display.

```julia
using LightweightCharts

lwc_show(visualize(golden_cross_chart))
# Or
golden_cross_chart |> visualize |> lwc_show

```

 ![aapl](https://global.discourse-cdn.com/julialang/original/3X/4/c/4cff775b5203662c50763f68f41dfd5c4ab92963.png)

## Addendum

- This is kind of an early release. (v0.6.0)
- I’d like to support visualizations for every indicator that’s implemented in @FemtoTrader’s OnlineTechnicalIndicators.jl.
- However, so far, I’ve only implemented: EMA, HMA, SMA, BB, RSI, StochRSI.
- I have created a **[guide](https://g-gundam.github.io/TechnicalIndicatorCharts.jl/dev/indicators/)** for anyone who wants or needs to implement a visualization that doesn’t exist yet.
- Any help is appreciated.

Also, some of my earliest bookmarks on this forum were related to technical analysis and charting, and there was not much out there even a year ago.

- Feb. 2023 - [How to Create Bollinger Bands and Moving Average in Julia with Plots and DataFrame?](https://discourse.julialang.org/t/how-to-create-bollinger-bands-and-moving-average-in-julia-with-plots-and-dataframe/94794)
- June 2020 - [How to do technical analysis charts / visualizations using Julia?](https://discourse.julialang.org/t/how-to-do-technical-analysis-charts-visualizations-using-julia/40562)

However, with the release of OnlineTechnicalIndicators.jl and LightweightCharts.jl earlier this year, we can do much better. These two great libraries just had to be brought together, and now it’s here.

[https://github.com/g-gundam/TechnicalIndicatorCharts.jl](https://github.com/g-gundam/TechnicalIndicatorCharts.jl)
