空策略============================
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date
=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pk:sellshort(closedaytime=1 and holding=-1,1);
kk:buyshort(opendaytime=1 and holding=0,1);
runmode:1;
kfl:openprofit,noaxis;
kzc:asset,noaxis;
kjl:netprofit,noaxis;
============================
多策略=========================
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pd:sell(closedaytime=1 and holding=1,1);
kd:buy(opendaytime=1 and holding=0,1);
runmode:1;
dfl:openprofit,noaxis;
dzc:asset,noaxis;
djl:netprofit,noaxis;
===================================
多空幽灵=========================
dfl:=(#d.dfl()#),noaxis,colorred,linethick1;
kfl:=(#k.kfl()#),noaxis,colorgreen,linethick1;
kd:=dfl>kfl>0;开多
pd:=kfl>dfl>0;平多
kk:=kfl>dfl>0;开空
pk:=dfl>kfl>0;平空
========================
讨论贴
中性看待涨跌,不主观不武断不判断。
多头盈利跟多头,空头盈利跟空头。
当胜率50%情况下,改盈亏比就是了。
应该不难写吧?
[此贴子已经被作者于2020/8/21 20:55:19编辑过]
以下是引用ma-robot在2020/8/21 20:35:36的发言:
空策略============================
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pk:sellshort(closedaytime=1 and holding=-1,1);
kk:buyshort(opendaytime=1 and holding=0,1);
runmode:1;
kfl:openprofit,noaxis;
kzc:asset,noaxis;
kjl:netprofit,noaxis;
============================
多策略=========================
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pd:sell(closedaytime=1 and holding=1,1);
kd:buy(opendaytime=1 and holding=0,1);
runmode:1;
dfl:openprofit,noaxis;
dzc:asset,noaxis;
djl:netprofit,noaxis;
===================================
多空幽灵=========================
dfl:=(#d.dfl()#),noaxis,colorred,linethick1;
kfl:=(#k.kfl()#),noaxis,colorgreen,linethick1;
kd:=dfl>kfl>0;开多
pd:=kfl>dfl>0;平多
kk:=kfl>dfl>0;开空
pk:=dfl>kfl>0;平空
========================
讨论贴
整理一下
空策略==============保存为K策略==============
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pk:sellshort(closedaytime=1 and holding=-1,1);
kk:buyshort(opendaytime=1 and holding=0,1);
runmode:1;
kfl:openprofit,noaxis;
kzc:asset,noaxis;
kjl:netprofit,noaxis;
============================
多策略============保存为D策略=============
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pd:sell(closedaytime=1 and holding=1,1);
kd:buy(opendaytime=1 and holding=0,1);
runmode:1;
dfl:openprofit,noaxis;
dzc:asset,noaxis;
djl:netprofit,noaxis;
===================================
多空幽灵===========主策略保存为DKYL去执行==============
dfl:=(#d.dfl()#),noaxis,colorred,linethick1; //取多头策略D浮动盈亏
kfl:=(#k.kfl()#),noaxis,colorgreen,linethick1;// 取空头策略K浮动盈亏
kd:=buy(dfl>kfl>0,1,1);//开多信号 多头比空头盈利
pd:=sell(kfl>dfl>0,1,0);//平多信号 空头盈利
kk:=buyshort(kfl>dfl>0,1,1);//开空信号 空头比多头盈利
pk:=sellshort(dfl>kfl>0,1,0);//平空信号 多头盈利
========================
多空幽灵通过去读多头策略和空头策略的浮动盈亏判断,那个盈利去开仓
以上策略是三个一个名称为D的策略,一个名为K的策略,主策略是DKYL去运行。
//==================K=========================
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date<startday or totaldaytrade>=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pk:sellshort(closedaytime=1 and holding=-1,1);
kk:buyshort(opendaytime=1 and holding=0,1);
runmode:1;
kfl:openprofit,noaxis;
kzc:asset,noaxis;
kjl:netprofit,noaxis;
//=============D==============
runmode:1;
settradesign(1);
startday:=currentdate-12*100,noaxis,linethick0;
if ref(date,0)<=startday-7 then exit;
opendaytime:=time>=opentime(1)+1*100 and time<=closetime(0)-10000+5959-1*100,noaxis,colorgray;
closedaytime:=time>=closetime(0)-10000+5959-1*100,noaxis,colorgray;
if date<startday or totaldaytrade>=1 then
settradesign(0);
else
settradesign(1);
runmode:0;
pd:sell(closedaytime=1 and holding=1,1);
kd:buy(opendaytime=1 and holding=0,1);
runmode:1;
dfl:openprofit,noaxis;
dzc:asset,noaxis;
djl:netprofit,noaxis;
多空幽灵===========主策略保存为DKYL去执行==============
dfl:=(#d.dfl()#),noaxis,colorred,linethick1; //取多头策略D浮动盈亏
kfl:=(#k.kfl()#),noaxis,colorgreen,linethick1;// 取空头策略K浮动盈亏
kd:=buy(dfl>kfl>0,1,1);//开多信号 多头比空头盈利
pd:=sell(kfl>dfl>0,1,0);//平多信号 空头盈利
kk:=buyshort(kfl>dfl>0,1,1);//开空信号 空头比多头盈利
pk:=sellshort(dfl>kfl>0,1,0);//平空信号 多头盈利
========================
多空幽灵通过去读多头策略和空头策略的浮动盈亏判断,那个盈利去开仓
以上策略是三个一个名称为D的策略,一个名为K的策略,主策略是DKYL去运行。
不知道为啥用苹果浏览器发出来没有回车键。。。。