- 精华
- 0
- 在线时间
- 188 小时
- UID
- 238815
- 积分
- 36
- 帖子
- 30
- 阅读权限
- 10
- 注册时间
- 2016-8-15
- 最后登录
- 2018-1-22
- 精华
- 0
- UID
- 238815
- 积分
- 36
- 帖子
- 30
- 主题
- 2
- 阅读权限
- 10
- 注册时间
- 2016-8-15
- 最后登录
- 2018-1-22
|
实际已经成交,图表没有信号,刷新后信号出现[img]C:\Users\Administrator\Desktop- Params
- Numeric MyHighPrice(12525);
- Numeric ZhiSunPrice(14);
- Numeric TakeProfitSet1(16);
- Numeric Lots1(2);
- Numeric Lots2(1);
- Vars
- NumericSeries shangpo_bar;
- Numeric MinPoint;
- Numeric MyShortExitPrice;
- NumericSeries KaiKongCang;
- NumericSeries LowestAfterEntry;
- Begin
- MinPoint = MinMove * PriceScale;
- //初始全局变量
- If(BarStatus == 0)
- {
- SetGlobalVar(0,0);
- }
- //初始开仓计数器
- If(TrueDate(0) != TrueDate(1) && MarketPosition == 0)
- {
- KaiKongCang = 0;
- }
- //集合竞价和小节休息过滤
- If(IsCallAuctionTime()) Return;
- //计算和记录突破点位和时间
- If(High >= MyHighPrice && High[1] < MyHighPrice && MarketPosition <> -1)
- {
- shangpo_bar = CurrentBar;
- }
- //在上破后的1--6根k内如果下破前期高点,开空
- If( shangpo_bar > 0 && currentbar >= shangpo_bar + 1 && CurrentBar <= shangpo_bar + 5)
- {
- If( MarketPosition<> -1 && KaiKongCang < 1 && Low < MyHighPrice)
- {
- SellShort(Lots1,Min(Open,MyHighPrice));
- KaiKongCang = 1;
- Commentary("开空价:"+Text(Min(Open,MyHighPrice)));
- }
- }
-
- //分批止盈部分和止损部分
- //记录盈利峰值价
- If(BarsSinceEntry == 0)
- {
- LowestAfterEntry = Close;
- If(MarketPosition == -1)
- {
- LowestAfterEntry = Min(LowestAfterEntry,AvgEntryPrice);
- }
- }
- Else
- {
- LowestAfterEntry = Min(LowestAfterEntry,Low);
- }
-
- //持有空仓时的出场
- If( MarketPosition == -1 && BarsSinceEntry >= 1)
- {
- If(Low <= AvgEntryPrice - TakeProfitSet1 * MinPoint && GetGlobalVar(0) == 0)
- {
- MyShortExitPrice = Min(Open,AvgEntryPrice - TakeProfitSet1 * MinPoint);
- BuyToCover(Lots2,MyShortExitPrice);
- SetGlobalVar(0,1);
- Commentary("固定止盈价:"+Text(MyShortExitPrice));
- }
-
- Else If (LowestAfterEntry[1] <= AvgEntryPrice - TakeProfitSet1 * MinPoint && GetGlobalVar(0) == 1)
- {
- If(High >= LowestAfterEntry[1] + Round((AvgEntryPrice - LowestAfterEntry[1])/MinPoint * 0.5,0) * MinPoint)
- {
- MyShortExitPrice = Max(Open,LowestAfterEntry[1] + Round((AvgEntryPrice - LowestAfterEntry[1])/MinPoint * 0.5,0) * MinPoint);
- BuyToCover(0,MyShortExitPrice);
- Commentary("移动止盈价:"+Text(MyShortExitPrice));
- SetGlobalVar(0,0);
-
- }
- }
-
- Else If(High >= AvgEntryPrice + ZhiSunPrice * MinPoint)
- {
- MyShortExitPrice = Max(Open,AvgEntryPrice + ZhiSunPrice * MinPoint);
- BuyToCover(0,MyShortExitPrice);
- SetGlobalVar(0,0);
- Commentary("固定止损价:"+Text(MyShortExitPrice));
- }
- }
- Commentary("开空仓次数:" + Text(KaiKongCang));
- End
复制代码 [/img] |
|