以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  反手公式怎么表示  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=141912)

--  作者:zhou6120
--  发布时间:2016/10/28 0:12:56
--  反手公式怎么表示
if HOLDING<=-1 and c>=ENTERPRICE+n3  then
SELLSHORT(1,ss,MARKET);


if HOLDING>=1 and c<=ENTERPRICE-n3  then
SELL(1,ss,MARKET);



亏N3个点平仓止损,反手开单,怎么表示。请教,谢谢。

--  作者:jinzhe
--  发布时间:2016/10/28 9:09:22
--  

if holding>0 and c<enterprice-3 then begin

   sell(1,0,market);

   buyshort(holding=0,1,market);

end

 

if holding<0 and c>enterprice+3 then begin

   sellshort(1,0,market);

   buy(holding=0,1,market);

end