设为首页收藏本站

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

请教一下这是什么问题 [复制链接]

Rank: 1

精华
0
UID
238815
积分
36
帖子
30
主题
2
阅读权限
10
注册时间
2016-8-15
最后登录
2018-1-22
跳转到指定楼层
1#
发表于 2016-9-6 13:18:56 |只看该作者 |倒序浏览
实际已经成交,图表没有信号,刷新后信号出现[img]C:\Users\Administrator\Desktop
  1. Params
  2.         Numeric MyHighPrice(12525);
  3.         Numeric ZhiSunPrice(14);
  4.         Numeric TakeProfitSet1(16);
  5.         Numeric Lots1(2);
  6.         Numeric Lots2(1);

  7. Vars
  8.         NumericSeries shangpo_bar;
  9.         Numeric MinPoint;
  10.         Numeric MyShortExitPrice;
  11.         NumericSeries KaiKongCang;
  12.         NumericSeries LowestAfterEntry;
  13. Begin
  14. MinPoint = MinMove * PriceScale;
  15.         //初始全局变量
  16.         If(BarStatus == 0)
  17.          {
  18.                 SetGlobalVar(0,0);
  19.          }
  20.           //初始开仓计数器
  21.          If(TrueDate(0) != TrueDate(1) && MarketPosition == 0)
  22.           {
  23.                 KaiKongCang = 0;
  24.           }
  25.         //集合竞价和小节休息过滤
  26.         If(IsCallAuctionTime()) Return;
  27.         //计算和记录突破点位和时间
  28.         If(High >= MyHighPrice && High[1] < MyHighPrice && MarketPosition <> -1)
  29.          {
  30.                 shangpo_bar = CurrentBar;
  31.          }
  32.          //在上破后的1--6根k内如果下破前期高点,开空
  33.          If( shangpo_bar > 0 && currentbar >= shangpo_bar + 1  && CurrentBar <= shangpo_bar + 5)
  34.           {
  35.                 If( MarketPosition<> -1  && KaiKongCang < 1 && Low < MyHighPrice)
  36.                  {
  37.                    SellShort(Lots1,Min(Open,MyHighPrice));
  38.                    KaiKongCang = 1;
  39.                    Commentary("开空价:"+Text(Min(Open,MyHighPrice)));
  40.                   }
  41.           }
  42.           
  43.           //分批止盈部分和止损部分
  44.           //记录盈利峰值价
  45.           If(BarsSinceEntry == 0)
  46.          {
  47.                 LowestAfterEntry = Close;
  48.                 If(MarketPosition == -1)
  49.                  {       
  50.                         LowestAfterEntry = Min(LowestAfterEntry,AvgEntryPrice);
  51.                  }
  52.          }
  53.         Else
  54.          {
  55.                 LowestAfterEntry = Min(LowestAfterEntry,Low);
  56.          }
  57.          
  58.          //持有空仓时的出场
  59.          If( MarketPosition == -1 && BarsSinceEntry >= 1)
  60.            {
  61.                 If(Low <= AvgEntryPrice - TakeProfitSet1 * MinPoint && GetGlobalVar(0) == 0)
  62.                 {
  63.                         MyShortExitPrice = Min(Open,AvgEntryPrice - TakeProfitSet1 * MinPoint);
  64.                         BuyToCover(Lots2,MyShortExitPrice);
  65.                         SetGlobalVar(0,1);
  66.                      Commentary("固定止盈价:"+Text(MyShortExitPrice));       
  67.                 }
  68.                
  69.                 Else If (LowestAfterEntry[1] <= AvgEntryPrice - TakeProfitSet1 * MinPoint && GetGlobalVar(0) == 1)
  70.                           {
  71.                                 If(High >= LowestAfterEntry[1] + Round((AvgEntryPrice - LowestAfterEntry[1])/MinPoint * 0.5,0) * MinPoint)
  72.                                 {
  73.                                         MyShortExitPrice = Max(Open,LowestAfterEntry[1] + Round((AvgEntryPrice - LowestAfterEntry[1])/MinPoint * 0.5,0) * MinPoint);
  74.                                         BuyToCover(0,MyShortExitPrice);
  75.                                         Commentary("移动止盈价:"+Text(MyShortExitPrice));       
  76.                                         SetGlobalVar(0,0);
  77.                                        
  78.                                 }
  79.                           }
  80.                           
  81.              Else If(High >= AvgEntryPrice + ZhiSunPrice * MinPoint)
  82.                            {
  83.                                 MyShortExitPrice = Max(Open,AvgEntryPrice + ZhiSunPrice * MinPoint);
  84.                                 BuyToCover(0,MyShortExitPrice);
  85.                                 SetGlobalVar(0,0);
  86.                                 Commentary("固定止损价:"+Text(MyShortExitPrice));       
  87.                            }
  88.            }
  89.          Commentary("开空仓次数:" + Text(KaiKongCang));
  90. End       
复制代码
[/img]

Rank: 1

精华
0
UID
238815
积分
36
帖子
30
主题
2
阅读权限
10
注册时间
2016-8-15
最后登录
2018-1-22
2#
发表于 2016-9-6 13:20:05 |只看该作者

使用道具 举报

Rank: 1

精华
0
UID
238815
积分
36
帖子
30
主题
2
阅读权限
10
注册时间
2016-8-15
最后登录
2018-1-22
3#
发表于 2016-9-6 13:21:31 |只看该作者
如图
附件: 你需要登录才可以下载或查看附件。没有帐号?注册

使用道具 举报

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

bottom

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

GMT+8, 2024-5-23 16:01

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部