设为首页收藏本站

 找回密码
 注册
查看: 825|回复: 0
打印 上一主题 下一主题

为什么开盘头一根K线会出现连续买平信号 [复制链接]

Rank: 1

精华
0
UID
286292
积分
40
帖子
16
主题
8
阅读权限
10
注册时间
2019-11-30
最后登录
2019-12-26
跳转到指定楼层
1#
发表于 2019-12-17 16:55:55 |只看该作者 |倒序浏览
请问各位大神:我策略这样写,为什么9点开盘头一根K线会出现连续买平信号呢?


//------------------------------------------------------------------------
// 简称:dtjy
// 名称: 多头交易
// 类别: 公式应用
// 类型: 用户应用
//------------------------------------------------------------------------

Params
   
        Numeric ATRLength(26);
    Numeric ss(1);
       

Vars
    Numeric MinPoint;           
    Numeric MyEntryPrice;      
    NumericSeries ATR;                  
    Numeric N;                 
    Numeric zydw;
    Numeric zsdw;
       
       
       
       
Begin
   
        If(!CallAuctionFilter()) Return;

        ATR = XAverage(TrueRange,ATRLength);
        N = ATR[1];
    MinPoint = MinMove * PriceScale;
    MyEntryPrice = AvgEntryPrice;  
    zydw = IntPart(MyEntryPrice + (N * MinPoint)*2);
    zsdw = IntPart(MyEntryPrice - (N * MinPoint)*1);
       
  
       
         
       
        //-----------------------------------开仓-------------------------------------
        If(BarStatus==2 && Time==0.210000 && CurrentTime <= 0.210000 && MarketPosition==0) return;
       
       
        {
          FileAppend("d:\\marketpostion.log"," currentbar: "+text(currentbar)+ "||  执行buy命令前的marketposition值: " +Text(marketposition));
       
          Buy(ss,open);
          
       
          FileAppend("d:\\marketpostion.log"," currentbar: "+text(currentbar)+ "||  执行buy命令后的marketposition值: " +Text(marketposition));
        }
          
          
       
         
        //--------------------------------------止盈------------------------------------
         
         
          
       
       
        if (MarketPosition==1&&High>=zydw)
       
       
   
        {   
         If(open > zydw) zydw = open;      // 如果该Bar开盘价有跳空触发,则用开盘价代替
               
                 Sell(0,zydw);
                 
                 buy(ss,zydw);
                 
        
    }
       
        //----------------------------止损--------------------------------------
       
       
        if (MarketPosition==1&&low<=zsdw)// 止损条件表达式
        
        {
                If(open < zsdw) zsdw = open;      // 如果该Bar开盘价有跳空触发,则用开盘价代替
               
                Sell(0,zsdw);
                 
                SellShort(ss,zsdw);
        }
     
        //-------------------------------------收盘平仓----------------------------------------

  
    If((Date[-1]!=InvalidInteger && Date!=Date[-1])||(Date[-1]==InvalidInteger && Date < CurrentDate))
    {
        Sell(0,Close);
        BuyToCover(0,Close);
    }Else If(Date==CurrentDate && Time==0.1455 && CurrentTime>=0.1459)
    {
        Sell(0,Close);
        BuyToCover(0,Close);
    }

End


//------------------------------------------------------------------------
// 编译版本        GS2015.12.25
// 用户版本        2019/12/07 18:52:46
// 版权所有        zxj878
// 更改声明        TradeBlazer Software保留对TradeBlazer平台
//                        每一版本的TradeBlazer公式修改和重写的权利
//------------------------------------------------------------------------

附件: 你需要登录才可以下载或查看附件。没有帐号?注册
您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-4-26 16:15

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部