适配最新QuantChart
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import pandas as pd
|
||||
from chart import plot_chart
|
||||
from chart import QuantChart
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = "ETH_USDT"
|
||||
@@ -9,4 +9,5 @@ if __name__ == "__main__":
|
||||
|
||||
df.rename(columns={"date": "time"}, inplace=True)
|
||||
print(df.head())
|
||||
plot_chart(df, symbol=symbol, name=symbol, timeframe=timeframe)
|
||||
quant_chart = QuantChart()
|
||||
quant_chart.plot_chart(df, symbol=symbol, name=symbol, timeframe=timeframe, init_visible_num_bars=180)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import pandas as pd
|
||||
from loguru import logger
|
||||
from chart import plot_chart, resample_data
|
||||
from chart import resample_data, QuantChart
|
||||
from db_config import DatabaseManager, DatabaseConfig
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ def get_kline(code: str) -> list:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
symbol = "399998"
|
||||
symbol = "399986"
|
||||
timeframe = "1D"
|
||||
|
||||
df = pd.read_csv(
|
||||
@@ -41,4 +41,5 @@ if __name__ == "__main__":
|
||||
df = resample_data(df, timeframe)
|
||||
# df['buy'] = df['time'].apply(lambda x: 1 if pd.to_datetime(x).day % 2 == 1 else 0)
|
||||
# df['sell'] = df['time'].apply(lambda x: 1 if pd.to_datetime(x).day % 2 == 0 else 0)
|
||||
plot_chart(df=df, symbol=symbol, name=name, timeframe=timeframe)
|
||||
quant_chart = QuantChart()
|
||||
quant_chart.plot_chart(df=df, symbol=symbol, name=name, timeframe=timeframe)
|
||||
|
||||
Reference in New Issue
Block a user