Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
402f935
Update handler.ts
EsIstJosh Oct 27, 2024
042dcfc
Update abstract.py
EsIstJosh Oct 27, 2024
4b574a5
Update abstract.py
EsIstJosh Oct 27, 2024
5e52329
Update handler.ts
EsIstJosh Oct 27, 2024
49d49ab
Update bundle.js
EsIstJosh Oct 27, 2024
899ddb1
Update abstract.py
EsIstJosh Oct 27, 2024
a981127
Update abstract.py
EsIstJosh Oct 28, 2024
6720a48
Added LegendGroup
EsIstJosh Oct 30, 2024
3ec9692
handle LegendGroups
EsIstJosh Oct 30, 2024
d57734e
Add group parameter to Line, .create_line
EsIstJosh Oct 30, 2024
541296f
Merge pull request #1 from EsIstJosh/LegendGroup
EsIstJosh Oct 30, 2024
288c222
Update bundle.js
EsIstJosh Oct 31, 2024
7038770
Add group, legend_symbol to Area, Histogram, Bar series types
EsIstJosh Oct 31, 2024
5d54397
Add legend_symbol, group to series types
EsIstJosh Oct 31, 2024
3cd9166
Add legend_symbol, group to series types
EsIstJosh Oct 31, 2024
d17365b
Update bundle.js
EsIstJosh Oct 31, 2024
d3aa486
Re-Implement Legend Groups
EsIstJosh Nov 12, 2024
24cbb2d
Export LegendItem interface for use in handler, legend
EsIstJosh Nov 12, 2024
cb4146d
Adapt to changes made in legend.ts
EsIstJosh Nov 12, 2024
a02e92d
Add Custom Candle Series Renderer with Aggregation and Advanced Drawi…
EsIstJosh Nov 16, 2024
148ce64
Update renderer.ts
EsIstJosh Nov 17, 2024
af3647f
add bar_width option
EsIstJosh Nov 17, 2024
ec4fa2d
Enhance bar specific rendering logic
EsIstJosh Nov 20, 2024
a8c4d11
Update ohlc-series.ts
EsIstJosh Nov 20, 2024
f2515fc
Add files via upload
EsIstJosh Nov 20, 2024
e3af7d5
Enhance: Context Menu
EsIstJosh Dec 13, 2024
5983882
Improve Context Menu
EsIstJosh Dec 14, 2024
0c64eb9
Update and rename abstract.py to a
EsIstJosh Dec 14, 2024
dac0b5d
Fix minor issues in context menu, ohlc series, formatting
EsIstJosh Dec 30, 2024
3860bda
Merge branch 'plugin-CustomCandles' of https://github.com/EsIstJosh/l…
EsIstJosh Dec 30, 2024
8d42803
fix legend display for ohlc series
EsIstJosh Dec 31, 2024
76f8b5d
Merge pull request #2 from EsIstJosh/plugin-CustomCandles
EsIstJosh Jan 4, 2025
8f71b2a
Add feature: Trend Trace
EsIstJosh Jan 20, 2025
ad4e91b
fix line trace
EsIstJosh Jan 20, 2025
38b087f
Add Feature: VolumeProfile, other minor improvements.
EsIstJosh Jan 24, 2025
da11ce7
minor improvements
EsIstJosh Jan 24, 2025
f69f488
Merge pull request #4 from EsIstJosh/plugin-CustomCandles
EsIstJosh Jan 24, 2025
dc61e82
Bump vite from 4.5.5 to 4.5.6
dependabot[bot] Jan 24, 2025
f814c52
Merge pull request #5 from EsIstJosh/dependabot/npm_and_yarn/vite-4.5.6
EsIstJosh Jan 24, 2025
1dd5dc8
bug fixes
EsIstJosh Jan 24, 2025
bae5e51
Merge pull request #6 from EsIstJosh/dev
EsIstJosh Jan 24, 2025
acc58ac
minor improvements
EsIstJosh Jan 25, 2025
195dd49
Legend Improvements
EsIstJosh Jan 29, 2025
1d5bd70
Merge pull request #7 from EsIstJosh/dev
EsIstJosh Jan 29, 2025
7e43af5
add Indicators from KLineCharts
EsIstJosh Jan 30, 2025
944a288
Merge pull request #8 from EsIstJosh/dev
EsIstJosh Jan 30, 2025
fe8e1fe
legend bug fixes
EsIstJosh Jan 30, 2025
4f2ae82
Merge pull request #9 from EsIstJosh/dev
EsIstJosh Jan 30, 2025
1facb55
Add more indicators from pinescript
EsIstJosh Jan 30, 2025
a34e80b
bug fixes
EsIstJosh Jan 30, 2025
635f7f3
Merge pull request #10 from EsIstJosh/dev
EsIstJosh Jan 30, 2025
73d44b1
Update to lightweight-charts v5.0.1
EsIstJosh Feb 1, 2025
14213b3
Merge pull request #11 from EsIstJosh/dev
EsIstJosh Feb 1, 2025
3eac9df
Add Pitchfork Indicator
EsIstJosh Feb 7, 2025
e835f6e
Merge pull request #12 from EsIstJosh/dev
EsIstJosh Feb 7, 2025
42d8a34
Added saving options
EsIstJosh Feb 7, 2025
b7a8221
Merge pull request #13 from EsIstJosh/dev
EsIstJosh Feb 7, 2025
f7b264a
update packages
EsIstJosh Feb 7, 2025
a7901d6
fix
EsIstJosh Feb 7, 2025
4141321
Merge branch 'main' into dev
EsIstJosh Feb 7, 2025
8e9b98c
Merge pull request #14 from EsIstJosh/dev
EsIstJosh Feb 7, 2025
0b6c75f
Update README.md
EsIstJosh Feb 7, 2025
7de2b27
Add files via upload
EsIstJosh Feb 7, 2025
dac3900
Update README.md
EsIstJosh Feb 7, 2025
894fd3b
Update README.md
EsIstJosh Feb 7, 2025
84b33e0
Rename Screenshot 2025-02-07 114921.png to Screenshot2025-02-07114921…
EsIstJosh Feb 7, 2025
89f98c9
Update README.md
EsIstJosh Feb 7, 2025
34e0884
Update README.md
EsIstJosh Feb 7, 2025
bca8396
Update README.md
EsIstJosh Feb 7, 2025
469665e
settings menu
EsIstJosh Feb 8, 2025
7016f3e
Merge branch 'dev' of https://github.com/EsIstJosh/lightweight-charts…
EsIstJosh Feb 8, 2025
290e083
Merge pull request #15 from EsIstJosh/dev
EsIstJosh Feb 8, 2025
e71c837
Rename LICENSE to MIT_LICENSE
EsIstJosh Feb 16, 2025
f02db55
Create AGPL_LICENSE
EsIstJosh Feb 16, 2025
3e066a9
minor improvements, adopt AGPL license to allow for pinets implementa…
EsIstJosh Feb 16, 2025
7855c94
Update README.md
EsIstJosh Feb 16, 2025
43a17ff
minor improvements
EsIstJosh Feb 17, 2025
af45ba5
PineTS integration
EsIstJosh Mar 1, 2025
6a24d08
Merge pull request #16 from EsIstJosh/pinets
EsIstJosh Mar 2, 2025
e869aea
Bump esbuild and vite
dependabot[bot] Mar 7, 2025
046c5db
Merge pull request #17 from EsIstJosh/dependabot/npm_and_yarn/multi-e…
EsIstJosh Mar 7, 2025
1c21ac3
Symbol Series, improve trend trace, fixes
EsIstJosh Mar 14, 2025
9e9d436
Merge pull request #18 from EsIstJosh/dev
EsIstJosh Mar 14, 2025
87af153
Update and rename pinets.dev.es.js to .old
EsIstJosh Mar 14, 2025
95d28fa
Update README.md
EsIstJosh Mar 14, 2025
4874ad1
Update README.md
EsIstJosh Mar 14, 2025
b922517
Update README.md
EsIstJosh Mar 14, 2025
637ed5e
Update README.md
EsIstJosh Mar 14, 2025
5accbb3
Update README.md
EsIstJosh Mar 16, 2025
ec7693a
pinets optimization, line fill
EsIstJosh Mar 17, 2025
7c3861c
package-lock
EsIstJosh Mar 17, 2025
311270d
Merge branch 'main' into dev
EsIstJosh Mar 17, 2025
d7aeb37
Merge pull request #19 from EsIstJosh/dev
EsIstJosh Mar 17, 2025
85841ae
optimize live pineTS calc
EsIstJosh Mar 17, 2025
f18d2f2
Merge branch 'dev' of https://github.com/EsIstJosh/lightweight-charts…
EsIstJosh Mar 17, 2025
2ec1fa1
Merge pull request #20 from EsIstJosh/dev
EsIstJosh Mar 17, 2025
fc2ec0b
fix
EsIstJosh Mar 17, 2025
4e253b6
Merge pull request #21 from EsIstJosh/dev
EsIstJosh Mar 17, 2025
e1f51e5
Bump vite from 6.2.1 to 6.2.3
dependabot[bot] Mar 31, 2025
51573e3
Update colors.ts
EsIstJosh Mar 31, 2025
6e8e8c2
Merge pull request #22 from EsIstJosh/dependabot/npm_and_yarn/vite-6.2.3
EsIstJosh Mar 31, 2025
54059ed
Potential fix for code scanning alert no. 59: Prototype-polluting fun…
EsIstJosh Mar 31, 2025
2a6c267
Create codacy.yml
EsIstJosh Mar 31, 2025
71f038b
Merge pull request #23 from EsIstJosh/dev
EsIstJosh Mar 31, 2025
34197c5
Bump vite from 6.2.3 to 6.2.4
dependabot[bot] Apr 1, 2025
c87c7b6
Merge pull request #24 from EsIstJosh/dependabot/npm_and_yarn/vite-6.2.4
EsIstJosh Apr 5, 2025
a1960fe
Bump vite from 6.2.4 to 6.2.5
dependabot[bot] Apr 5, 2025
55210cb
Merge pull request #26 from EsIstJosh/dependabot/npm_and_yarn/vite-6.2.5
EsIstJosh Apr 5, 2025
54642f8
minor fixes
EsIstJosh Apr 9, 2025
4928847
add python method for symbol series
EsIstJosh Apr 18, 2025
36d13b2
update
EsIstJosh Apr 18, 2025
48688dc
fix
EsIstJosh Apr 18, 2025
34fbb12
fix
EsIstJosh Apr 18, 2025
198ad0d
f
EsIstJosh Apr 18, 2025
1893897
fix
EsIstJosh Apr 18, 2025
625d198
Merge branch 'main' into dev
EsIstJosh Apr 18, 2025
f78e6b1
Merge pull request #29 from EsIstJosh/dev
EsIstJosh Apr 18, 2025
e4a9cdb
Rename
EsIstJosh Apr 18, 2025
578428e
fix
EsIstJosh Apr 18, 2025
0586871
Merge branch 'dev' of https://github.com/esistjosh/lightweight-charts…
EsIstJosh Apr 18, 2025
accb57e
Merge pull request #30 from EsIstJosh/dev
EsIstJosh Apr 18, 2025
cde6d5a
rename
EsIstJosh Apr 18, 2025
381f506
Merge pull request #31 from EsIstJosh/dev
EsIstJosh Apr 18, 2025
f16146c
Update README.md
EsIstJosh Apr 18, 2025
f4cd2b2
Add measure tool
EsIstJosh Apr 26, 2025
fbde7b4
Merge branch 'dev' of https://github.com/esistjosh/lightweight-charts…
EsIstJosh Apr 26, 2025
3177947
Merge pull request #34 from EsIstJosh/dev
EsIstJosh Apr 26, 2025
96095de
Fix topbar, other misc. improvements
EsIstJosh May 2, 2025
1aa9972
Merge pull request #38 from EsIstJosh/dev
EsIstJosh May 8, 2025
8c76e09
Delete .github/workflows/codacy.yml
EsIstJosh May 8, 2025
3515b34
add toggle mode option to toolbox
EsIstJosh May 9, 2025
25677de
Add toolbox button to open saved bar sequence / trend trace .json files
EsIstJosh May 9, 2025
43c76a1
toolbox
EsIstJosh May 9, 2025
c5b87b2
Merge pull request #39 from EsIstJosh/dev
EsIstJosh May 9, 2025
8984df9
update build script
EsIstJosh May 9, 2025
2b5af92
bundle
EsIstJosh May 9, 2025
cd4fd7b
Improve toolbox
EsIstJosh May 13, 2025
341f011
fix
EsIstJosh May 13, 2025
83d4776
3.0.8
EsIstJosh May 15, 2025
869aeb1
Merge pull request #41 from EsIstJosh/dev
EsIstJosh May 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/configurationCache.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"buildTargets":[],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}}
661 changes: 661 additions & 0 deletions AGPL_LICENSE

Large diffs are not rendered by default.

File renamed without changes.
149 changes: 141 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,154 @@
<div align="center">

# lightweight-charts-python

[![PyPi Release](https://img.shields.io/pypi/v/lightweight-charts?color=32a852&label=PyPi)](https://pypi.org/project/lightweight-charts/)
[![Made with Python](https://img.shields.io/badge/Python-3.8+-c7a002?logo=python&logoColor=white)](https://python.org "Go to Python homepage")
[![License](https://img.shields.io/github/license/louisnw01/lightweight-charts-python?color=9c2400)](https://github.com/louisnw01/lightweight-charts-python/blob/main/LICENSE)
## Installation

```bash
pip install lightweight-charts-esistjosh


## Installation
```
pip install lightweight-charts-esistjosh
```
## Forked to Add Features
![Cover Image](https://raw.githubusercontent.com/EsIstJosh/lightweight-charts-python/main/Screenshot2025-02-07114921.png)

### PineTS integration (original PineTS source: https://github.com/alaa-eddine/PineTS, edited source: https://github.com/EsIstJosh/PineTS)
### PineTS related code is licensed seperately using the AGPL3.0 license: [AGPL License](./AGPL_LICENSE)
Simple scripting capabilities similar to pinescript,
see the [PineTS ReadMe](https://github.com/EsIstJosh/PineTS/blob/bd79b7f2d21d15f7470da118eab4f71638ce07da/README.md)
for more information


![ezgif-88d432c58012aa](https://github.com/user-attachments/assets/ffbe2b3d-6be6-4d1f-8b42-86e950800712)




### 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.
- Pitch Fork: Tool for drawing (added to toolbox):
- Standard
- Schiff
- Modified Schiff
- Inside
- Volume Profile: Displays volume profiles based on the visible range and supports drawing.

- 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)


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

Overlay Indicators:
- Arnaud Legoux Moving Average
- Bollinger Bands
- Exponential Moving Average
- Highest High
- Highest High Lowest Low
- Linear Regression Indicator
- Lowest Low
- Median
- Moving Average
- Rolling Moving Average
- Simple Moving Average
- Stop and Reverse
- Super Trend
- Symmetric Weighted Moving Average
- Triple Exponentially Smoothed Average
- Volume Weighted Average Price
- Volume Weighted Moving Average
- Weighted Moving Average

Oscillator Indicators:
- Awesome Oscillator
- Average True Range
- Bias
- BRAR
- Bull and Bear Index
- Commodity Channel Index
- Current Ratio
- Difference of Moving Average
- Directional Movement Index
- Momentum
- Moving Average Convergence Divergence
- Psychological Line
- Rate of Change
- Relative Strength Index
- Stochastic Oscillator
- Variance
- Williams %R
- Change
- Range
- Standard Deviation

### Context Menu
- Upgraded context menu for better control over chart/series/primitive settings.
- Ability to save options for chart, series, and primitives to JSON.

### 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




## License

Unless otherwise stated, all code in this repository is licensed under the MIT License.

Additional license: See the [AGPL License](./AGPL_LICENSE) for specific components covered under AGPL.

For full details, refer to the [MIT License](./MIT_LICENSE).
---####################################################################################---
## Original


[![PyPi Release](https://img.shields.io/pypi/v/lightweight-charts?color=32a852&label=PyPi)](https://pypi.org/project/lightweight-charts/)
[![Made with Python](https://img.shields.io/badge/Python-3.8+-c7a002?logo=python&logoColor=white)](https://python.org "Go to Python homepage")
[![Documentation](https://img.shields.io/badge/documentation-006ee3)](https://lightweight-charts-python.readthedocs.io/en/latest/index.html)

![cover](https://raw.githubusercontent.com/louisnw01/lightweight-charts-python/main/cover.png)

lightweight-charts-python aims to provide a simple and pythonic way to access and implement [TradingView's Lightweight Charts](https://www.tradingview.com/lightweight-charts/).
</div>
**lightweight-charts-python** aims to provide a simple and Pythonic way to access and implement [TradingView's Lightweight Charts](https://www.tradingview.com/lightweight-charts/).

---


## Installation

```bash
pip install lightweight-charts-esistjosh


## Installation
```
pip install lightweight-charts
pip install lightweight-charts-esistjosh
```
___

Expand Down
Binary file added Screenshot2025-02-07114921.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 95 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,113 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'

# ─── Configurable Python binary ─────────────────────────────────────────────
VENV_PYTHON="${VENV_PYTHON:-/home/linux/lightweight-charts-python/venv/bin/python}"

# ─── Color codes ─────────────────────────────────────────────────────────────
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
CYAN='\033[0;36m'
NC='\033[0m'
NC='\033[0m' # No Color

# ─── Message prefixes ───────────────────────────────────────────────────────
ERROR="${RED}[ERROR]${NC} "
INFO="${CYAN}[INFO]${NC} "
WARNING="${WARNING}[WARNING]${NC} "
WARNING="${YELLOW}[WARNING]${NC} "

# ─── Flags ───────────────────────────────────────────────────────────────────
BUILD=false
PACKAGE=false
UPLOAD=false

rm -rf dist/bundle.js dist/typings/
# ─── Parse command-line options ─────────────────────────────────────────────
while getopts ":bpu" opt; do
case "${opt}" in
b )
BUILD=true
;;
p )
PACKAGE=true
;;
u )
UPLOAD=true
PACKAGE=true # ensure package runs before upload
BUILD=true # ensure build runs before package
;;
\? )
echo -e "${ERROR}Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done

if [[ $? -eq 0 ]]; then
echo -e "${INFO}deleted bundle.js and typings.."
else
echo -e "${WARNING}could not delete old dist files, continuing.."
# ─── Default to build if no flags provided ──────────────────────────────────
if ! $BUILD && ! $PACKAGE && ! $UPLOAD; then
BUILD=true
fi

npx rollup -c rollup.config.js
if [[ $? -ne 0 ]]; then
# ─── Build process ──────────────────────────────────────────────────────────
perform_build() {
echo -e "${INFO}Starting build process..."
rm -rf dist/bundle.js dist/typings/ || echo -e "${WARNING}No old artifacts to clean"
npx rollup -c rollup.config.js || { echo -e "${ERROR}Rollup build failed."; exit 1; }
cp dist/bundle.js src/general/styles.css lightweight_charts_esistjosh/js/ \
|| { echo -e "${ERROR}Failed to copy build outputs."; exit 1; }
echo -e "${GREEN}[BUILD SUCCESS]${NC}"
}

# ─── Package & install ───────────────────────────────────────────────────────
perform_package() {
echo -e "${INFO}Starting packaging & installation..."
sudo "$VENV_PYTHON" -m build --sdist --wheel \
|| { echo -e "${ERROR}Packaging failed."; exit 1; }
sudo "$VENV_PYTHON" -m pip install . \
|| { echo -e "${ERROR}Installation failed."; exit 1; }
echo -e "${GREEN}[PACKAGE & INSTALL SUCCESS]${NC}"
}

# ─── Upload to PyPI ──────────────────────────────────────────────────────────
perform_upload() {
echo -e "${INFO}Starting upload process..."
OUTPUT_DIR="./output"
rm -rf "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"

shopt -s nullglob
files=(dist/*.tar.gz dist/*.whl)
shopt -u nullglob

if [ ${#files[@]} -eq 0 ]; then
echo -e "${WARNING}No distribution files found; skipping upload."
return
fi

mv "${files[@]}" "$OUTPUT_DIR"/ \
|| { echo -e "${ERROR}Failed to move artifacts to ${OUTPUT_DIR}."; exit 1; }

# ensure twine is available
"$VENV_PYTHON" -m pip install --upgrade twine >/dev/null

echo -e "${INFO}Uploading to PyPI…"
if ! "$VENV_PYTHON" -m twine upload --verbose "$OUTPUT_DIR"/*; then
echo -e "${ERROR}Twine upload failed. Check credentials and network."
exit 1
fi

echo -e "${GREEN}[UPLOAD SUCCESS]${NC}"
}

# ─── Execution order ─────────────────────────────────────────────────────────
if $BUILD; then
perform_build
fi

cp dist/bundle.js src/general/styles.css lightweight_charts/js
if [[ $? -eq 0 ]]; then
echo -e "${INFO}copied bundle.js, style.css into python package"
else
echo -e "${ERROR}could not copy dist into python package ?"
exit 1
if $PACKAGE; then
perform_package
fi
echo -e "\n${GREEN}[BUILD SUCCESS]${NC}"

if $UPLOAD; then
perform_upload
fi
Binary file added docs/source/examples/.events.md.kate-swp
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/source/examples/subchart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```python
import pandas as pd
from lightweight_charts import Chart
from lightweight_charts_esistjosh import Chart

if __name__ == '__main__':
chart = Chart(inner_width=0.5, inner_height=0.5)
Expand Down Expand Up @@ -32,7 +32,7 @@ ___

```python
import pandas as pd
from lightweight_charts import Chart
from lightweight_charts_esistjosh import Chart

if __name__ == '__main__':
chart = Chart(inner_width=1, inner_height=0.8)
Expand All @@ -55,7 +55,7 @@ ___

```python
import pandas as pd
from lightweight_charts import Chart
from lightweight_charts_esistjosh import Chart

# ascii symbols
FULLSCREEN = '■'
Expand Down
Loading