Rss & SiteMap

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

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

标题:老师,帮我写一下

1楼
漫步金字塔 发表于:2012/9/25 14:40:33

日内MACD模型,当今日macd第一次金叉时买入,死叉时卖出,止损10点,止损的同时反手。反手后止损依然是10点,连续止损3次的话就不反手了。等下一次macd金叉或死再入场,同样止损10点,止损后反手,反手次数为3次。收盘前平仓。

 

谢谢老师,帮我写一下!!!

2楼
jinzhe 发表于:2012/9/25 15:16:30

处理中,请稍等

 

3楼
jinzhe 发表于:2012/9/25 15:28:27

 

DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);
DEA  := EMA(DIFF,9);
MACD1 := 2*(DIFF-DEA);
variable:a=0,b=0;
if cross(diff,dea) then  begin
buy(holding=0,1,market);
ENd
if cross(dea,diff) then BEGIN
buyshort(holding=0,1,market);
end
if enterprice-c>10*mindiff and holding>0 and a<3 then BEGIN
sell(holding>0,0,market);
buyshort(holding=0,1,market);
a:=a+1;
end

if c-enterprice>10*mindiff and holding<0 and a<3 then BEGIN
sellshort(holding<0,0,market);
buy(holding=0,1,market);
a:=a+1;
end
if a=3 and enterprice-c>10*mindiff and holding>0 then begin
sell(holding>0,0,market);
a:=0;
end
if a=3 and c-enterprice>10*mindiff and holding<0 then begin
sellshort(holding<0,0,market);
a:=0;
end

if time>145800 and time<=150000 then BEGIN
sell(1,0,market);
sellshort(1,0,market);
a:=0;
end

4楼
漫步金字塔 发表于:2012/9/27 9:38:21

老师,止损改为20点的浮动止损。上面这个模型要怎么写呢?

5楼
jinzhe 发表于:2012/9/27 9:51:51

http://www.weistock.com/bbs/dispbbs.asp?boardid=10&id=2160&page=0&star=1

参考这个

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


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