设为首页收藏本站

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

那位大侠帮忙一下,把下面的译成mc代码 [复制链接]

Rank: 1

精华
0
UID
254796
积分
6
帖子
3
主题
3
阅读权限
10
注册时间
2017-7-31
最后登录
2017-8-1
跳转到指定楼层
1#
发表于 2017-7-31 18:39:03 |只看该作者 |倒序浏览

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

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

bottom

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

GMT+8, 2024-4-19 22:29

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部