examples moved to archive
This commit is contained in:
BIN
archive/examples/2_live_data/live_data.gif
Normal file
BIN
archive/examples/2_live_data/live_data.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 MiB |
25
archive/examples/2_live_data/live_data.py
Normal file
25
archive/examples/2_live_data/live_data.py
Normal file
@ -0,0 +1,25 @@
|
||||
import pandas as pd
|
||||
from time import sleep
|
||||
from lightweight_charts import Chart
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
chart = Chart()
|
||||
|
||||
df1 = pd.read_csv('ohlcv.csv')
|
||||
df2 = pd.read_csv('next_ohlcv.csv')
|
||||
|
||||
chart.set(df1)
|
||||
|
||||
chart.show()
|
||||
|
||||
last_close = df1.iloc[-1]['close']
|
||||
|
||||
for i, series in df2.iterrows():
|
||||
chart.update(series)
|
||||
|
||||
if series['close'] > 20 and last_close < 20:
|
||||
chart.marker(text='The price crossed $20!')
|
||||
|
||||
last_close = series['close']
|
||||
sleep(0.1)
|
||||
1492
archive/examples/2_live_data/next_ohlcv.csv
Normal file
1492
archive/examples/2_live_data/next_ohlcv.csv
Normal file
File diff suppressed because it is too large
Load Diff
1491
archive/examples/2_live_data/ohlcv.csv
Normal file
1491
archive/examples/2_live_data/ohlcv.csv
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user