现货合约量化交易所机器人系统是指通过计算机程序实现自动化交易的系统,它可以根据事先设定的交易策略和规则进行自动交易。
策略设计:在开发量化交易机器人系统前,需要制定一个可行的交易策略,Including factors such as buying and selling points,stop loss points,etc.Only in this way can corresponding robot systems be developed based on strategies.
数据获取与处理:In transaction robot systems,data acquisition is very important.main要获取市场行情数据、技术指标数据、基本面数据等,以便于对市场趋势的分析。
def all_plot_pct(codes,names,days,begin_count,end_count=-1):
path='./image/'
Dir=Path(path)
if not Dir.exists():
os.mkdir(Dir)
#file=path+code
#df=pd.read_csv(file)
#codes=df['ts_code'].values[begin_count:end_count]
i=0
count_earnings=0
count_suc=0
count_fail=0
count_hold_days=0
for code,name in zip(codes,names):
i=i+1
earnings,suc,fail,index_array,pct_array,hold_days=test(code,name=name,days=days,begin_count=begin_count,end_count=end_count)
if suc==-1:
continue
count_hold_days=count_hold_days+hold_days
name=str.replace(name,'*','')
if earnings>0:
filedir=path+'AAA%s_%s%d%d++%.1f++%.1f.png'%(code,name,suc,fail,suc*100/(fail+suc+1),earnings)
elif earnings<-0.01: