Begin
//初始設置
ATR-AvgTrueRange(Length)://記錄盈利峰值價和跟蹤止損價
StopATR- Average(TrueRange,3) Ifimarketposition = 1)
If(BarsSinceEntry--0)
StopPrice-LowStopATR*FirstBarMultp AF-Acceleration HighValue-High:
Else if (BarsSinceEntry>0)
If(HighHighValue)HighValue-High If(HighValue>HighValue And AF<0.2)
AF=AF+Min(Acceleration.0.2-AF)
StopPrice=StopPrice+AF*(HighValue-StopPrice):
//記錄盈利峰值價和跟蹤止損價
If MarketPositionm-1 And BarsSinceEntr-0)
StopPrice-High+StopATR*FirstBarMultp AF-Acceleration LowValue=Low:
Else If MarketPosition---1 And BarsSinceEntry>0)
If(LowLowValue) LowValue=Low
If(LowValueLowValue[1]And AF<0.2)
AF=AF+Min(Acceleration0.2-AF)
StopPrice-StopPrice-AF*(StopPrice-LowValue)
?
?來源:程序化99