本帖最后由 资深技术05 于 2024-8-26 14:15 编辑
这个用代码实现可能不是很稳健,下面是一个参考范例,你可以自己在模拟上先试试。
[PEL] 复制代码
globalvariable:pc:=0;
h1:callstock('',vthigh,6,0);
回落:100*(h1-c)/h1;
if pc=0 and 回落>=1.5 and tbuyholdingex('','',1)>0 then pc:=1;
下单资金量:=50000;
ss1:100*intpart(下单资金量/(c*100));//根据资金zj计算的开仓手数
ss1:=5;
if pc and tisremainex(2,'',stklabel)=0 and tbuyholdingex('','',1)>0 then tsell(1,min(ss1,tbuyholdingex('','',1)),mkt),ALLOWREPEAT;
if tbuyholdingex('','',1)=0 and tisremainex(2,'',stklabel)=0 then pc:=0; |