我的公式
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秒刷新,在刷新时平的仓,可是过了不久刷新的时候又会开仓。。。
针对我的公式。如何解决平仓后当前周期不再开仓的问题?
谢谢
参考如下的写法,请尽量遵循这个模版。
视频讲座里面也有例子
//《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;
TBUY((CLOSE>HHV(REF(HIGH,1),20) AND THOLDING<N AND TIME<=145900 AND TEXITBARS > 0),N,MKT);
增加上次平仓历时的判断即可解决同周期平仓后不再开仓的问题。
OK..明天试试 希望能行
参考如下的写法,请尽量遵循这个模版。
视频讲座里面也有例子
//《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;