254 lines
9.0 KiB
Python
254 lines
9.0 KiB
Python
# 读取配置
|
|
from config_jingbo import *
|
|
# from config_tansuanli import *
|
|
from lib.tools import *
|
|
from lib.dataread import *
|
|
from models.nerulforcastmodels import ex_Model, model_losss, brent_export_pdf, tansuanli_export_pdf
|
|
from models.lstmmodels import ex_Lstm_M, ex_Lstm
|
|
from models.grumodels import ex_GRU
|
|
import glob
|
|
import torch
|
|
torch.set_float32_matmul_precision("high")
|
|
|
|
|
|
names = [
|
|
'价格预测NHITS模型-次周',
|
|
'价格预测Informer模型-次周',
|
|
'价格预测LSTM模型-次周',
|
|
'价格预测iTransformer模型-次周',
|
|
'价格预测TSMixer模型-次周',
|
|
'价格预测TSMixerx模型-次周',
|
|
'价格预测PatchTST模型-次周',
|
|
'价格预测RNN模型-次周',
|
|
'价格预测GRU模型-次周',
|
|
'价格预测TCN模型-次周',
|
|
'价格预测BiTCN模型-次周',
|
|
'价格预测DilatedRNN模型-次周',
|
|
'价格预测MLP模型-次周',
|
|
'价格预测DLinear模型-次周',
|
|
'价格预测NLinear模型-次周',
|
|
'价格预测TFT模型-次周',
|
|
'价格预测FEDformer模型-次周',
|
|
'价格预测StemGNN模型-次周',
|
|
'价格预测MLPMultivariate模型-次周',
|
|
'价格预测TiDE模型-次周',
|
|
'价格预测DeepNPTS模型-次周',
|
|
'价格预测NBEATS模型-次周',
|
|
'价格预测NHITS模型-隔周',
|
|
'价格预测Informer模型-隔周',
|
|
'价格预测LSTM模型-隔周',
|
|
'价格预测iTransformer模型-隔周',
|
|
'价格预测TSMixer模型-隔周',
|
|
'价格预测TSMixerx模型-隔周',
|
|
'价格预测PatchTST模型-隔周',
|
|
'价格预测RNN模型-隔周',
|
|
'价格预测GRU模型-隔周',
|
|
'价格预测TCN模型-隔周',
|
|
'价格预测BiTCN模型-隔周',
|
|
'价格预测DilatedRNN模型-隔周',
|
|
'价格预测MLP模型-隔周',
|
|
'价格预测DLinear模型-隔周',
|
|
'价格预测NLinear模型-隔周',
|
|
'价格预测TFT模型-隔周',
|
|
'价格预测FEDformer模型-隔周',
|
|
'价格预测StemGNN模型-隔周',
|
|
'价格预测MLPMultivariate模型-隔周',
|
|
'价格预测TiDE模型-隔周',
|
|
'价格预测DeepNPTS模型-隔周',
|
|
'价格预测NBEATS模型-隔周',
|
|
'价格预测NHITS模型-次月',
|
|
'价格预测Informer模型-次月',
|
|
'价格预测LSTM模型-次月',
|
|
'价格预测iTransformer模型-次月',
|
|
'价格预测TSMixer模型-次月',
|
|
'价格预测TSMixerx模型-次月',
|
|
'价格预测PatchTST模型-次月',
|
|
'价格预测RNN模型-次月',
|
|
'价格预测GRU模型-次月',
|
|
'价格预测TCN模型-次月',
|
|
'价格预测BiTCN模型-次月',
|
|
'价格预测DilatedRNN模型-次月',
|
|
'价格预测MLP模型-次月',
|
|
'价格预测DLinear模型-次月',
|
|
'价格预测NLinear模型-次月',
|
|
'价格预测TFT模型-次月',
|
|
'价格预测FEDformer模型-次月',
|
|
'价格预测StemGNN模型-次月',
|
|
'价格预测MLPMultivariate模型-次月',
|
|
'价格预测TiDE模型-次月',
|
|
'价格预测DeepNPTS模型-次月',
|
|
'价格预测NBEATS模型-次月',
|
|
'价格预测NHITS模型-次二月',
|
|
'价格预测Informer模型-次二月',
|
|
'价格预测LSTM模型-次二月',
|
|
'价格预测iTransformer模型-次二月',
|
|
'价格预测TSMixer模型-次二月',
|
|
'价格预测TSMixerx模型-次二月',
|
|
'价格预测PatchTST模型-次二月',
|
|
'价格预测RNN模型-次二月',
|
|
'价格预测GRU模型-次二月',
|
|
'价格预测TCN模型-次二月',
|
|
'价格预测BiTCN模型-次二月',
|
|
'价格预测DilatedRNN模型-次二月',
|
|
'价格预测MLP模型-次二月',
|
|
'价格预测DLinear模型-次二月',
|
|
'价格预测NLinear模型-次二月',
|
|
'价格预测TFT模型-次二月',
|
|
'价格预测FEDformer模型-次二月',
|
|
'价格预测StemGNN模型-次二月',
|
|
'价格预测MLPMultivariate模型-次二月',
|
|
'价格预测TiDE模型-次二月',
|
|
'价格预测DeepNPTS模型-次二月',
|
|
'价格预测NBEATS模型-次二月',
|
|
'价格预测NHITS模型-次三月',
|
|
'价格预测Informer模型-次三月',
|
|
'价格预测LSTM模型-次三月',
|
|
'价格预测iTransformer模型-次三月',
|
|
'价格预测TSMixer模型-次三月',
|
|
'价格预测TSMixerx模型-次三月',
|
|
'价格预测PatchTST模型-次三月',
|
|
'价格预测RNN模型-次三月',
|
|
'价格预测GRU模型-次三月',
|
|
'价格预测TCN模型-次三月',
|
|
'价格预测BiTCN模型-次三月',
|
|
'价格预测DilatedRNN模型-次三月',
|
|
'价格预测MLP模型-次三月',
|
|
'价格预测DLinear模型-次三月',
|
|
'价格预测NLinear模型-次三月',
|
|
'价格预测TFT模型-次三月',
|
|
'价格预测FEDformer模型-次三月',
|
|
'价格预测StemGNN模型-次三月',
|
|
'价格预测MLPMultivariate模型-次三月',
|
|
'价格预测TiDE模型-次三月',
|
|
'价格预测DeepNPTS模型-次三月',
|
|
'价格预测NBEATS模型-次三月',
|
|
'价格预测NHITS模型-次四月',
|
|
'价格预测Informer模型-次四月',
|
|
'价格预测LSTM模型-次四月',
|
|
'价格预测iTransformer模型-次四月',
|
|
'价格预测TSMixer模型-次四月',
|
|
'价格预测TSMixerx模型-次四月',
|
|
'价格预测PatchTST模型-次四月',
|
|
'价格预测RNN模型-次四月',
|
|
'价格预测GRU模型-次四月',
|
|
'价格预测TCN模型-次四月',
|
|
'价格预测BiTCN模型-次四月',
|
|
'价格预测DilatedRNN模型-次四月',
|
|
'价格预测MLP模型-次四月',
|
|
'价格预测DLinear模型-次四月',
|
|
'价格预测NLinear模型-次四月',
|
|
'价格预测TFT模型-次四月',
|
|
'价格预测FEDformer模型-次四月',
|
|
'价格预测StemGNN模型-次四月',
|
|
'价格预测MLPMultivariate模型-次四月',
|
|
'价格预测TiDE模型-次四月',
|
|
'价格预测DeepNPTS模型-次四月',
|
|
'价格预测NBEATS模型-次四月',
|
|
]
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
signature = BinanceAPI(APPID, SECRET)
|
|
etadata = EtaReader(signature=signature,
|
|
classifylisturl=classifylisturl,
|
|
classifyidlisturl=classifyidlisturl,
|
|
edbcodedataurl=edbcodedataurl,
|
|
edbcodelist=edbcodelist,
|
|
edbdatapushurl=edbdatapushurl,
|
|
edbdeleteurl=edbdeleteurl,
|
|
edbbusinessurl=edbbusinessurl,
|
|
classifyId=ClassifyId,
|
|
)
|
|
|
|
models = [
|
|
'NHITS',
|
|
'Informer',
|
|
'LSTM',
|
|
'iTransformer',
|
|
'TSMixer',
|
|
'TSMixerx',
|
|
'PatchTST',
|
|
'RNN',
|
|
'GRU',
|
|
'TCN',
|
|
'BiTCN',
|
|
'DilatedRNN',
|
|
'MLP',
|
|
'DLinear',
|
|
'NLinear',
|
|
'TFT',
|
|
'FEDformer',
|
|
'StemGNN',
|
|
'MLPMultivariate',
|
|
'TiDE',
|
|
'DeepNPT']
|
|
|
|
# eta自由数据指标编码
|
|
modelsindex = {
|
|
'NHITS': 'SELF0000001',
|
|
'Informer': 'SELF0000057',
|
|
'LSTM': 'SELF0000058',
|
|
'iTransformer': 'SELF0000059',
|
|
'TSMixer': 'SELF0000060',
|
|
'TSMixerx': 'SELF0000061',
|
|
'PatchTST': 'SELF0000062',
|
|
'RNN': 'SELF0000063',
|
|
'GRU': 'SELF0000064',
|
|
'TCN': 'SELF0000065',
|
|
'BiTCN': 'SELF0000066',
|
|
'DilatedRNN': 'SELF0000067',
|
|
'MLP': 'SELF0000068',
|
|
'DLinear': 'SELF0000069',
|
|
'NLinear': 'SELF0000070',
|
|
'TFT': 'SELF0000071',
|
|
'FEDformer': 'SELF0000072',
|
|
'StemGNN': 'SELF0000073',
|
|
'MLPMultivariate': 'SELF0000074',
|
|
'TiDE': 'SELF0000075',
|
|
'DeepNPT': 'SELF0000076'
|
|
}
|
|
|
|
# df_predict = pd.read_csv('dataset/predict.csv',encoding='gbk')
|
|
# # df_predict.rename(columns={'ds':'Date'},inplace=True)
|
|
# for m in modelsindex.keys():
|
|
# list = []
|
|
# for date,value in zip(df_predict['ds'],df_predict[m]):
|
|
# list.append({'Date':date,'Value':value})
|
|
# data['DataList'] = list
|
|
# data['IndexCode'] = modelsindex[m]
|
|
# data['IndexName'] = f'价格预测{m}模型'
|
|
# data['Remark'] = m
|
|
# # print(data['DataList'])
|
|
# etadata.push_data(data)
|
|
|
|
# 新增eta自有指标
|
|
# list = [{'Date': '2025-04-21', 'Value': 100}]
|
|
# for name in names:
|
|
# data['DataList'] = list
|
|
# data['IndexName'] = name
|
|
# data['Remark'] = name
|
|
# # print(data['DataList'])
|
|
# etadata.push_data(data)
|
|
# time.sleep(1)
|
|
|
|
# 删除指标
|
|
# SELF0000098
|
|
# IndexCodeList = ['SELF0000098']
|
|
# # for i in range(1,57):
|
|
# # if i < 10 : i = f'0{i}'
|
|
# # IndexCodeList.append(f'SELF00000{i}')
|
|
# print(IndexCodeList)
|
|
# etadata.del_zhibiao(IndexCodeList)
|
|
|
|
# 删除特定日期的值
|
|
# indexcodelist = modelsindex.values()
|
|
# for indexcode in indexcodelist:
|
|
# data = {
|
|
# "IndexCode": indexcode, # 指标编码
|
|
# "StartDate": "2020-04-20", # 指标需要删除的开始日期(>=),如果开始日期和结束日期相等,那么就是删除该日期
|
|
# "EndDate": "2024-05-28" # 指标需要删除的结束日期(<=),如果开始日期和结束日期相等,那么就是删除该日期
|
|
# }
|
|
|
|
# etadata.del_business(data)
|