以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]如何编写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=67130)

--  作者:lnjsqh
--  发布时间:2014/7/8 14:29:39
--  [求助]如何编写

反手策略中

如果满足开多条件,进场开多,

出现反手条件后先判断,如果是盈利的,直接平多开空

如果是亏损的,如果与开仓价格偏离大于5个点,就平多开空,如果偏离小于5个点,忽略掉出现的平多开空信号,持有多单不动

请问该如何实现》


--  作者:jinzhe
--  发布时间:2014/7/8 14:33:12
--  

if 开多条件 then buy......;

if 反手条件 then begin

    if openprofit>0 then begin

       sell.........;

       buyshort.........;

    end

    if openprofit<0 and enterprice-l>=5 then begin

       sell........;

       buyshort........;

    end

end