Rss & SiteMap

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

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

标题:盈利暂停的写法

1楼
左岸 发表于:2014/8/8 17:00:06
条件是CROSS(MA5,MA10)买入,等CROSS(MA10,MA5)时若盈利超过X点,则平仓且暂停Y根K线。如果盈利不超过X点,则直接做反手。
2楼
jinzhe 发表于:2014/8/8 17:10:49

这个暂定的写法比想象中复杂,我先试试看

3楼
jinzhe 发表于:2014/8/8 17:14:27

variable:n=0;
ma5:=ma(c,5);
ma10:=ma(c,10);
X:=5;
Y:=10;
if cross(ma5,ma10) and n=0 and holding=0 then begin
 buy(holding=0,1,market);
 n:=1;
end

IF cross(ma5,ma10) and n=1 and holding=0 and barpos-n>Y then buy(holding=0,1,market);
if cross(ma10,ma5) and holding>0 and n=1 then begin

    if openprofit>x*MULTIPLIER then begin

           sell(1,0,market);

           n:=barpos;

    end

    if openprofit<=x*MULTIPLIER then begin

            sell(1,0,market);

            buyshort(holding=0,1,market);

    end

end

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


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