Rss & SiteMap

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

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

标题:[求助]回撤20点平仓

1楼
宁静致远1 发表于:2016/8/16 14:36:13
老师,回撤20点平仓怎么表达
2楼
jinzhe 发表于:2016/8/16 14:51:01

要分为多和空

多:

if holding>0 and c<hhv(h,enterbars+1)-20 and enterbars>0 then sell(1,0,market);

空:

if holding<0 and c>llv(l,enterbars+1)+20 and enterbars>0 then sellshort(1,0,market);

 

要注意这两句一定要写在开仓语句后面,不然enterbars会判断出错

 

 

3楼
宁静致远1 发表于:2016/8/16 14:51:24
多单,最高收盘价回撤20点,空单最低收盘价回撤20点
4楼
jinzhe 发表于:2016/8/16 14:54:00
要用最高收盘价和最低收盘价,那么这样改:hhv(c,enterbars+1)和llv(c,enterbars+1)
共4 条记录, 每页显示 10 条, 页签: [1]


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