Rss & SiteMap

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

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

标题:[求助]怎么控制开仓次数?

1楼
xyy13qq 发表于:2016/8/1 16:48:18
举例:
开仓条件成立为kdj 金叉  并且持仓数<3,买入1手;  怎么编写?
构想1:

kd:=k>d 

BUY(KD AND HOLDING<3,1,THISCLOSE);

构想2:

kd:=k>d and  holding<3 ;

BUY(KD AND HOLDING<3,1,THISCLOSE);

请问这两个有没有对的? 请高手 回复正确的写法?
2楼
jinzhe 发表于:2016/8/1 16:51:16

buy(cross(k,d) and holding<3 ,1,thisclose);

这样写

3楼
xyy13qq 发表于:2016/8/1 17:25:13
老师:
如果是空单要不要给holding 求绝对值 ?
buyshort (cross(d,k) and holding<3 ,1,thisclose);
buyshort (cross(d,k) and abs(holding)<3 ,1,thisclose);





4楼
jinzhe 发表于:2016/8/1 17:26:31

是的

或者holding>-3

[此贴子已经被作者于2016-8-1 17:26:45编辑过]
5楼
xyy13qq 发表于:2016/8/1 17:33:43
谢谢!

我想测试日内交易 ,历史检测策略时发现 收益率超高。怎么过滤呢? 我的想法是加上收盘前清仓,怎么写?    下面代码怎么修改,还要加上晚盘时间.

//收盘前清仓

entertime:=time>=092500 and time<=145500; 
 exittime:=time>=150000; 
 

 if  holding >0 and exittime then begin 
 sell(1,holding,limitr,close); 
 end 
 
 if  holding <0 and exittime then begin 
 sellshort(1,holding,limitr,close); 
 end 
6楼
xyy13qq 发表于:2016/8/1 17:35:21
金字塔显示的时间是处理过的,这个代码可以用吗?   本人现在行情还是金字塔的时间。
7楼
jinzhe 发表于:2016/8/2 8:41:02
收盘清仓时间这样写:time>=closetime(0)
共7 条记录, 每页显示 10 条, 页签: [1]


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