您现在的位置:程序化交易>> 期货公式>> 交易开拓者(TB)>> 开拓者知识>>正文内容

那位大侠帮忙一下,把下面译成mc代码 [开拓者 TB]

  • 咨询内容:
    Params
    Numeric capital(50000);  
    Numeric PAR_1(2);
    Numeric PAR_2(10);
    Numeric PAR_3(3);
    Numeric PAR_4(30);   
    Numeric PAR_5(2);
    Numeric PAR_6(1);  
    Numeric PAR_7(50);
    Numeric        PAR_8(5);  
    Numeric PAR_9(930);     
    Numeric PAR_10(1400);   
    Vars
    NumericSeries VAR_1;           
    Numeric VAR_2(0);
    Numeric VAR_3;
    Numeric VAR_4;
    Numeric VAR_5;
    Numeric VAR_6;
    NumericSeries VAR_7;        
    NumericSeries VAR_8;     
    Numeric VAR_9;
    Numeric VAR_10;
    bool boll_1;
    Numeric tmp;
    Numeric tmp2;
    bool boll_2;
    bool boll_3;
    bool boll_4;
    Numeric lots;
    Begin
    lots=capital/(CloseD(1)*100);

    VAR_1=AvgTrueRange(PAR_7);

    boll_1=Time>0.0001*PAR_9 And Time <PAR_10 * 0.0001;

    if (BarsSinceEntry == 1)
    {
    VAR_7 = AvgEntryPrice;
    VAR_8 = AvgEntryPrice;
    }
    Else If(BarsSinceEntry > 1)
    {
    VAR_7 = Max(VAR_7[1],High[1]);
    VAR_8 = Min(VAR_8[1],Low[1]);
    }
    Else
    {
    VAR_7 = VAR_7[1];
    VAR_8 = VAR_8[1];
    }


       VAR_6 = MinMove*PriceScale;

    VAR_3=Average(high[1]-low[1],PAR_1);

    VAR_4=Average(open,PAR_2)+VAR_3*PAR_3;
    VAR_5=Average(open,PAR_2)-VAR_3*PAR_3;
                   

                   
                   
                   

    boll_4=boll_1  and MarketPosition<>-1 && Low<=VAR_5 ;

    boll_3=boll_1  and MarketPosition<>1 && high>=VAR_4 ;
           


    If(boll_3)
        {
             VAR_10 = VAR_4+VAR_2*VAR_6;
         If(Open > VAR_4)
             VAR_10 = Open+VAR_2*VAR_6;
             
    Buy(lots,VAR_10);
    Return;
        }
           

        If(MarketPosition==1 && BarsSinceEntry >0)  
            {
                    VAR_9 = EntryPrice * (1-PAR_4/1000);  
                                   
                            If (VAR_7 >= EntryPrice * (1 + PAR_5/1000))  
                            {
                                    VAR_9 = VAR_7*(1-PAR_6/1000);
                            }
                    }
                    If(Low <= VAR_9)               
                    {
                            VAR_10 = VAR_9;
                            If(Open < VAR_10) VAR_10 = Open;
                            Sell(0,VAR_10);
            }       


    If(MarketPosition==1)
            {
                    VAR_9 = VAR_7 - PAR_8*VAR_1[1];         
            }
                    If(Low <= VAR_9)               
                    {
                            VAR_10 = VAR_9;
                            If(Open < VAR_10) VAR_10 = Open;
                            Sell(0,VAR_10);
                    }
           


    End

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 511411198  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容