使用 DMI 進出 - 財經
By Kelly
at 2015-07-11T01:19
at 2015-07-11T01:19
Table of Contents
寫出來績效不是很好看, 單純跟大家討論討論
方法:
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;
--
Tags:
財經
All Comments
By Ophelia
at 2015-07-15T09:55
at 2015-07-15T09:55
By Jessica
at 2015-07-19T06:43
at 2015-07-19T06:43
By Ingrid
at 2015-07-22T04:58
at 2015-07-22T04:58
By Iris
at 2015-07-27T01:12
at 2015-07-27T01:12
By Madame
at 2015-07-30T22:26
at 2015-07-30T22:26
By Madame
at 2015-08-02T11:01
at 2015-08-02T11:01
Related Posts
I B api 和下單問題請教
By John
at 2015-07-03T12:33
at 2015-07-03T12:33
中央再保險徵計量策略研究員
By Vanessa
at 2015-07-02T16:43
at 2015-07-02T16:43
關於期交所期貨成交簡檔 RPT資料
By Annie
at 2015-06-30T15:10
at 2015-06-30T15:10
有住高雄使用MC的板友嗎?
By Tracy
at 2015-06-28T17:40
at 2015-06-28T17:40
請推薦有股票行情的「報價」API
By Olga
at 2015-06-25T04:18
at 2015-06-25T04:18