以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  老师,帮我看一下,哪里写错了  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=74491)

--  作者:IF左边
--  发布时间:2015/1/15 11:56:21
--  老师,帮我看一下,哪里写错了
 我是用区别的止盈策略。
hh:=hhv(h,enterbars+1);
if hhv(h,enterbars+1)>=enterprice+4*s  and 止盈条件 and c<=L20 then begin
   sell(1,0,market);
   end
   else begin  
if hh>=enterprice+4*s    then begin
   sell(1,0,market);
   end
   end
这样写之后,全部还是后面这一种止盈方式。得不到区别的止盈效果,是哪里写错了,老师帮我看一下。

--  作者:jinzhe
--  发布时间:2015/1/15 13:32:16
--  
在hh>=enterprice+4*s成立的同时 止盈条件 and c<=L20不成立
--  作者:IF左边
--  发布时间:2015/1/15 13:46:22
--  
 else begin  
后面加
if hh>=enterprice+4*s    then begin
。。
end
这样写能成立吗?

--  作者:jinzhe
--  发布时间:2015/1/15 13:59:31
--  

你的思路是什么?1不成立的情况下执行2?

那么上面就全部满足需求了