等级: 免费版
- 注册:
- 2022-4-2
- 曾用名:
|
求助老师这个策略一加载到组合里就出现内存警告,所以想改成单独的后台程序化。请问怎么修改好些
//时间2023/3/18
//
bpkcond:="hhv_llv.bpkcond#min3"; //引用多头信号
spkcond:="hhv_llv.spkcond#min3"; //引用空头信号
//***********************************//交易条件//***********************************//
//***********************************//lots定义//***********************************//
variable:open_price=0;
if bpkcond or spkcond then begin
open_price:=oclose;
end
lots:=max(round((20*10000/(open_price*multiplier))),1);
//
buy_filcond:=1;//(numprofit(1)>=0 or (numprofit(1)<0 and c>hv));
sell_filcond:=1;//(numprofit(1)>=0 or (numprofit(1)<0 and c<lv));
//***********************************//交易条件//***********************************//
if bpkcond then begin
sellshort(holding<0,holding,thisclose);
buy(holding=0 and buy_filcond,lots,thisclose);
end
if spkcond then begin
sell(holding>0,holding,thisclose);
buyshort(holding=0 and sell_filcond,lots,thisclose);
end
cc0:holding;
cc:ref(cc0,1);
持仓:holding,colorgray,linethick0;
资产:asset,noaxis,coloryellow;
补充内容 (2023-6-26 11:15):
如果作为后台程序加入在后台预警中加入策略,会不会影响其他策略持仓。可以写成序列模式下的策略,再用多策略引用持仓吗 |
|