交易系统思路如下:
当根K线最高价大于前A根K线最高价,开多仓;
(当根K线最低价小于前B根K线最低价)或者(当根K线最低价小于开多仓价的0.98倍)或者(当根K线最低价小于前A根K线最高价的0.96倍),平多仓;
当根K线最低价小于前C根K线最低价,开空仓;
(当根K线最高价大于前D根K线最高价)或者(当根K线最高价大于开空仓价的1.02倍)或者(当根K线最高价大于前C根K线最低价的1.04倍),平空仓;
K线还未走完只要满足开平仓条件,立刻按照实时指令价发出开平仓指令。发出开平仓指令时按照(对价+0个最小变动单位)发出价格指令(即超价为0),如一秒不成交则撤单按照(对价+0个最小变动单位)继续发出价格指令(即追价时间为1秒),一直追价到成交为止。
开仓手数按照动态总资金(未用保证金+持仓保证金)*0.3/(当时价格*保证金比例*单位合约价值)确定,
平仓手数根据开仓手数确定。
必须先开后平,不允许多次开同方向仓。允许同一根K线上同时满足平仓与反方向开仓条件时,先平仓然后开反方向仓。
希望上述思路交易系统可以用于外盘期货品种测试与全自动程序化交易实盘运行。
这个需要用到后台,而且考虑的地方不少,需要想下思路
这个需要用到后台,而且考虑的地方不少,需要想下思路
请问您是金字塔技术人员吗?还是只是客户?
不管怎样,我希望尽快有人答复我。
这个策略需要用到后台函数,需要明天测试后再发出
m:=0.18;//保证金比率
n:=floor((TACCOUNT(28)+TACCOUNT( 3))*0.3/(c*m*MULTIPLIER));//开仓手数
//开平仓条件
if h>ref(h,a) then begin
tsellshort(tholding<0,0,mkt);
tbuy(tholding=0,n,mkt);
end
if l<ref(l,b) or l<enterprice*0.98 or l<ref(h,a)*0.96 then tsell(tholding>0,0,mkt);
if l<ref(l,c1) then begin
tsell(tholding>0,0,mkt);
tbuyshort(tholding=0,n,mkt);
end
if h>ref(h,d) or h>enterprice*1.02 or h>ref(l,c1)*1.04 then tsellshort(tholding<0,0,mkt);
//撤单和追单
if TISPRVREMAIN(1 )>0 and TSUBMIT( 1)<=1 then begin
TCANCEL( islastbar,1 );
tbuy(tholding=0,n,mkt);
end
if TISPRVREMAIN(3 )>0 and TSUBMIT( 3)<=1 then begin
TCANCEL( islastbar,3 );
tbuy
模型最后没写完?
另:我想能够测试外盘期货模型效果。你编写的模型是不是包含后台程序化交易使用的函数?我应用于图没有任何信号,能不能改成可以测试效果与优化的模型?
写完了,
想要撤单追单功能,图表是写不出的
m:=0.18;//保证金比率
n:=floor((TACCOUNT(28)+TACCOUNT( 3))*0.3/(c*m*MULTIPLIER));//开仓手数
//开平仓条件
if h>ref(h,a) then begin
tsellshort(tholding<0,0,mkt);
tbuy(tholding=0,n,mkt);
end
if l<ref(l,b) or l<enterprice*0.98 or l<ref(h,a)*0.96 then tsell(tholding>0,0,mkt);
if l<ref(l,c1) then begin
tsell(tholding>0,0,mkt);
tbuyshort(tholding=0,n,mkt);
end
if h>ref(h,d) or h>enterprice*1.02 or h>ref(l,c1)*1.04 then tsellshort(tholding<0,0,mkt);
//撤单和追单
if TISPRVREMAIN(1 )>0 and TSUBMIT( 1)<=1 then begin
TCANCEL( islastbar,1 );
tbuy(tholding=0,n,mkt);
end
if TISPRVREMAIN(3 )>0 and TSUBMIT( 3)<=1 then begin
TCANCEL( islastbar,3 );
tbuyshort(tholding=0,n,mkt);
end
复制的时候少了一句,莫名其妙了。。。
后台无法测试,把策略改成前台的吧,看下信号,只有这个办法咯