Rss & SiteMap

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

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

标题:一个关于止盈的问题

1楼
kingmoonwang 发表于:2012/3/14 22:59:11

求一个止盈的写法。

最高盈利达1000点以后,如果出现某收盘价跌破20周期最低点,则以此收盘价止盈。自己写了如下,但应用于图不出现止盈。请高手帮忙看看。或者帮忙写个策略。多谢。

 

variable: hprice=0;

 

if holding=0 then begin
 if Longcond then begin
  buy(1,1,thisclose);
  hprice:=h;
 end

end

 

 

HLN:=ref(LLV(LOW,20),1);

 

if holding>0 and h>=hprice then begin
hprice:=h;
if hprice-enterprice>1000 then begin
if c<HLN then begin
 多止盈: sell(1,holding,thisclose);
 end
 end

[此贴子已经被作者于2012-3-14 23:05:53编辑过]
2楼
rushtaotao 发表于:2012/3/15 8:40:47
稍后工作人员将会给出答复,请稍等
3楼
just 发表于:2012/3/15 9:09:07

variable: hprice=0;
HLN:=ref(LLV(LOW,20),1);

longcond:=cross(ma(c,5),ma(c,10));

 if Longcond then begin
  buy(holding=0,1,thisclose);
  hprice:=h;
end


if holding>0 and h>=hprice then begin
hprice:=h;
end
if hprice-enterprice>50 then begin
if c<HLN then begin
 多止盈: sell(1,holding,thisclose);
end
end

 

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


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