以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]涨幅不同分别平仓,怎么编写?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=61601)

--  作者:gz12345678gz
--  发布时间:2014/2/13 12:02:09
--  [求助]涨幅不同分别平仓,怎么编写?
条件A,开多;在平仓时,区分两种情况:开仓价在昨天收盘价跌幅-1%以上的,按条件B平仓;但如果开仓价是在昨天收盘价跌幅-1%以下的,则按赢利两跳平仓。请教下如何编写,谢谢
--  作者:jinzhe
--  发布时间:2014/2/13 13:13:01
--  

if b and (enterprice-ref(close,todaybar))/ref(close,todaybar)<=-0.01 then 平仓语句

if (enterprice-ref(close,todaybar))/ref(close,todaybar)>-0.01 and (enterprice-ref(close,to;daybar))/ref(close,todaybar)<0 and h>=enterrpcie+2*mindiff then 平仓语句;