Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:怎么编写固定止盈止损

1楼
xyy13qq 发表于:2016/8/2 9:56:46
举例:期货无论什么品种,我都想盈利 30档位止盈,15档位止损,通用的代码怎么编写
做多止盈止损
做空止盈止损
请老师指教!!!!!!!!!!
2楼
jinzhe 发表于:2016/8/2 10:09:49

多头止损止盈:

if holding>0 and c>enterprice+30*mindiff then sell(1,0,market);

if holding>0 and c<enterprice-15*mindiff then sell(1,0,market);

 

空头止损止盈:

if holding<0 and c<enterprice-30*mindiff then sellshort(1,0,market);

if holding<0 and c>enterprice+15*mindiff then sellshort(1,0,market);

 

共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01953 s, 3 queries.