input:n(30,1,120,10),m(30,1,60,10);
le:=bidprice>=ref(bidprice,1) and bidvol/askvol>=n and askprice=close;
lx1:=enterbars<m and enterprice-bidprice>=2*mindiff and bidprice=close;
lx2:=enterbars<m and bidprice-enterprice>=3*mindiff and bidprice=close;
lx3:=enterbars>=m and abs(enterprice-bidprice)>=1*mindiff and bidprice=close;
se:=askprice<=ref(askprice,1) and askvol/bidvol>=n and bidprice=close;
sx1:=enterbars<m and askprice-enterprice>=2*mindiff and askprice=close;
sx2:=enterbars<m and enterprice-askprice>=3*mindiff and askprice=close;
sx3:=enterbars>=m and abs(askprice-enterprice)>=1*mindiff and askprice=close;
if holding=0 then
buy(le,1,limitr,askprice);
if holding>0 then
sell(lx1 or lx2 or lx3,holding,limitr,bidprice);
if holding=0 then
buyshort(se,1,limitr,bidprice);
if holding<0 then
sellshort(sx1 or sx2 or sx3,holding,limitr,askprice);
资产:asset,noaxis;
胜率:percentwin,linethick0;
次数:totaltrade,linethick0;
askprice 只能在分笔成交周期使用的,你先确定是否这个地方出问题
另外,使用DEBUGFILE调试一下askprice这个变量,能很方便的查找问题。
如果你无法掌握DEBUGFILE这个最基本的后台调试方法,那么劝你还是放弃后台改做图表交易
askprice 只能在分笔成交周期使用的,你先确定是否这个地方出问题
另外,使用DEBUGFILE调试一下askprice这个变量,能很方便的查找问题。
如果你无法掌握DEBUGFILE这个最基本的后台调试方法,那么劝你还是放弃后台改做图表交易
我用这段代码做图表交易,图表上有信号,可是不发实际的买卖信号。
实际没有成交
不会吧。
帮助里有:
包括>、<、<>、≥、≤、=、AND、OR八种,分别表示大于、小于、不等于、大于等于、小于等于、等于、逻辑与、逻辑或运算