Rss & SiteMap

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

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

标题:资金管理

1楼
acerap 发表于:2012/6/1 9:59:30
谁会写资金亏损额度达到开仓前总资金的5%是自动平仓?
2楼
jinzhe 发表于:2012/6/1 10:17:07

if c>enterprice*1.05 then sellshort(holding<0,0,market);

if c<enterprice*0.95 then sell(holding>0,0,market);

3楼
acerap 发表于:2012/6/1 10:21:08
我不是满仓打,比如说我开40%的仓,这40%的仓亏损达到总资金的5%时系统自动平仓,然后下次按照资金的95%继续40%开仓计算
4楼
jinzhe 发表于:2012/6/1 13:22:35
想不出了。。。等高人解答
5楼
zg611029 发表于:2012/6/4 10:01:09

r1:=barslast(holding<>0);

r2:=ref(asset,r1);

if asset/r2<0.95 then

   begin

   sell(holding>0,0,thisclose);

   sellshort(holding<0,0,thisclose);

   end

 

 

自己调试一下

 

用下列可能更好(固定轮询,高频扫描)

r1:=barslast(holding<>0);

r2:=ref(asset,r1);

if asset/r2<0.95 then

begin

sell(holding>0,0,limitr,c);

sellshort(holding<0,0,limitr,c);

end

[此贴子已经被作者于2012-6-4 10:04:41编辑过]
共5 条记录, 每页显示 10 条, 页签: [1]


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