以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请教代码编写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=51583)

--  作者:just1
--  发布时间:2013/5/2 16:58:22
--  请教代码编写
b=1时平多单
b=1 且 mm>10的时候开n%仓位的空单
b=1 且 mm<10的时候开m%仓位的空单

a=1时平空单
a=1 且 mm>10 开n%多单
a=1 且 mm<10 开m%多单


平仓平全部  开仓根据mm的位置按不同比例开仓

--  作者:jinzhe
--  发布时间:2013/5/2 17:28:12
--  

if b=1 then sell(1,0,market);

if b=1 and mm>10 then buyshort(1,n%,market);

if b=1 and mm<10 then buyshort(1,m%,market);

 

if a=1 then sellshort(1,0,market);

if a=1 and mm>10 then buy(1,n%,market);

if a=1 and mm<10 then buy(1,m%,market);