
等级: 新手上路
- 注册:
- 2021-10-30
- 曾用名:
|
老师你好,我想写只做1手的,单独的空策略和单独的多策略,但我写的 做空 策略应用后,会重复开空,做多策略也是有问题,请老师帮我看看,哪里错了帮忙改一改,谢谢!
单独的只做一手开空策略如下:
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
开空条件:cross(d,k);
if 开空条件 and holding<1 then
BEGIN
buyshort(1,1,MARKETR);
end
if enterprice-close>=50 and holding>0 then sellshort(1,holding,MARKETR);
单独的只做一手开多策略如下:
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
开多条件:cross(K,D);
if 开多条件 and holding<1 then
BEGIN
buy(1,1,MARKETR);
end
if enterprice-close>=50 and holding>0 then sell(1,holding,MARKETR);
|
|