- 精华
- 0
- 在线时间
- 2366 小时
- UID
- 116737
- 积分
- 781
- 帖子
- 210
- 阅读权限
- 60
- 注册时间
- 2013-3-14
- 最后登录
- 2019-8-16
- 精华
- 0
- UID
- 116737
- 积分
- 781
- 帖子
- 210
- 主题
- 32
- 阅读权限
- 60
- 注册时间
- 2013-3-14
- 最后登录
- 2019-8-16
|
本帖最后由 yebenli 于 2013-12-6 09:29 编辑
Input: MistLength(3),Longstop(0.993),Shortstop(1.007)
Var: UpTrend(0),DownTrend(0),Longtrigger(0),Shorttrigger(0)
Condition1 = High > Highest(High, MistLength)[1] AND Close > Close[1]
Condition2 = Low < Lowest(Low, MistLength)[1] AND Close < Close[1]
Longtrigger= EntryPrice(0) * Longstop
Shorttrigger= EntryPrice(0) *Shortstop
If Condition1[1] AND Open > High[1] AND Close < High[1] Then
Buy next bar at High Stop
End If
If Condition2[1] AND Open < Low[1] AND Close > Low[1] Then
Sell next bar at Low Stop
End If
If MarketPosition = 1 Then
ExitLong next bar at Longtrigger stop
Else If MarketPosition = -1 Then
ExitShort next bar at Shorttrigger stop
End If
SetExitOnClose
|
|