Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AlphaFin-proj/AlphaFin
/ functions
Functions
63 in github.com/AlphaFin-proj/AlphaFin
⨍
Functions
63
◇
Types & classes
2
↓ 8 callers
Function
get_pivot_data
指定一个字段名,然后将数据变成index是日期,columns是该字段下的变量 输入df和需要按日期分行列名, 输出pivot后的df
src/stage1_trend_prediction/utils.py:398
↓ 6 callers
Function
get_data_by_sql
输入表名和股票篮子数组, 输出从数据库中读取的数据
src/stage1_trend_prediction/utils.py:380
↓ 3 callers
Function
get_adj_data
(code, freq='daily', start_date=None, end_date=None)
src/stage1_trend_prediction/utils.py:421
↓ 2 callers
Function
SMA
:param series_1: 一个pd.Series :param N:窗口长度,求均值时被当作分母 :param M:对新值分配的权重 :return:一个数组
src/stage1_trend_prediction/utils.py:721
↓ 2 callers
Method
concat_docs
(self, docs)
src/stage2_financial_qa/webui/run.py:93
↓ 2 callers
Function
get_指标
(rr, port)
src/stage1_trend_prediction/test_strategy.py:25
↓ 1 callers
Function
BARSLAST
(series_1)
src/stage1_trend_prediction/test_strategy.py:27
↓ 1 callers
Function
ChatGLMPrompt
(instruction, inputs)
src/stage1_trend_prediction/stockgpt_inf.py:53
↓ 1 callers
Method
add_texts
( self, keys, values, metadatas=None, ids=None, **kwargs,
src/stage2_financial_qa/webui/run.py:34
↓ 1 callers
Function
addfield
(dd, code)
src/stage1_trend_prediction/utils.py:704
↓ 1 callers
Function
changeKey
(d, old_k, new_k)
src/stage1_trend_prediction/dataprocess_stockgpt.py:98
↓ 1 callers
Method
checkDate
(self, query)
src/stage2_financial_qa/webui/run.py:73
↓ 1 callers
Function
factors1
(code)
src/stage1_trend_prediction/utils.py:749
↓ 1 callers
Function
factors2
(folder, code)
src/stage1_trend_prediction/utils.py:790
↓ 1 callers
Function
factors3
(code)
src/stage1_trend_prediction/utils.py:818
↓ 1 callers
Function
factors4
(folder, code)
src/stage1_trend_prediction/utils.py:852
↓ 1 callers
Method
from_texts
( cls, keys, values, embedding, metadatas=None,
src/stage2_financial_qa/webui/run.py:15
↓ 1 callers
Function
getGtUpDown
从标准答案中提取涨跌结果 Args: gt: str Returns: up_down: "涨"/"跌",若无法提取出答案,返回 None
src/stage1_trend_prediction/dataprocess_stockgpt.py:5
↓ 1 callers
Function
getModel
(base_model_path, lora_ckpt_path, embedding_model_path, faiss_config,
src/stage2_financial_qa/webui/run.py:122
↓ 1 callers
Function
getPredUpDownStrict
从模型预测结果中提取涨跌结果(严格) Args: pred: str Returns: up_down: -1/0/1, -1表示跌,1表示涨,0表示无法提取出结果
src/stage1_trend_prediction/dataprocess_stockgpt.py:22
↓ 1 callers
Function
get_ST_dates
(df_calendar, dd_nameschange, code)
src/stage1_trend_prediction/utils.py:222
↓ 1 callers
Function
get_codes_by_date
给定交易日,根据上市退市时间,停复牌时间,ST股票时间,行业代码成分股时间,给出可选的股票篮子 the_date:'20201008' indus_code = '850531.SI' 或 None delete_ST = True 或 False
src/stage1_trend_prediction/utils.py:186
↓ 1 callers
Function
get_namechange
(file_path, dd_stocks)
src/stage1_trend_prediction/utils.py:261
↓ 1 callers
Method
get_prompt
(self, doc, query)
src/stage2_financial_qa/webui/run.py:85
↓ 1 callers
Function
get_sw_members
(file_path)
src/stage1_trend_prediction/utils.py:329
↓ 1 callers
Function
get_停复牌
(file_path)
src/stage1_trend_prediction/utils.py:288
↓ 1 callers
Function
main
()
src/stage1_trend_prediction/stockgpt_inf.py:88
↓ 1 callers
Function
parse_args
()
src/stage1_trend_prediction/stockgpt_inf.py:22
↓ 1 callers
Method
process
process the request data
src/stage2_financial_qa/webui/run.py:101
↓ 1 callers
Function
prompt_eval
(args, model, tokenizer, data)
src/stage1_trend_prediction/stockgpt_inf.py:56
↓ 1 callers
Function
获取指数
(df_ports)
src/stage1_trend_prediction/test_strategy.py:54
Function
BARSLAST
处理一个bool序列 计算当前与上一次为True的距离
src/stage1_trend_prediction/utils.py:109
Method
__init__
(self, embedding_model_path, faiss_config)
src/stage2_financial_qa/webui/run.py:47
Method
add_qa_pairs
(self, qa_dict, database="news")
src/stage2_financial_qa/webui/run.py:61
Function
calculate_accuracy
(df)
src/stage1_trend_prediction/test_strategy.py:82
Function
combine_3_fin_data
(利润表, 现金流量表, 资产负债表)
src/stage1_trend_prediction/utils.py:523
Function
de_extreme
中位数去极值 进来的和出去的df都必须是纯数值,因此时间或日期列必须弃掉,用索引装载
src/stage1_trend_prediction/utils.py:939
Function
func_KDJ
(df)
src/stage1_trend_prediction/utils.py:70
Function
func_MACD
(df)
src/stage1_trend_prediction/utils.py:87
Function
getPredUpDownLoose
从模型预测结果中提取涨跌结果(宽松) Args: pred: str Returns: up_down: -1/0/1, -1表示跌,1表示涨,0表示无法提取出结果
src/stage1_trend_prediction/dataprocess_stockgpt.py:50
Function
get_agency_data
(ts_code)
src/stage1_trend_prediction/utils.py:691
Function
get_all_factors
(folder, code, start_date, end_date)
src/stage1_trend_prediction/utils.py:910
Function
get_calendar
(freq, start_date, end_date)
src/stage1_trend_prediction/utils.py:94
Function
get_close_data
(file_path, tp, code, start_date, end_date)
src/stage1_trend_prediction/utils.py:29
Function
get_codes
获取最新的指数成分股
src/stage1_trend_prediction/utils.py:359
Function
get_data
(code)
src/stage1_trend_prediction/utils.py:624
Function
get_fin_data
(end_date, report_type)
src/stage1_trend_prediction/utils.py:590
Function
get_holder_data
(ts_code)
src/stage1_trend_prediction/utils.py:672
Function
get_index_close
获取指数收盘价
src/stage1_trend_prediction/utils.py:370
Function
get_ret_stats
(df)
src/stage1_trend_prediction/utils.py:17
Function
get_stocks
()
src/stage1_trend_prediction/utils.py:117
Function
get_tradeable_stocks
(start_date, end_date, indus_code, delete_ST)
src/stage1_trend_prediction/utils.py:133
Function
halflife_weighting
输入df和指定半衰期,对一个df或series计算指数加权均值
src/stage1_trend_prediction/utils.py:410
Function
main
(base_model_path="", lora_ckpt_path="", embedding_model_path="")
src/stage2_financial_qa/webui/run.py:150
Function
main
(stockgpt_pred_path, mldl_pred_path, save_path)
src/stage1_trend_prediction/dataprocess_stockgpt.py:102
Function
main
(tushare_token, stockgpt_mldl_path, save_dir, file_name)
src/stage1_trend_prediction/test_strategy.py:91
Function
respond
(message, chat_history, topk_slider, database_radio, method_radio)
src/stage2_financial_qa/webui/run.py:176
Function
update_dailyadj_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:470
Function
update_dailybasic_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:442
Function
update_dailykline_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:456
Function
update_financial_data
(table_name, end_dates, engine)
src/stage1_trend_prediction/utils.py:484
Function
update_hkhold_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:561
Function
update_moneyflow_data
(table_name, cal_dates, engine)
src/stage1_trend_prediction/utils.py:576