金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 2748|回复: 2

求教

[复制链接]

8

主题

58

帖子

58

积分

等级: 免费版

注册:
2022-4-14
曾用名:
发表于 2022-7-25 17:15 | 显示全部楼层 |阅读模式
下面策略提示未定义开空和开多,老师帮忙修改一下。

input:ss(1,1,10000,1);


if holding=0 then begin
if 开多条件 then
buy(1,ss,limitr,open);
end

if holding=0 then begin
if 开空条件 then
buyshort(1,ss,limitr,open);
end

//统计出场和止损的次数
variable:n1=0,n2=0,entry=0;

//止损2个atr
if holding>0 and low<enterprice-2*entry and holding>0 then
begin
sell(1,holding,marketr);
n1:=n1+1;
end
if holding<0 and high>enterprice+2*entry and holding<0 then
begin
sellshort(1,holding,marketr);
n1:=n1+1;
end

//破短期高低位,平仓出场
INPUT:Y(10,1,100,5);
Y周期高点:=REF(HHV(H,20),1);
Y周期低点:=REF(LLV(L,20),1);
if low<Y周期低点 and holding>0 then
begin
止损:=sell(1,holding,marketr);
n2:=n2;
end
if high>Y周期高点 and holding<0 then
begin
止损:=sellshort(1,holding,marketr);
n2:=n2;
end

//止损条件止损
if holding>0 then begin
if time>=closetime(0) or 平多条件 then
sell(1,holding,limitr,close);
end

if holding<0 then begin
if time>=closetime(0) or 平空条件 then
sellshort(1,holding,limitr,close);
end

盈亏:asset,noaxis,coloryellow,linethick1;

回复

使用道具 举报

37

主题

9972

帖子

6万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
wenarm
发表于 2022-7-25 17:22 | 显示全部楼层
没法改,因为不知道你开多开空条件怎么定义的。你这个代码从哪抄来的,看下自己是不是抄完整了。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

8

主题

58

帖子

58

积分

等级: 免费版

注册:
2022-4-14
曾用名:
 楼主| 发表于 2022-7-25 17:51 | 显示全部楼层
技术006 发表于 2022-7-25 17:22
没法改,因为不知道你开多开空条件怎么定义的。你这个代码从哪抄来的,看下自己是不是抄完整了。

好的
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-7 06:38 , Processed in 0.141266 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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