Rss & SiteMap

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

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

标题:请教下怎么移动止损?

1楼
onmidas 发表于:2015/5/3 22:40:20
当行情浮盈超过p%时,将止损价移到进场成本价,该如何编写公式?
多谢!
2楼
jinzhe 发表于:2015/5/4 9:02:14

if holding>0 and hhv(h,enterbars+1)-enterprice/enterprice>=p*0.01 and l<=enterprice then sell(1,0,market);//多头

if holding<0 and enterprice-llv(l,enterbars+1)/llv(l,entebars+1)>=p*0.01 and h>=enterprice then sellshort(1,0,market);//空头

 

以上代码适用于固定轮询模式,如果是走完k线模式则可以把 l<=enterprice 改成c<=enterprice ; 把h>=enterprice 改成c>=enterprice

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


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