设为首页收藏本站

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

老师看一下我的,为什么不发单 [复制链接]

Rank: 1

精华
0
UID
242461
积分
32
帖子
23
主题
9
阅读权限
10
注册时间
2016-10-31
最后登录
2020-10-12
跳转到指定楼层
1#
发表于 2016-11-8 16:03:21 |只看该作者 |倒序浏览

           if(A_BuyPosition()==0 and A_SellPosition()==0) SetGlobalVar(2,0);         
           If(GetGlobalVar(2)==InvalidNumeric)
        {
                SetGlobalVar(2,0);
        }
      

            cond1=(GetGlobalVar(2));
            BUYSS=A_BuyPosition;
            PlotString("GetGlobalVar(2)",text(GetGlobalVar(2)),0,red);
            ApriceDD=Text(A_BuyAvgPrice);
            ApriceD=Value(ApriceDD);
            MyOffset = MinMove*PriceScale;
            

                //开仓;
                If(TimesToday<TimesMaxToday And CurrentBar>90 AND CMM>NN )
                {
                        If(A_BuyPosition()==0   and cond1==0)
                        {
                                If(开多条件 )
                                {
                                        A_SendOrder(Enum_Buy,Enum_Entry,1,Q_AskPrice +

MyOffset);
                                        SetGlobalVar(2,1);
                                         ddd=1;
                                         PlotString("d",Text(ddd),0,Yellow);
                                        TimesToday = TimesToday+1;
                                        Return;
                                }
                        }
                        If(A_SellPosition()==0 or MarketPosition==0 and cond1==0)
                        {
                                If(  开空条件)
                                {
                                        A_SendOrder(Enum_Sell,Enum_Entry,1,Q_BidPrice -

MyOffset);
                                        SetGlobalVar(2,3);
                                         ddd=3;
                                         PlotString("d",Text(ddd),0,Blue);
                                         TimesToday = TimesToday+1;
                                         Return;
                                }
                        }
                }

              
             //止损;
              if(A_SellPosition>0 and cond1==3)
                 {
                    if(AA>BB)
                       {
                            A_SendOrder(Enum_Buy,Enum_Exit,A_SellPosition(),Q_AskPrice +

MyOffset);         
                            SetGlobalVar(2,0);
                             ddd=8;
                             PlotString("d",Text(ddd),0,Blue);
                                     }
                            }
                if(A_BuyPosition>0 and cond1==1)
                 {
                    if(AA<=BB)
                       {
                         A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition(),Q_BidPrice -

MyOffset);         
                          SetGlobalVar(2,0);
                          ddd=8;
                             PlotString("d",Text(ddd),0,Blue);
                                     }
                            }

        }
        
是不是我全局变量设置的有问题?

Rank: 1

精华
0
UID
242461
积分
32
帖子
23
主题
9
阅读权限
10
注册时间
2016-10-31
最后登录
2020-10-12
2#
发表于 2016-11-8 23:07:33 |只看该作者
顶 啊

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

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

GMT+8, 2024-5-3 17:20

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部