请版主帮忙解决一下程序信号闪烁的问题 [开拓者 TB]
- 咨询内容:
Params
 
 
 Numeric notaft(14.58);
 
 Vars
 Numericseries High5(0);//
 Numericseries Low5(0);//
 Numeric Value1;//
 Numericseries ennight;//
 Numericseries enday;//
 
 begin
 Value1=Average(Close,10);
 if (time>=0.210000 && time<=0.21045959)
 
 {
 High5=Highest(High,5);
 Low5=Lowest(Low,5);
 }
 
 PlotNumeric("5分钟高点",High5,0,White);
 PlotNumeric("5分钟低点",Low5,0,White);
 
 //开仓//程序化交易
 if(date!=date[1])
 
 {
 
 ennight=0;
 
 enday=0;
 
 }
 if(MarketPosition==0 and Close>High5 and Low<=High5 )
 
 
 if(time>0.1600 and Time<0.2400 && ennight<1)
 {
 buy(1,Close);
 ennight= ennight[1]+1;
 }else if ( time>0.0900 and time<0.1500 && enday<1)
 {
 buy(1,Close);
 enday = enday[1]+1;
 }
 if(MarketPosition==0 and Close<low5 and High>=low5 )
 
 
 if(time>0.1600 and Time<0.2400 && ennight<1)
 {
 SellShort(1,Close);
 ennight= ennight[1]+1;
 }else if ( time>0.0900 and time<0.1500 && enday<1)
 {
 SellShort (1,Close);
 enday = enday[1]+1;
 }
 //止损
 if (MarketPosition==1 and Close<Value1 )
 {
 sell(1,low);
 }
 if (MarketPosition==-1 and Close>Value1)
 {
 BuyToCover(1,High);
 }
 
 //收盘平仓
 if(Time*100>=notaft and Time<0.1600)
 
 {
 if(marketposition==-1)
 {
 BuyToCover(1,Open);
 }
 if(marketposition==1)
 {
 Sell(1,Open);
 }
 
 }
 End
- TB技术人员: buy开仓函数不能直接用close,high,low之类的,因为实时数据中bar没走完这些值是会变化的,open则不会变。
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198  进行 有偿 编写!(不贵!点击查看价格!)
                        
相关文章
- 
                        没有相关内容
                       

 
                     会员登录/注册
会员登录/注册