作者wholesaler (虎背熊腰的大嬸)
看板Trading
標題[討論] 使用 DMI 進出
時間Sat Jul 11 01:19:35 2015
寫出來績效不是很好看, 單純跟大家討論討論
方法:
DATA 1: 台指 60分K
DATA 2: 加權指數 1 D
DMI 使用 DATA 2 計算
一口單, 多空對翻
手續費 800
回測區間: 2011/1/31--2015/6/2
規則: DMI+ 向上穿過 DMI- 進多單
DMI+ 向下穿越 DMI- 進空單
若 DMI+ 今日較昨日低, 且手上有多單, 則反手
(還有昨天跟前天比較)
若 DMI- 今日較昨日高, 且手上有空單, 則反手
(還有昨天跟前天比較)
出來的曲線 在2013年出現最高峰,
2015 根本是慘敗
有試過加入停損翻單的語法, 不過又是個 45度角向下的醜醜圖....
以下是 MC CODE
inputs:
Length( 14 );
condition1=dmiplus(length)of data2 crosses above dmiMinus(length)of data2;
condition2=dmiplus(length)of data2 crosses below dmiMinus(length)of data2;
if condition1 then
buy ("buy") next bar at market;
if condition2 then
sellshort ("short") next bar at market;
condition3=dmiplus(length) of data2 < dmiplus(length)of data2[1];
condition4=dmiplus(length) of data2[1] < dmiplus(length)of data2[2];
{condition5=dmiplus(length) [2] < dmiplus(length)[3];}
condition6=dmiminus(length) of data2> dmiminus(length)of data2[1];
condition7=dmiminus(length)[1]of data2 > dmiminus(length)of data2[2];
{condition8=dmiplus(length) [2] < dmiplus(length)[3];}
condition9=dmiplus(length)<DMIMinus(length);
if barssinceentry(0)>4 then begin
if marketposition=1 then
if condition3 and condition4 {and condition5} and condition9=true then
sellshort("Enter_short") next bar at market;
if marketposition=-1 then
if condition6 and condition7 {and condition8} and condition9=false then
buy("enter_long") next bar at market;
end;
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.192.240.248
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Trading/M.1436548778.A.DCD.html
1F:→ leolarrel: 感謝分享 07/11 12:15
2F:推 LaPepe: 你只有一個指標,績效容易2極化,建議加個指標過濾, 07/30 10:28
3F:→ LaPepe: 我在張林忠的書上看到,他加了ADX>25過篩,你可以試試。 07/30 10:28
4F:→ LaPepe: 另外沒有任何指標適用全部的行情,被用多了,績效會Do 07/30 10:28
5F:→ LaPepe: wn下來,好的交易員至少有五個指標在run,不包刮自己 07/30 10:28
6F:→ LaPepe: 開發的 07/30 10:28
7F:推 sesee: 好的交易員跟有幾個指標關係不大 獲利能力跟穩定度與指標數 07/31 00:45
8F:→ sesee: 沒什麼關係 07/31 00:46
10F:推 Lans1002: DMI我以前有用過,參數調整後還是覺得反應太慢被丟一邊, 08/10 07:14
11F:→ Lans1002: 最近又撿回來用,可以當一段時間的趨勢判斷,但還是很難 08/10 07:14
12F:→ Lans1002: 當轉折系統使用 08/10 07:14