Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:以下金字塔波段王双向开仓策略源码更改为只开多单,只开空单两个策略,谢谢

1楼
代人发贴 发表于:2020/11/10 15:03:15

以下金字塔波段王双向开仓策略源码更改为只开多单,只开空单两个策略,谢谢

 

 

HH1:=IFELSE(H<REF(H,1)&&REF(H,1)<REF(H,2),REF(H,2),0);

LL1:=IFELSE(L>REF(L,1)&&REF(L,1)>REF(L,2),REF(L,2),0);

HH2:=VALUEWHEN(HH1>0,HH1);

LL2:=VALUEWHEN(LL1>0,LL1);

K1:=IFELSE(CLOSE>HH2,-3,IFELSE(CLOSE<LL2,1,0));

K2:=VALUEWHEN(K1<>0,K1);

G:=IFELSE(K2=1,HH2,LL2);

G1:=VALUEWHEN(ISLASTBAR,G);

DRAWNUMBER(L>0,G1,G1,0,COLORCYAN);

W1:=K2;

W2:=OPEN-CLOSE;

HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);

LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);

CROSS(C,G),BPK;

CROSS(G,C),SPK;

2楼
FireScript 发表于:2020/11/10 15:07:22

开空策略:


HH1:=IFELSE(H<REF(H,1)&&REF(H,1)<REF(H,2),REF(H,2),0);

LL1:=IFELSE(L>REF(L,1)&&REF(L,1)>REF(L,2),REF(L,2),0);

HH2:=VALUEWHEN(HH1>0,HH1);

LL2:=VALUEWHEN(LL1>0,LL1);

K1:=IFELSE(CLOSE>HH2,-3,IFELSE(CLOSE<LL2,1,0));

K2:=VALUEWHEN(K1<>0,K1);

G:=IFELSE(K2=1,HH2,LL2);

G1:=VALUEWHEN(ISLASTBAR,G);

DRAWNUMBER(L>0,G1,G1,0,COLORCYAN);

W1:=K2;

W2:=OPEN-CLOSE;

HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);

LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);
if CROSS(C,G) and holding<0 then sellshort(1,holding,market);
if CROSS(G,C) and holding=0 then buyshort(1,holding,market);


开多策略:

HH1:=IFELSE(H<REF(H,1)&&REF(H,1)<REF(H,2),REF(H,2),0);

LL1:=IFELSE(L>REF(L,1)&&REF(L,1)>REF(L,2),REF(L,2),0);

HH2:=VALUEWHEN(HH1>0,HH1);

LL2:=VALUEWHEN(LL1>0,LL1);

K1:=IFELSE(CLOSE>HH2,-3,IFELSE(CLOSE<LL2,1,0));

K2:=VALUEWHEN(K1<>0,K1);

G:=IFELSE(K2=1,HH2,LL2);

G1:=VALUEWHEN(ISLASTBAR,G);

DRAWNUMBER(L>0,G1,G1,0,COLORCYAN);

W1:=K2;

W2:=OPEN-CLOSE;

HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);

LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);

if CROSS(C,G) and holding=-0 then buy(1,holding,market);
if CROSS(G,C) and holding>0 then sell(1,holding,market);

共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 3 queries.