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

Method data_process

finagent/tools/strategy_agents.py:11–21  ·  view source on GitHub ↗

Method to process the input dataframe. Renames columns to standard names.

(self, data)

Source from the content-addressed store, hash-verified

9 """
10
11 def data_process(self, data):
12 """
13 Method to process the input dataframe.
14 Renames columns to standard names.
15 """
16 if isinstance(data, np.ndarray):
17 df = pd.DataFrame(data, columns=['open', 'high', 'low', 'close', 'adj_close'])
18 else:
19 df = data
20 df = df.rename(columns={'open': 'Open', 'high': 'High', 'low': 'Low', 'close': 'Close', 'volume': 'Volume'})
21 return df
22
23 def wrapper(self,strategy, data,params=None):
24 """

Callers 6

strategy1_MACDMethod · 0.95
strategy2_KDJ_RSIMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected