本帖最後由 lantis 於 13-9-14 09:22 編輯
有人有使用過這指標嗎? 有人看得出出場條件是如何下的?
如果用 原始碼 SetDollarTrailing( TR * StopFactor ) 條件做回測, 結果幾乎進出都是同一根棒, 不像附圖大多是好幾根棒之後才出場
http://www.traders.com/Documentation/FEEDbk_docs/2010/01/TradersTips.html#TT1
很抱歉, 原圖就是這麼小
- inputs:
- Length( 14 ),
- StopFactor( 2 ) ; { number of true ranges }
- variables:
- VMPlus( 0 ),
- VMMinus( 0 ),
- VMPlusSum( 0 ),
- VMMinusSum( 0 ),
- TR( 0 ),
- TRSum( 0 ),
- VIPlusSumRge( 0 ),
- VIMinusSumRge( 0 ),
- SignalTradeNum( 0 ),
- BuySignal( false ),
- ShortSignal( false ),
- StopPrice( 0 ) ;
- VMPlus = AbsValue( High - Low[1] ) ;
- VMMinus = AbsValue( Low - High[1] ) ;
- VMPlusSum = Summation( VMPlus, Length ) ;
- VMMinusSum = Summation( VMMinus, Length ) ;
- TR = TrueRange ;
- TRSum = Summation( TR, Length ) ;
- if TRSum <> 0 then
- begin
- VIPlusSumRge = VMPlusSum / TRSum ;
- VIMinusSumRge = VMMinusSum / TRSum ;
- end ;
- if VIPlusSumRge crosses over VIMinusSumRge then
- begin
- SignalTradeNum = TotalTrades ;
- BuySignal = true ;
- ShortSignal = false ;
- StopPrice = High ;
- end
- else if VIPlusSumRge crosses under VIMinusSumRge then
- begin
- SignalTradeNum = TotalTrades ;
- BuySignal = false ;
- ShortSignal = true ;
- StopPrice = Low ;
- end ;
- if BuySignal and TotalTrades = SignalTradeNum and
- MarketPosition <> 1 then
- Buy next bar StopPrice stop ;
- if ShortSignal and TotalTrades = SignalTradeNum and
- MarketPosition <> -1 then
- SellShort next bar at StopPrice stop ;
- SetStopShare ;
- SetDollarTrailing( TR * StopFactor ) ;
複製代碼
|