作者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/cn.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