斑竹老师 我设置了一个日内交易系统 时间从9点开始交易到下午2点50
代码是选自视频中的30周期突破翻转系统。在自动交易中设置1分钟状态,
然后为了提高效率选用当日数据参与运算
现在的问题是 如果今天能自动交易 明天开盘就不自动交易
一定要把昨天设置好的删除掉,再原样重新设置一下,今天才能自动交易。
请问这是什么原因?
因为几天了 每天都是这样,原来不知道是什么原因,仔细查指标代码发现没有问题。把他删掉重新设置
就可以用了。
指标中涉及引用一个动态行情函数 这个应该不是问题。
请老师帮助解答。谢谢!
请把公式贴出来以便于我们分析
//仅1分钟有效
a:=DYNAINFO( 11);
//准备需要计算的变量
aaa:=a;
TradeTime:= time>090000 and time<145200 ;
//建立多头进场条件
Long:=cross(c,aaa) and TradeTime;
if Long then
begin
tSELLSHORT( tholding<0,开仓手数,lmt,h,0,'88859','');
SELLSHORT(holding<0,holding,thisclose);
BUY(Long,开仓手数,thisclose);
tbuy(Long,开仓手数,lmt,h,0,'88859','');
end
//建立空头进场条件
Short:=cross(aaa,c) and TradeTime;
if Short then
begin
tsell( tholding>0,开仓手数,lmt,l,0,'88859','');
SELL( holding>0,holding,thisclose);
BUYSHORT(Short,开仓手数,thisclose);
tbuyshort( short,开仓手数,lmt,l,0,'88859','');
end
//收盘前平仓
sell(time>145500 and holding>0,0,thisclose) ;
tsell(time>145500 and tholding>0,0,lmt,l);
sellshort(time>145500 and holding<0,0,thisclose) ;
tsellshort(time>145500 and holding<0,0,lmt,h);