MCPcopy Create free account
hub / github.com/DVampire/FinAgent / plot_trading

Method plot_trading

finagent/plots/interface.py:66–82  ·  view source on GitHub ↗
(self, records, info, save_dir)

Source from the content-addressed store, hash-verified

64 return kline_path
65
66 def plot_trading(self, records, info, save_dir):
67 try:
68
69 trading_dir = init_path(os.path.join(self.trading_plot_path, save_dir))
70
71 if not os.path.exists(os.path.join(trading_dir, "echarts.min.js")):
72 shutil.copy(self.echarts_js_path, trading_dir)
73
74 trading_path = os.path.join(trading_dir, "trading_{}.{}".format(info['date'], self.suffix))
75
76 plot_trading(records, trading_path, path=os.path.join(trading_dir, f"{info['date']}_{self.suffix}_trading_render.html"))
77
78 except Exception as e:
79 print(e)
80 trading_path = None
81
82 return trading_path

Callers 6

run_stepFunction · 0.80
run_stepFunction · 0.80
run_stepFunction · 0.80
run_stepFunction · 0.80
run_stepFunction · 0.80
run_stepFunction · 0.80

Calls 2

init_pathFunction · 0.90
plot_tradingFunction · 0.90

Tested by

no test coverage detected