以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  策略编写求助区  (http://222.73.7.161/bbs/list.asp?boardid=11)
----  求助编写策略--改通达信代码  (http://222.73.7.161/bbs/dispbbs.asp?boardid=11&id=181135)

--  作者:hbjzzzw
--  发布时间:2020/7/10 16:18:12
--  求助编写策略--改通达信代码
N1:=5;N2:=10;N3:=20;N4:=30; BBI:(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4,COLORRED,LINETHICK1; BB:=BBI<REF(BBI,1); IF(BB,BBI,DRAWNULL)COLORGREEN,LINETHICK1; {画K线} STICKLINE(C>=BBI,O,C,2.5,1),COLOR0000EE; STICKLINE(C>=BBI AND C>=O,C,H,0,1),COLOR0000EE; STICKLINE(C>=BBI AND C>=O,O,L,0,1),COLOR0000EE; STICKLINE(C>=BBI AND C<O,O,H,0,1),COLOR0000EE; STICKLINE(C>=BBI AND C<O,C,L,0,1),COLOR0000EE; STICKLINE(C<BBI,O,C,2.5,1),COLORBLUE; STICKLINE(C<BBI AND C>=O,C,H,0,1),COLORBLUE; STICKLINE(C<BBI AND C>=O,O,L,0,1),COLORBLUE; STICKLINE(C<BBI AND C<O,O,H,0,1),COLORBLUE; STICKLINE(C<BBI AND C<O,C,L,0,1),COLORBLUE;


N1赋值:5
N2赋值:10
N3赋值:20
N4赋值:30
输出 多空均线:(收盘价的N1日简单移动平均+收盘价的N2日简单移动平均+收盘价的N3日简单移动平均+收盘价的N4日简单移动平均)/4,画红色,线宽为1
BB赋值:BBI<1日前的BBI
 如果BB,返回BBI,否则返回无效数画绿色,线宽为1

   参考通达信的指标      改变为图标交易  红线开空开多   绿线平多开空  

--  作者:hbjzzzw
--  发布时间:2020/7/15 19:42:23
--  

N1:=5;N2:=10;N3:=20;N4:=30; BBI:(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4,COLORRED,LINETHICK1; BB:=BBI<REF(BBI,1); IF(BB,BBI,DRAWNULL)COLORGREEN,LINETHICK1; {画K线} STICKLINE(C>=BBI,O,C,2.5,1),COLOR0000EE; STICKLINE(C>=BBI AND C>=O,C,H,0,1),COLOR0000EE; STICKLINE(C>=BBI AND C>=O,O,L,0,1),COLOR0000EE; STICKLINE(C>=BBI AND C<O,O,H,0,1),COLOR0000EE; STICKLINE(C>=BBI AND C<O,C,L,0,1),COLOR0000EE; STICKLINE(C<BBI,O,C,2.5,1),COLORBLUE; STICKLINE(C<BBI AND C>=O,C,H,0,1),COLORBLUE; STICKLINE(C<BBI AND C>=O,O,L,0,1),COLORBLUE; STICKLINE(C<BBI AND C<O,O,H,0,1),COLORBLUE; STICKLINE(C<BBI AND C<O,C,L,0,1),COLORBLUE;


N1赋值:5
N2赋值:10
N3赋值:20
N4赋值:30
输出 多空均线:(收盘价的N1日简单移动平均+收盘价的N2日简单移动平均+收盘价的N3日简单移动平均+收盘价的N4日简单移动平均)/4,画红色,线宽为1
BB赋值:BBI<1日前的BBI
 如果BB,返回BBI,否则返回无效数画绿色,线宽为1

   参考通达信的指标      改变为图标交易  红线开空开多   绿线平多开空

--  作者:fly
--  发布时间:2021/3/1 16:56:00
--  
N1:=5;N2:=10;N3:=20;N4:=30; 
BBI:(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4,COLORRED,LINETHICK1; 
BB:=BBI<REF(BBI,1); 

STICKLINE(C>=BBI,O,C,2.5,1),COLOR0000EE; 
STICKLINE(C>=BBI AND C>=O,C,H,0,1),COLOR0000EE; 
STICKLINE(C>=BBI AND C>=O,O,L,0,1),COLOR0000EE; 
STICKLINE(C>=BBI AND C<O,O,H,0,1),COLOR0000EE; 
STICKLINE(C>=BBI AND C<O,C,L,0,1),COLOR0000EE; 
STICKLINE(C<BBI,O,C,2.5,1),COLORBLUE; 
STICKLINE(C<BBI AND C>=O,C,H,0,1),COLORBLUE; 
STICKLINE(C<BBI AND C>=O,O,L,0,1),COLORBLUE; 
STICKLINE(C<BBI AND C<O,O,H,0,1),COLORBLUE; 
STICKLINE(C<BBI AND C<O,C,L,0,1),COLORBLUE;

//平空开多
if C>=BBI THEN
BEGIN
sellshort( holding<0,1,market);
buy(holding=0,1,market);
END

//平多开空
if C<BBI THEN
BEGIN
sell(holding>0,1,market);
buyshort(holding=0,1,market);
END
[此贴子已经被作者于2021/3/1 16:58:01编辑过]