Rss & SiteMap

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

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

标题:请问老师这个要怎么写

1楼
qq代人发帖 发表于:2016/1/28 16:38:23
 符合A条件时加仓2%,但总加仓量不超20%,同时如果亏损5%平仓最后二次加仓的仓位。这如何写,多谢。
2楼
jinzhe 发表于:2016/1/28 16:44:18
处理中请稍等
3楼
fxrock4 发表于:2016/1/28 16:54:28
好的。
4楼
fly 发表于:2016/1/28 17:08:35

那只能计算,你要加仓的具体数量是多少了,计算方法跟手工计算是一样的。

 

用全部资金可开仓手数公式为:Intpart(Tasset/(Close*Multiplier*MarginRatio));//开仓手数---MarginRatio是保证金比率,请自行添加

 

并且用全局变量记录下加仓的数量,亏损5%的时候,平掉

5楼
fxrock4 发表于:2016/1/28 17:21:30
当前资金200万。请帮写一个完整的加仓和平掉加仓的代码吧
6楼
fxrock4 发表于:2016/1/29 10:32:41
靓妹帮写一个完整的嘛
7楼
jinzhe 发表于:2016/1/29 10:52:44

if todaybar=1 then extgbdataset('zj',taccount(6));

if 条件a and taccount(3)>=0.8*taccount(6) and time<>extgbdata('tt') then begin

     extgbdataset('ss',taccount(3)*0.02/close/multiplier/taccount(41));

     tbuy(1,taccount(3)*0.02/close/multiplier/taccount(41),mkt);

     extgbdataset('tt',time);

   end

if taccount(6)<=extgbdata('zj')*0.95 and time<>extgbdata('tt1') then begin

    tsell(1,extgbdata('ss'),mkt);

    extgbdata('tt1',time);

end

 

能记录最后一次的开仓手数,最后两次的记录不了

 

 

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


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