金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 3557|回复: 5

改模型

[复制链接]

1

主题

3

帖子

3

积分

Rank: 1

等级: 新手上路

注册:
2022-11-22
曾用名:
发表于 2022-11-22 14:47 | 显示全部楼层 |阅读模式
老师,能不能帮我 改文华的 模型
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-22 14:50 | 显示全部楼层
你代码先贴上来。

能改,但是毕竟是2个软件。很多底层机制以及一些边边角角的差异还是蛮多的。

所以直接改的话 最终效果仅供参考。  如果你文化的代码不是很多可用发上来我们尝试下。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

1

主题

3

帖子

3

积分

Rank: 1

等级: 新手上路

注册:
2022-11-22
曾用名:
 楼主| 发表于 2022-11-22 14:53 | 显示全部楼层
J:=BARSLAST(DATE<>REF(DATE,1))+1;
OO:VALUEWHEN(J=1,O);
HA1:=REF(HHV(H,J),J);
LA:=REF(LLV(L,J),J);
TER:=HA1-LA;
AA:OO+0.5*TER;
BB:OO-0.5*TER;
MA5:MA(C,5);
B1:=NOT(ISLASTBP&&BARSBP<J-1)&&NOT(ISLASTSP&&BARSSP<J-1);
B1&&REF(CROSS(C,AA),1)&&C>AA&&TER<C*0.05&&DAYBARPOS<120,BK(S1);
B1&&BARSBK<J&&C>BKPRICE,BK(S2);
B1&&BARSBK<J&&C>BKPRICE,BK(S2);
B1&&REF(CROSS(BB,C),1)&&C<BB&&TER<C*0.05&&DAYBARPOS<120,SK(S1);
B1&&BARSSK<J&&C<SKPRICE,SK(S2);
B1&&BARSSK<J&&C<SKPRICE,SK(S2);
C>BB&&C>=(SKPRICE+SKPRICE*0.006)&&SKVOL=S1,BP(SKVOL);
AA>C&&C<=(BKPRICE-BKPRICE*0.006)&&BKVOL=S1,SP(BKVOL);
C>BB&&C>=(SKPRICE+SKPRICE*0.004)&&SKVOL=S1+S2,BP(SKVOL);
AA>C&&C<=(BKPRICE-BKPRICE*0.004)&&BKVOL=S1+S2,SP(BKVOL);
C>BB&&C>=(SKPRICE+SKPRICE*0.002)&&SKVOL>S1+S2,BP(SKVOL);
AA>C&&C<=(BKPRICE-BKPRICE*0.002)&&BKVOL>S1+S2,SP(BKVOL);
SKLOW<=SKPRICE*0.99&&(C>=SKLOW+(SKPRICE-SKLOW)),BP(SKVOL);
BKHIGH>=BKPRICE*1.01&&(C<=BKHIGH-(BKHIGH-BKPRICE)),SP(BKVOL);
EXIST(EVERY(ISDOWN,3),5)&&SKPRICE-C>C*0.01&&CROSS(C,MA5),BP(S1);
EXIST(EVERY(ISUP,3),5)&&C-BKPRICE>C*0.01&&CROSS(MA5,C),SP(S1);
EXIST(EVERY(ISDOWN,3),5)&&SKPRICE-C>C*0.02&&CROSS(C,MA5),BP(S2);
EXIST(EVERY(ISUP,3),5)&&C-BKPRICE>C*0.02&&CROSS(MA5,C),SP(S2);
EXIST(EVERY(ISDOWN,3),5)&&SKPRICE-C>C*0.03&&CROSS(C,MA5),BP(S2);
EXIST(EVERY(ISUP,3),5)&&C-BKPRICE>C*0.03&&CROSS(MA5,C),SP(S2);
C>=(SKPRICE+SKPRICE*0.01),BP(SKVOL);
C<=(BKPRICE-BKPRICE*0.01),SP(BKVOL);
CLOSEMINUTE=3,BP(SKVOL);
CLOSEMINUTE=3,SP(BKVOL);
SETSIGPRICETYPE(BK,CMPETITV_ORDER);
SETSIGPRICETYPE(SK,CMPETITV_ORDER);
SETSIGPRICETYPE(BP,CMPETITV_ORDER);
SETSIGPRICETYPE(SP,CMPETITV_ORDER);
SETEXPIREDATE('20301001');
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-22 15:33 | 显示全部楼层
本帖最后由 技术009 于 2022-11-22 15:42 编辑

input:s1(1,1,100,1),s2(2,1,100,1);
j:=barslast(date<>ref(date,1))+1;
oo:valuewhen(j=1,o);
ha1:=ref(hhv(h,j),j);
la:=ref(llv(l,j),j);
ter:=ha1-la;
aa:oo+0.5*ter;
bb:oo-0.5*ter;
ma5:ma(c,5);

t:=type(1);

b1:=not(t=4 and enterbars+1<j-1) and not(t=2 and  enterbars+1<j-1);
if b1 and ref(cross(c,aa),1) and c>aa and ter<c*0.05 and todaybar<120 then buy(holding=0,s1,market);
if b1 and enterbars+1<j and holding>0 and c>enterprice then buy(1,s2,market);
if b1 and enterbars+1<j and holding>0 and c>enterprice then buy(1,s2,market);

if b1 and ref(cross(bb,c),1) and c<bb and ter<c*0.05 and todaybar<120 then buyshort(holding=0,s1,market);
if b1 and enterbars+1<j and holding<0 and  c<enterprice then buyshort(1,s2,market);
if b1 and enterbars+1<j and holding<0 and  c<enterprice then buyshort(1,s2,market);

if c>bb and c>=(enterprice+enterprice*0.006) and holding=-s1  then sellshort(1,holding,market);
if aa>c and c<=(enterprice-enterprice*0.006) and holding=s1 then sell(1,holding,market);
if c>bb and c>=(enterprice+enterprice*0.004) and holding=-(s1+s2) then sellshort(1,holding,market);
if aa>c and c<=(enterprice-enterprice*0.004) and holding=s1+s2 then sell(1,holding,market);
if c>bb and c>=(enterprice+enterprice*0.002) and  holding<-(s1+s2) then sellshort(1,holding,market);
if aa>c and c<=(enterprice-enterprice*0.002) and holding>s1+s2 then sell(1,holding,market);
sklow:=llv(l,enterbars+1);
bkhigh:=hhv(h,enterbars+1);
if sklow<=enterprice*0.99 and c>=enterprice then sellshort(1,holding,market);
if bkhigh>=enterprice*1.01 and c<=enterprice then sell(1,holding,market);

if exist(every(isdown,3),5) and enterprice-c>c*0.01 and cross(c,ma5)  then sellshort(1,s1,market);
if exist(every(isup,3),5) and c-enterprice>c*0.01 and cross(ma5,c) then sell(1,s1,market);
if exist(every(isdown,3),5) and enterprice-c>c*0.02 and cross(c,ma5) then sellshort(1,s2,market);
if exist(every(isup,3),5) and c-enterprice>c*0.02 and cross(ma5,c) then sell(1,s2,market);
if exist(every(isdown,3),5) and enterprice-c>c*0.03 and cross(c,ma5) then sellshort(1,s2,market);
if exist(every(isup,3),5) and c-enterprice>c*0.03 and cross(ma5,c) then sell(1,s2,market);
if c>=(enterprice+enterprice*0.01) then sellshort(1,s2,market);
if c<=(enterprice-enterprice*0.01) then sell(1,holding,market);



m1:t0totime(timetot0(closetime(0))-3*60); //收盘前1分钟
if (m1<=dynainfo(207) and islastbar) or (time=190000 and not(islastbar)) then begin //注意:6.23 以后版本,图表上使用islastbar函数,请勿勾选仅刷最后一根k
收盘平多:sell(1,holding,market);
收盘平空:sellshort(1,holding,market);
end


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

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2022-11-22 15:43 | 显示全部楼层
先这样看下,我也看看有没有细节地方有差异。

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

使用道具 举报

1

主题

3

帖子

3

积分

Rank: 1

等级: 新手上路

注册:
2022-11-22
曾用名:
 楼主| 发表于 2022-11-22 15:50 | 显示全部楼层
xie
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-8 22:44 , Processed in 0.238298 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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