06年的老系統,大家一起觀摩學習 - TradeBlazer公式 [開拓者 TB]
- 咨詢內容:
它的代碼不是TB得,希望大蝦們能轉為TB,讓大家一起觀摩學習。
背景簡介:
這個系統的創作人是Philipp Kahler,德國人。由WLD開發者...場趨勢上獲利。
實際的市場趨勢(牛/熊)由ADX、DIMinus和DIPlus確定,并由EMA的方向確認,交易信號由最高價和最低價的SMA產生。
進場部分:
ADX顯示趨勢有多強,作為一個標準值,如果ADX>30,趨勢就是強的。趨勢的方向由DIMinus和DIPlus決定。如果DMPlus在DIMinus之上,趨勢就是牛的(淺綠色背景),反之,就是熊的(淺紅色背景)。ADX、DIMinus和DIPlus的初始長度設置是18(讀物中的標準長度是14,而ADX的邊界值是20)。
趨勢的確認通過觀察收盤價的EMA做到。如果實際的EMA比前一天的EMA高,市場就向上走,因此牛趨勢被確認。EMA的長度是28個K線。被確認的牛趨勢用暗綠色顯示,被確認的熊趨勢用暗紅色確認。
買入信號(做多)在牛趨勢被檢測并確認時,并且收盤價大于最高價的SMA時產生。SMA的長度是5個K線。
出場部分:
當日最低價穿過它的SMA,或者收盤價低于它的EMA時,做多信號就被關閉。做空信號情況類似但相反。
風險控制:
無采取特別的風險控制措施。
資金管理:
每次交易用總帳戶的10%資金建倉。
測試績效:
根據Kahler的說法,從1998年10月開始,兩年內這個系統只交易德國債券合約(多空都交易),帳戶回報率達到400%(獲利因子profit factor=3.6),總共有30次交易(13個是多,其他是空),其中22個盈利,8個虧損,50%的時間在市。
{ Plot ADX Values }
var Bar, ADXPeriod, ADXPane, Parameter, StopLossSeries: integer;
var BarHighProfit, BarLowProfit, CumProfit, p, Shares: integer;
var StartCapital, ATRValue, ProfitPercent, Profit, Price: float;
var BullTrend, BearTrend, DipLong, DipShort: boolean;
var ATRFactor, ChandelierExit, YoYoExit, SellPrice: float;
var ExitLong, ExitShort: boolean;
var ProfitControlPane, CumProfitPane: integer;
ADXPane := CreatePane( 75, TRUE, FALSE );
PlotSeries( ADXSeries( 18 ), ADXPane, 009, 2 );
PlotSeries( DIPlusSeries( 18 ), ADXPane, 050, 0 );
PlotSeries( DIMinusSeries( 18 ), ADXPane, 900, 0 );
DrawLabel( 'ADX, DI+, DI-', ADXPane );
DrawHorzLine( 0, ADXPane, 444, 1 );
DrawHorzLine( 30, ADXPane, 444, 1 );
{ Plot SMAs and EMAs }
PlotSeries( EMASeries( #Close, 28 ), 0, 044, 2 );
PlotSeries( SMASeries( #High, 5 ), 0, 922, 0 );
PlotSeries( SMASeries( #Low, 5 ), 0, 262, 0 );
for Bar := 30 to BarCount() - 1 do
begin
{ See if we're in a trend mode }
BullTrend := false;
BearTrend := false;
if ADX( Bar, 18 ) > 30 then
begin
if DIPlus( Bar, 18 ) > DIMinus( Bar, 18 ) then
begin
BullTrend := true;
SetBackgroundColor( Bar, 898 );
end
else if DIMinus( Bar, 18 ) > DIPlus( Bar, 18 ) then
begin
SetBackgroundColor( Bar, 988 );
BearTrend := true;
end;
end;
if LastPositionActive() then
begin
{ Test for closing Long Positions }
if PositionLong( LastPosition() ) then
begin
if ( PriceLow( Bar ) < SMA( Bar, #Low, 5 ) ) or ( PriceClose( Bar ) < EMA( Bar, #Close, 28 ) ) then
SellAtMarket( Bar + 1, LastPosition(), '' );
end
else
{ Test for closing Short Positions }
begin
if ( PriceHigh( Bar ) > SMA( Bar, #High, 5 ) ) or ( PriceClose( Bar ) > EMA( Bar, #Close, 28 ) ) then
CoverAtMarket( Bar + 1, LastPosition(), '' );
end;
end
else
begin
{ Confirm any trends with an EMA check }
if BullTrend then
BullTrend := EMA( Bar, #Close, 28 ) > EMA( Bar - 1, #Close, 28 );
if BearTrend then
BearTrend := EMA( Bar, #Close, 28 ) < EMA( Bar - 1, #Close, 28 );
{ Trigger long/short trades with the confirmed trends }
if BullTrend then
begin
SetBackgroundColor( Bar, 787 );
if PriceClose( Bar ) > SMA( Bar, #High, 5 ) then
BuyAtMarket( Bar + 1, '' );
end;
if BearTrend then
begin
SetBackgroundColor( Bar, 877 );
if PriceClose( Bar ) < SMA( Bar, #Low, 5 ) then
ShortAtMarket( Bar + 1, '' );
end;
end;
end; - TB技術人員:
自己頂起來
- TB客服:
希望高手能夠翻譯成TB代碼......
- 網友回復:
希望高手能夠翻譯成TB代碼希望高手能夠翻譯成TB代碼
- 網友回復:
這個效果真是奇爛無比,出場太爛了。。
1.JPG (134.89 KB, 下載次數: 6) 2012-5-4 14:56:18 上傳 下載次數: 6
如果以上指標公式不適用于您常用的行情軟件
或者您想改編成選股公式,以便快速選出某種形態個股的話,
- 上一篇:請教老師,關于全局參數。謝謝 - TradeBl…
- 下一篇:沒有了!
相關文章
-
沒有相關內容