- 精华
- 3
- 在线时间
- 12229 小时
- UID
- 5
- 积分
- 26584
- 帖子
- 12686
- 阅读权限
- 200
- 注册时间
- 2007-7-20
- 最后登录
- 2021-11-3
- 精华
- 3
- UID
- 5
- 积分
- 26584
- 帖子
- 12686
- 主题
- 49
- 阅读权限
- 200
- 注册时间
- 2007-7-20
- 最后登录
- 2021-11-3
|
本帖最后由 小米 于 2019-8-29 16:49 编辑
其实这公式没有什么修改的必要性呢。
如果一定要改,试一下这样的逻辑呢?- Params
- Numeric aa(50);
-
- Vars
-
- Numeric minpoint;//一跳
- Numeric myentryprice;//开仓价 均价
- Numeric myexitprice;//平仓价
- NumericSeries highestafterentry;//开仓后出现的最高价
- NumericSeries lowestafterentry;//开仓后出现的最低价
- Begin
-
- minpoint = MinMove * PriceScale;//最小变动1跳
- myentryprice = AvgEntryPrice;//建仓价是当前平均建仓价
-
- // 集合竞价过滤
- if (MarketPosition ==0 && open[1]-Close[1]>2)
- {SellShort(1,Open);}
- if (MarketPosition ==0 && Close[1]-Open[1]>2)//突破上根K线最高价N个价位
- {Buy(1,Open);}
-
- If (MarketPosition==-1 AND BarsSinceEntry >=1)
- {If ( lowestafterentry[1] - Close[1]<=-aa )
- Buy(1,Open);
- }
-
-
- If (MarketPosition==1 AND BarsSinceEntry >=1)
- {If (Close[1] - highestafterentry[1] <=-aa )
- SellShort(1,Open);
- }
-
- If(BarsSinceEntry ==0)
- {highestafterentry = Close;
- lowestafterentry = Close;
- If(MarketPosition<>0 )
- {highestafterentry = Max (highestafterentry,AvgEntryPrice );
- lowestafterentry = Min (lowestafterentry ,AvgEntryPrice );
-
- }}Else
-
- {highestafterentry = Max (highestafterentry,high );
- lowestafterentry = Min (lowestafterentry ,low );}
-
-
- End
复制代码 |
|