以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  比较价格的图表程序  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=97515)

--  作者:llcly
--  发布时间:2016/5/17 12:58:11
--  比较价格的图表程序

当TRIX金叉时,如果收盘价低于20日均线价格,以收盘价开多仓,等TRIX死叉时,平多仓。


如果收盘价高于20日均线价格,以20日均线价格(4舍5入)发指令开多仓,等TRIX死叉时,平多仓。


--  作者:pyd
--  发布时间:2016/5/17 13:16:52
--  

TR1: EMA(EMA(EMA(CLOSE,P),P),P);
TRIX : (TR1-REF(TR1,1))/REF(TR1,1)*100;
TRMA1 :  MA(TRIX,N);
jc:=cross(trix,trma1);
sc:=cross(trma1,trix);
ma20:ma(c,20);
if jc and c<ma20 and holding=0 then buy(1,1,limitr,c);

if c>ma20 and holding=0 then buy(1,1,limitr,ma20);
if sc and holding>0 then sell(1,1,market);


--  作者:jinzhe
--  发布时间:2016/5/17 13:19:34
--  

TR1:= EMA(EMA(EMA(CLOSE,P),P),P);
TRIX : (TR1-REF(TR1,1))/REF(TR1,1)*100;
TRMA1 :  MA(TRIX,N);
ma20:=ma(c,20);
if cross(trix,trma1) and c<ma20 then buy(holding=0,1,limitr,close);

if c>ma20 and cross(trix,trma1) then buy(holding=0,1,limitr,ma20),IGNORECHECKPRICE;

if cross(trma1,trix) then sell(1,0,marketr);


--  作者:llcly
--  发布时间:2016/5/25 16:22:10
--  
非常感谢,回头试试。
--  作者:llcly
--  发布时间:2016/5/25 16:22:23
--  
非常感谢,回头试试。