设为首页收藏本站

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

公式导入 数据回测不了?哪位老师能看下 [复制链接]

Rank: 1

精华
0
UID
238871
积分
2
帖子
1
主题
1
阅读权限
10
注册时间
2016-8-15
最后登录
2016-11-23
跳转到指定楼层
1#
发表于 2016-11-21 21:01:43 |只看该作者 |倒序浏览
Params
   Numeric length(14);
   Numeric OverSold(20);
   Numeric OverBought(80);
Vars
   NumericSeries WRValue;
   Bool Con1;
   Bool Con2;
   Numeric StopLossSet(20);  
   Numeric MinPoint;
   Numeric MyExitPrice;
   Numeric MyEntryPrice;
Begin
   If(!CallAuctionFilter())Return;
   WRValue=PercentR(length);
   PlotNumeric("WR",WRValue);
   PlotNumeric("超卖",OverBought);
   PlotNumeric("超买",OverSold);
   MinPoint=MinMove*PriceScale;
   Con1=CrossOver(WRValue[1],OverBought);
   Con2=CrossUnder(WRValue[1],OverSold);
   If(Con1 And MarketPosition==0 And Vol>0)
      {
            SellShort(1,Open);
                MyEntryPrice=Open;
                If(High>MyEntryPrice+StopLossSet*MinPoint)
                   {
                     MyExitPrice=MyEntryPrice+StopLossSet*MinPoint;
                         If(Open>MyExitPrice)MyExitPrice=Open;
                           BuyToCover(1,MyExitPrice);
            }
                If(Con2 And MarketPosition==1 And Vol>0)
                   BuyToCover(1,Open);
                }

       Else If(Con2 And MarketPosition==0 And Vol>0)
              {
                     Buy(1,Open);
                         MyEntryPrice=Open;
            If(Low<MyEntryPrice-StopLossSet*MinPoint)
                      {
                              MyExitPrice=MyEntryPrice-StopLossSet*MinPoint;
                                   If(Open<MyExitPrice)MyExitPrice=Open;
                                   Sell(1,MyExitPrice);
                                }
                        If(Con1 And MarketPosition==1 And Vol>0)
                               Sell(1,Open);
                        }
        End
您需要登录后才可以回帖 登录 | 注册

bottom

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

GMT+8, 2024-5-8 10:26

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部