lightweight-charts-python icon indicating copy to clipboard operation
lightweight-charts-python copied to clipboard

Add Features: Area & Bar & custom Candlestick series types, Grouping series in Legend, + plugins: Trend Trace, Fill area between 2 series, VolumeProfile, + Indicators, Settings+Context menu

Open EsIstJosh opened this issue 1 year ago • 5 comments

Screenshot2025-02-07114921

Series Types:

  • Area
  • Bar
  • Custom Candlestick implementation | | | V V V
    • Capable of candle data aggregation )

      for displaying multiple timeframes simultaneously

    • Customizable Line Width

    • Customizable Line Style

    • Customizable Bar Spacing

    • Customizable Shape:

      • Rectangle
      • Rounded
      • Ellipse
      • Arrow
      • Polygon
      • Bar
      • 3d
    • Volume Color Opacity Plugins:

  • Fill Area: Shades the area between two series.

https://github.com/user-attachments/assets/6815125c-a216-4f40-885f-b61a9b53961b

  • Pitch Fork: Tool for drawing (added to toolbox):

    • Standard
    • Schiff
    • Modified Schiff
    • Inside
  • Volume Profile: Displays volume profiles based on the visible range ( also can be instantiated from and linked to existing drawing: box, trendline etc)

  • Trend Trace: A transformable/scalable replica of a section of series between a drawings points. Similar to 'Bars Pattern' in TradingView (instantiated from and linked to existing drawing: box, trendline etc)

https://github.com/user-attachments/assets/4b7da4e6-47a5-4835-878f-529191e4abd6

Indicators (implemented in typescript, from KLineChart primarily ( https://github.com/klinecharts/KLineChart )):

  • Overlay Indicators:
  1. Arnaud Legoux Moving Average
  2. Bollinger Bands
  3. Exponential Moving Average
  4. Highest High
  5. Highest High Lowest Low
  6. Linear Regression Indicator
  7. Lowest Low
  8. Median
  9. Moving Average
  10. Rolling Moving Average
  11. Simple Moving Average
  12. Stop and Reverse
  13. Super Trend
  14. Symmetric Weighted Moving Average
  15. Triple Exponentially Smoothed Average
  16. Volume Weighted Average Price
  17. Volume Weighted Moving Average
  18. Weighted Moving Average
  • Oscillator Indicators:
  1. Awesome Oscillator
  2. Average True Range
  3. Bias
  4. BRAR
  5. Bull and Bear Index
  6. Commodity Channel Index
  7. Current Ratio
  8. Difference of Moving Average
  9. Directional Movement Index
  10. Momentum
  11. Moving Average Convergence Divergence
  12. Psychological Line
  13. Rate of Change
  14. Relative Strength Index
  15. Stochastic Oscillator
  16. Variance
  17. Williams %R
  18. Change
  19. Range
  20. Standard Deviation

Context Menu:

  • Upgraded context menu for better control over chart/series/primitive settings..

Legend

  • Upgraded to allow for collapsible grouping of series.
  • Tree-style display of groups > series > primitives. Series Cloning / Type Conversion
  • Simple cloning to different series types

-Settings Menu:

  • Ability to save options for chart, series, and primitives to JSON

Note:

  • this is my first project using typescript
  • code implemented primarily via bruteforcing chatGPT, there is probably a better way of doing lots of things in here, but hopefully this makes things quicker to implement

EsIstJosh avatar Oct 27 '24 11:10 EsIstJosh

image

EsIstJosh avatar Oct 31 '24 07:10 EsIstJosh

@EsIstJosh I've tried installing your fork, but it'm experiencing the following issue:

Traceback (most recent call last):
  File "C:\...\visualize.py", line 42, in <module>
    chart = Chart()
            ^^^^^^^
  File "C:\...\venv_trading_2\Lib\site-packages\lightweight_charts\chart.py", line 185, in __init__
    super().__init__(window, inner_width, inner_height, scale_candles_only, toolbox, position=position)
  File "C:\...\venv_trading_2\Lib\site-packages\lightweight_charts\abstract.py", line 1087, in __init__
    from lightweight_charts_.polygon import PolygonAPI
ModuleNotFoundError: No module named 'lightweight_charts_'

I've installed it using the following command with Python 3.11.4: pip install -U git+https://github.com/EsIstJosh/lightweight-charts-python Maybe I'm not doing it right. But if you could help in any way, that would be great.

80sVectorz avatar Jan 06 '25 12:01 80sVectorz

@EsIstJosh I've tried installing your fork, but it'm experiencing the following issue:

Traceback (most recent call last):
  File "C:\...\visualize.py", line 42, in <module>
    chart = Chart()
            ^^^^^^^
  File "C:\...\venv_trading_2\Lib\site-packages\lightweight_charts\chart.py", line 185, in __init__
    super().__init__(window, inner_width, inner_height, scale_candles_only, toolbox, position=position)
  File "C:\...\venv_trading_2\Lib\site-packages\lightweight_charts\abstract.py", line 1087, in __init__
    from lightweight_charts_.polygon import PolygonAPI
ModuleNotFoundError: No module named 'lightweight_charts_'

I've installed it using the following command with Python 3.11.4: pip install -U git+https://github.com/EsIstJosh/lightweight-charts-python Maybe I'm not doing it right. But if you could help in any way, that would be great.

I think it has to do with me having an underscore after this : ModuleNotFoundError: No module named 'lightweight_charts_',

In my setup I have the project in my working directory so I could just reference it like that but it should probably be renamed back.

EsIstJosh avatar Jan 06 '25 17:01 EsIstJosh

@EsIstJosh I've tried installing your fork, but it'm experiencing the following issue:

Traceback (most recent call last):
  File "C:\...\visualize.py", line 42, in <module>
    chart = Chart()
            ^^^^^^^
  File "C:\...\venv_trading_2\Lib\site-packages\lightweight_charts\chart.py", line 185, in __init__
    super().__init__(window, inner_width, inner_height, scale_candles_only, toolbox, position=position)
  File "C:\...\venv_trading_2\Lib\site-packages\lightweight_charts\abstract.py", line 1087, in __init__
    from lightweight_charts_.polygon import PolygonAPI
ModuleNotFoundError: No module named 'lightweight_charts_'

I've installed it using the following command with Python 3.11.4: pip install -U git+https://github.com/EsIstJosh/lightweight-charts-python Maybe I'm not doing it right. But if you could help in any way, that would be great.

I think it has to do with me having an underscore after this : ModuleNotFoundError: No module named 'lightweight_charts_',

In my setup I have the project in my working directory so I could just reference it like that but it should probably be renamed back.

Alright I'll make a local edit until you've changed it in the repo. Thanks for the reply! Edit: For anyone interested, changing from:

from lightweight_charts_.polygon import PolygonAPI

To

from .polygon import PolygonAPI

Fixed it.

80sVectorz avatar Jan 07 '25 09:01 80sVectorz

How can I change the name of the candles on the chart? it's default is candles, the line is fine btw. And this it kinda out of context but I cant make the sub-chart scaling with the main chart using JupyterChart test_chart

longls231 avatar Jan 11 '25 17:01 longls231