Rss & SiteMap

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

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

标题:【求助】如何解决平仓后当前周期不再开仓的问题?

1楼
toby907 发表于:2009/12/9 21:56:37


 

 

我的公式

BUY((CLOSE>HHV(REF(HIGH,1),20) AND HOLDING<N AND TIME<=145900),N,THISCLOSE);
TBUY((CLOSE>HHV(REF(HIGH,1),20) AND THOLDING<N AND TIME<=145900),N,MKT);

 

SELL((CLOSE<LLV(REF(LOW,1),10)  OR CLOSE>=(ENTERPRICE+10) OR CLOSE<=(ENTERPRICE-5)),N,THISCLOSE);
TSELL((CLOSE<LLV(REF(LOW,1),10)  OR CLOSE>=(ENTERPRICE+10) OR CLOSE<=(ENTERPRICE-5)),N,MKT);

 

N=1


 

我用3秒刷新,在刷新时平的仓,可是过了不久刷新的时候又会开仓。。。

 

 

针对我的公式。如何解决平仓后当前周期不再开仓的问题?

 

谢谢

[此贴子已经被作者于2009-12-9 22:05:48编辑过]
2楼
Likai 发表于:2009/12/9 22:22:06

参考如下的写法,请尽量遵循这个模版。

 视频讲座里面也有例子

 

//《30 分钟的日内翻转系统》
//适用于1分钟图表
//Designed by LIKAI
//QQ=475049

 

//准备需要的中间变量
h30:= ref(hhv(h,30),1);
l30:=ref(llv(l,30),1);

//建立多头的进场的条件
Long:= h>h30 and time>093000 and time < 145200 ;

if Long then
 begin
 sellshort(holding<0, holding, limitr, h30) ;
 buy(holding=0, 1, limitr, h30) ;
 end

//画出多头的止损线
partline(holding>0, l30, colorred) ;


//建立空头的进场条件
Short:= l<l30 and time>093000 and time < 145200 ;

if Short then
 begin
 sell(holding>0, 0, limitr, l30) ;
 buyshort(holding=0, 1, limitr, l30) ;
 end

//画出空头的止损线
partline(holding<0, h30, colorgreen);

//收盘前平仓
sell(time>145500 and holding>0, 0, thisclose) ;
sellshort(time>145500 and holding<0,0,thisclose) ;

资产:ASSET,LINETHICK0;
可用现金:CASH(0),LINETHICK0;
持仓:HOLDING,LINETHICK0;

[此贴子已经被作者于2009-12-10 10:07:43编辑过]
3楼
toby907 发表于:2009/12/9 22:25:19
THANK YOU
4楼
admin 发表于:2009/12/10 15:57:26

TBUY((CLOSE>HHV(REF(HIGH,1),20) AND THOLDING<N AND TIME<=145900 AND TEXITBARS > 0),N,MKT);

增加上次平仓历时的判断即可解决同周期平仓后不再开仓的问题。

5楼
toby907 发表于:2009/12/10 18:13:10

OK..明天试试 希望能行

6楼
wzywzy292 发表于:2009/12/10 19:20:36
以下是引用Likai在2009-12-9 22:22:06的发言:

参考如下的写法,请尽量遵循这个模版。

 视频讲座里面也有例子

 

//《30 分钟的日内翻转系统》
//适用于1分钟图表
//Designed by LIKAI
//QQ=475049

 

//准备需要的中间变量
h30:= ref(hhv(h,30),1);
l30:=ref(llv(l,30),1);

//建立多头的进场的条件
Long:= h>h30 and time>093000 and time < 145200 ;

if Long then
 begin
 sellshort(holding<0, holding, limitr, h30) ;
 buy(holding=0, 1, limitr, h30) ;
 end

//画出多头的止损线
partline(holding>0, l30, colorred) ;


//建立空头的进场条件
Short:= l<l30 and time>093000 and time < 145200 ;

if Short then
 begin
 sell(holding>0, 0, limitr, l30) ;
 buyshort(holding=0, 1, limitr, l30) ;
 end

//画出空头的止损线
partline(holding<0, h30, colorgreen);

//收盘前平仓
sell(time>145500 and holding>0, 0, thisclose) ;
sellshort(time>145500 and holding<0,0,thisclose) ;

资产:ASSET,LINETHICK0;
可用现金:CASH(0),LINETHICK0;
持仓:HOLDING,LINETHICK0;

[此贴子已经被作者于2009-12-10 10:07:43编辑过]

学习了,谢谢!!!
7楼
蔡宛宏 发表于:2012/1/20 12:56:33
图片点击可在新窗口打开查看
共7 条记录, 每页显示 10 条, 页签: [1]


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