金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 3938|回复: 3

为什么是4

[复制链接]

52

主题

177

帖子

177

积分

等级: 免费版

注册:
2021-8-13
曾用名:
发表于 2022-3-15 15:47 | 显示全部楼层 |阅读模式

我用五均十均金死叉试验
if PK   THEN
BEGIN
        sellshort(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if PD  THEN
BEGIN
        sell(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;


end

我是计录赔钱的次数
怎么zz是4,不是2


回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-3-15 15:51 | 显示全部楼层
完整能展示这个问题的代码贴下。

金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

52

主题

177

帖子

177

积分

等级: 免费版

注册:
2021-8-13
曾用名:
 楼主| 发表于 2022-3-15 21:37 | 显示全部楼层
VARIABLE: ss:=1;
ma1:ma(c,5);
ma2:ma(c,10);
ma3:ma(c,44);
ma4:ma(c,65);

kd1:= ma1>ma2 and ma1 >ma3  and ma1  >ma4 and ma2 >ma3 and ma2  >ma4 and ma3 >ma4   ;
kk2:= ma1<ma2 and ma1 <ma3  and ma1  <ma4 and ma2 <ma3 and ma2 <ma4 and ma3<ma4;


KD:=   kd1  ;

KK:= kk2 ;
PK:= cross(c,ma4) ;
PD:=cross(ma4,c) ;


if PK   THEN
BEGIN
        sellshort(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if PD  THEN
BEGIN
        sell(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;


end


if zz=1 then ss:=1;
if zz=2 then ss:=1;
if zz=3 then ss:=2;
if zz>=4 then ss:=4;



IF KD  THEN BUY(holding=0,ss,MARKETR);
IF KK  THEN BUYSHORT(holding=0,ss,MARKETR);
回复

使用道具 举报

37

主题

9933

帖子

5万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
wenarm
发表于 2022-3-15 22:20 | 显示全部楼层
因为你平仓条件,在没有仓位时,也是有可能成立的。那么就会执行子语句。

if PK and holding<0  THEN
BEGIN
sellshort(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if PD  and holding>0   THEN
BEGIN
sell(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;

金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-5-26 01:24 , Processed in 0.160503 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表