Rss & SiteMap

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

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

标题:日内只开1次仓如何表达

1楼
phui999 发表于:2012/6/7 11:00:49
日内只开1次仓如何表达?
2楼
rushtaotao 发表于:2012/6/7 11:03:52
variable:a:=0;
if date<>ref(date,1) and a=0 then
begin
   buy(c>o,1,market);
   a:=1;
end
3楼
phui999 发表于:2012/6/7 11:10:52
感谢
4楼
phui999 发表于:2012/6/7 11:23:38

VARIABLE:nums=0;

 

if long and nums=0 then
    begin
       buy(holding=0,1,market);
       nums:=1;
       end

是不是这样写啊,好像我开不了仓。

 

另,平仓是否要定义nums啊?

5楼
rushtaotao 发表于:2012/6/7 11:35:53

编译没通过吧?

 

6楼
phui999 发表于:2012/6/7 11:38:34
通过,就是无法开仓
7楼
王锋 发表于:2012/6/7 11:47:38
客服给写的逻辑有问题,请重写!
8楼
rushtaotao 发表于:2012/6/7 13:00:38
正在处理
9楼
rushtaotao 发表于:2012/6/7 13:10:12

稍等

 

[此贴子已经被作者于2012-6-7 13:16:37编辑过]
10楼
just 发表于:2012/6/7 13:16:45

variable:nums=0;
short:=cross(ma(c,10),ma(c,5));
long:=cross(ma(c,5),ma(c,10));
tt:= time>092000 and time<151000;
n:=barslast(date<>ref(date,1))+1;

if n then begin
if long and tt and nums=0 then
    begin
       buy(holding=0,1,market);
       nums:=1;
 end
if short and tt and nums=1 then
   begin
    sell(holding>0,0,market);
     end
    
 if time>=151000 then nums:=0;//收盘前赋值变回去   
end

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


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