由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Stock版 - 关于MACD
相关主题
TTM和wnr做多的非常危险泡泡说的pivot point 指标的文献
大家能说说自己平时分析走势主要用哪些indicator吗?Weekly Market Review 201213
牛市最迟下周三断气其实我说的ETF机制有更深层次的意义。
第三天喊熊,大家现在觉得能接受这个观点么?如何做swing trade
关心SINA的来看看老美的技术分析有人接苹果吗?
SCOTTRADE帐户里能不能看 STOCK REAL-TIME PLOT?TA论坛: 设计自己的交易指标
TA大牛们分析下ROYL想请教几个TA的小问题
请高手看看我的thinkorswim chart set up(附图)请教做shit桶的,trading signal-based strategy 如何calibrate?
相关话题的讨论汇总
话题: inputdata话题: pos话题: int话题: lastbars话题: tmparray
进入Stock版参与讨论
1 (共1页)
g****t
发帖数: 31659
1
下面是我之前的帖子,我后来提及,你可能没找到,我重贴一遍。
同一个网站也有adaptive MACD,simple MACD,等的回测结果。
共同研究和讨论吧。
发信人: guvest (我爱你老婆Anna), 信区: Stock
标 题: 这个fractal moving average 有哪个tool可以画吗?
发信站: BBS 未名空间站 (Thu Oct 15 21:33:58 2015, 美东)
http://etfhq.com/blog/2010/10/09/frama-is-it-effective/
按着篇文章的说法,比macd准多了。
/etfhq.com/blog/2010/10/09/frama-is-it-effective/
q********g
发帖数: 10694
2
我去,你能不能把哥的id从题目里拿下。。
你的txt文本里的确没有FD。
M***n
发帖数: 5815
3
哭死,早上刚给guvest发信说,能不能写篇应邀征文,说说MACD以及衍生的indicator
。还没收到回复,这都曝光了...
i**********n
发帖数: 84
i**********n
发帖数: 84
5
//+------------------------------------------------------------------+
//| FRASMA.mq4 |
//| Copyright © 2008, [email protected]
/* */ |
//| http://fractalfinance.blogspot.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, [email protected]
/* */"
#property link "http://fractalfinance.blogspot.com/"
#property indicator_chart_window
#property indicator_color1 Red
#property indicator_width1 2
//************************************************************
// Input parameters
//************************************************************
extern int e_period =30;
extern int normal_speed =20;
extern int e_type_data =PRICE_CLOSE;
//************************************************************
// Constant
//************************************************************
string INDICATOR_NAME="FRASMA";
string FILENAME ="___fractal_adaptive_SMA.mq4";
double LOG_2;
//************************************************************
// Private vars
//************************************************************
double ExtOutputBuffer[];
int g_period_minus_1;
//+-----------------------------------------------------------------------+
//| FUNCTION : init |




//| Initialization function |

//| Check the user input parameters and convert them in appropriate types.|


//+-----------------------------------------------------------------------+
int init()
{
// Check e_period input parameter
if(e_period < 2 )
{
Alert( "[ 10-ERROR " + FILENAME + " ] input parameter "e_period" must
be >= 1 (" + e_period + ")" );
return( -1 );
}
if(e_type_data < PRICE_CLOSE || e_type_data > PRICE_WEIGHTED )
{
Alert( "[ 20-ERROR " + FILENAME + " ] input parameter "e_type_data"
unknown (" + e_type_data + ")" );
return( -1 );
}
IndicatorBuffers( 1 );
SetIndexBuffer( 0, ExtOutputBuffer );
SetIndexStyle( 0, DRAW_LINE, STYLE_SOLID, 2 );
SetIndexDrawBegin( 0, 2 * e_period );
g_period_minus_1=e_period - 1;
LOG_2=MathLog( 2.0 );
//----
return( 0 );
}
//+------------------------------------------------------------------+
//| FUNCTION : deinit |
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| FUNCTION : start |
//| This callback is fired by metatrader for each tick |
//+------------------------------------------------------------------+
int start()
{
int counted_bars = IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars--;
int limit = Bars - counted_bars;
if(counted_bars==0) limit-=1+g_period_minus_1;

_computeLastNbBars(limit);
//----
return(0);
}
//+=========================================================================
=======================================+
//+=== FUNCTION : _computeLastNbBars
===+
//+===
===+
//+===
===+
//+=== This callback is fired by metatrader for each tick
===+
//+===
===+
//+=== In :
===+
//+=== - lastBars : these "n" last bars must be repainted
===+
//+===
===+
//+=========================================================================
=======================================+
//+------------------------------------------------------------------+
//| FUNCTION : _computeLastNbBars |
//| This callback is fired by metatrader for each tick |
//| In : - lastBars : these "n" last bars must be repainted |
//+------------------------------------------------------------------+
double tmpArray[];
void _computeLastNbBars( int lastBars )
{
switch( e_type_data )
{
case PRICE_CLOSE : ArrayCopy(tmpArray,Close,0,0,WHOLE_ARRAY); _
FRASMA( lastBars,tmpArray); break;
case PRICE_OPEN : ArrayCopy(tmpArray,Open,0,0,WHOLE_ARRAY); _
FRASMA( lastBars,tmpArray); break;
case PRICE_HIGH : ArrayCopy(tmpArray,High,0,0,WHOLE_ARRAY); _
FRASMA( lastBars,tmpArray); break;
case PRICE_LOW : ArrayCopy(tmpArray,Low,0,0,WHOLE_ARRAY); _
FRASMA( lastBars,tmpArray); break;

default :
Alert( "[ 20-ERROR " + FILENAME + " ] the imput parameter e_type_
data <" + e_type_data + "> is unknown" );
}
}
//+------------------------------------------------------------------+
//| FUNCTION : _FRASMA |
//| Compute the fractally modified SMA from input data. |
//| In : |
//| - lastBars : these "n" last bars are considered for |
//| calculating the fractal dimension |
//| - inputData : data array on which the computation is applied |
//| For further theoretical explanations, see my blog: |
//| http://fractalfinance.blogspot.com/ |
//+------------------------------------------------------------------+
void _FRASMA( int lastBars, double &inputData[] )
{
int pos, iteration;
double diff, priorDiff;
double length;
double priceMax, priceMin;
double fdi,trail_dim,alpha;
int speed;
//----
for( pos=lastBars; pos>=0; pos-- )
{
priceMax=_highest( e_period, pos, inputData );
priceMin=_lowest( e_period, pos, inputData );
length =0.0;
priorDiff=0.0;
//----
for( iteration=0; iteration < g_period_minus_1; iteration++ )
{
if(( priceMax - priceMin)> 0.0 )
{
diff =(inputData[pos + iteration] - priceMin )/( priceMax -
priceMin );
if(iteration > 0 )
{
length+=MathSqrt( MathPow( diff - priorDiff, 2.0)+(1.0/
MathPow( e_period, 2.0)) );
}
priorDiff=diff;
}
}
if(length > 0.0 )
{
fdi=1.0 +(MathLog( length)+ LOG_2 )/MathLog( 2 * e_period );
}
else
{
/*
** The FDI algorithm suggests in this case a zero value.
** I prefer to use the previous FDI value.
*/
fdi=0.0;
}
trail_dim=1/(2-fdi); // This is the trail dimension, the inverse of
the Hurst-Holder exponent
alpha=trail_dim/2;
speed=MathRound(normal_speed*alpha);
ExtOutputBuffer[pos]=iMA(NULL,0,speed,0,0,0,pos);
}
}
//+------------------------------------------------------------------+
//| FUNCTION : _highest |
//| Search for the highest value in an array data |
//| In : |
//| - n : find the highest on these n data |
//| - pos : begin to search for from this index |
//| - inputData : data array on which the searching for is done |
//| |
//| Return : the highest value |
|
//+------------------------------------------------------------------+
double _highest( int n, int pos, double &inputData[] )
{
int length=pos + n;
double highest=0.0;
//----
for( int i=pos; i < length; i++ )
{
if(inputData[i] > highest)highest=inputData[i];
}
return( highest );
}
//+------------------------------------------------------------------+
//| FUNCTION : _lowest |

===+
//| Search for the lowest value in an array data |
//| In : |
//| - n : find the hihest on these n data |
//| - pos : begin to search for from this index |
//| - inputData : data array on which the searching for is done |
//| |
//| Return : the highest value |
//+------------------------------------------------------------------+
double _lowest( int n, int pos, double &inputData[] )
{
int length=pos + n;
double lowest=9999999999.0;
//----
for( int i=pos; i < length; i++ )
{
if(inputData[i] < lowest)lowest=inputData[i];
}
return( lowest );
}
q********g
发帖数: 10694
6
这都是几年前的老贴子了。当时poton在他的blog里提FDI。有人说能不能做成MACD形式
的。根本没有什么FD MACD。lz说的FD MACD,我只是好奇,想知道是不是真正有而已。
如有冒犯,对不住lz了。

/* */ |
/* */"

【在 i**********n 的大作中提到】
: //+------------------------------------------------------------------+
: //| FRASMA.mq4 |
: //| Copyright © 2008, [email protected]
: /* */ |
: //| http://fractalfinance.blogspot.com/ |
: //+------------------------------------------------------------------+
: #property copyright "Copyright © 2008, [email protected]
: /* */"
: #property link "http://fractalfinance.blogspot.com/"
: #property indicator_chart_window

g****t
发帖数: 31659
7
这个办法用了FD算moving average的gain啊?

【在 q********g 的大作中提到】
: 我去,你能不能把哥的id从题目里拿下。。
: 你的txt文本里的确没有FD。

q********g
发帖数: 10694
8
明白了,就是FDI(小number)跟FDI(大number)一组和就是了。。我发现我对MACD的
概念完全忘光了。。

【在 g****t 的大作中提到】
: 这个办法用了FD算moving average的gain啊?
M***n
发帖数: 5815
9
修改了帖子以及跟帖的标题
g****t
发帖数: 31659
10
我所知甚少。征文还是算了。
网上文献都有。尤其是有不少附带回测结果的文献。

indicator

【在 M***n 的大作中提到】
: 哭死,早上刚给guvest发信说,能不能写篇应邀征文,说说MACD以及衍生的indicator
: 。还没收到回复,这都曝光了...

相关主题
SCOTTRADE帐户里能不能看 STOCK REAL-TIME PLOT?泡泡说的pivot point 指标的文献
TA大牛们分析下ROYLWeekly Market Review 201213
请高手看看我的thinkorswim chart set up(附图)其实我说的ETF机制有更深层次的意义。
进入Stock版参与讨论
w********2
发帖数: 16371
11
这个讨论不错呀

【在 g****t 的大作中提到】
: 下面是我之前的帖子,我后来提及,你可能没找到,我重贴一遍。
: 同一个网站也有adaptive MACD,simple MACD,等的回测结果。
: 共同研究和讨论吧。
: 发信人: guvest (我爱你老婆Anna), 信区: Stock
: 标 题: 这个fractal moving average 有哪个tool可以画吗?
: 发信站: BBS 未名空间站 (Thu Oct 15 21:33:58 2015, 美东)
: http://etfhq.com/blog/2010/10/09/frama-is-it-effective/
: 按着篇文章的说法,比macd准多了。
: /etfhq.com/blog/2010/10/09/frama-is-it-effective/

g****t
发帖数: 31659
12
MACD这些都可以看做通过对导数的估计,然后
检查一个信号的导数穿过0的时间点,
和检查图像的边缘什么的,算法其实是一样的吧。
其实这些算法要想弄的fancy,我一星期能写一个专利,
能写一年不重样,但那都是唯像的办法,没大用。
设计一个好的,能卖钱的高精度微分器很难,而且我认为一定是要用到
domain knowledge的。这个世界上不存在只靠信号本身就
能算出来信号速度的算法或者仪器。如果能做好,可以直接创业了,不用炒股了 :)

【在 w********2 的大作中提到】
: 这个讨论不错呀
g****t
发帖数: 31659
13
是的。
我个人观点是:
花街已经弄清楚MACD了。散户想赚钱,可能必须研究如果使用
时变的gain,而不是固定参数的MACD。

【在 q********g 的大作中提到】
: 明白了,就是FDI(小number)跟FDI(大number)一组和就是了。。我发现我对MACD的
: 概念完全忘光了。。

w********2
发帖数: 16371
14
你记错人了吧,我只会识别日本视频

【在 g****t 的大作中提到】
: MACD这些都可以看做通过对导数的估计,然后
: 检查一个信号的导数穿过0的时间点,
: 和检查图像的边缘什么的,算法其实是一样的吧。
: 其实这些算法要想弄的fancy,我一星期能写一个专利,
: 能写一年不重样,但那都是唯像的办法,没大用。
: 设计一个好的,能卖钱的高精度微分器很难,而且我认为一定是要用到
: domain knowledge的。这个世界上不存在只靠信号本身就
: 能算出来信号速度的算法或者仪器。如果能做好,可以直接创业了,不用炒股了 :)

q********g
发帖数: 10694
15
这个观点,植物王已经阐述了很多,当时我对这一点是非常支持的。呵呵。
大家说开了,以后常讨论。呵呵

【在 g****t 的大作中提到】
: 是的。
: 我个人观点是:
: 花街已经弄清楚MACD了。散户想赚钱,可能必须研究如果使用
: 时变的gain,而不是固定参数的MACD。

j**********5
发帖数: 5878
16
大妈坐车上看到大牛的技术牛贴,立马来围观,下班了慢慢看
[发表自未名空间手机版 - m.mitbbs.com]
M***n
发帖数: 5815
17
我记得当时洽老师读了plantking的文章后,还特地写了一篇,说TA
@ 如何从蝌蚪青蛙变为股市高手 - 作者 plantking
http://www.mitbbs.com/article_t/Stock/36370461.html
@ 很多人说TA不管用 - 作者 qiaqiafeng
http://www.mitbbs.com/article_t/Stock/36370743.html

【在 q********g 的大作中提到】
: 这个观点,植物王已经阐述了很多,当时我对这一点是非常支持的。呵呵。
: 大家说开了,以后常讨论。呵呵

M***n
发帖数: 5815
18
我在写pivot points那篇文章,是偶然看到洽老师在一个帖子里提了一句,然后去搜了
下,写的。之前也对pivot points并无了解。帖子写出来以后,感觉带动不少朋友对股
票的indicator的讨论。
你在写的过程中,会被迫去系统化的思考,这个反过来,能加深你对内容的理解。先别
着急拒绝,你再考虑考虑。

【在 g****t 的大作中提到】
: 我所知甚少。征文还是算了。
: 网上文献都有。尤其是有不少附带回测结果的文献。
:
: indicator

t***3
发帖数: 936
19
最喜欢哪个日本女优?

【在 w********2 的大作中提到】
: 你记错人了吧,我只会识别日本视频
s*****o
发帖数: 459
20
谢谢分享这些信息
我一直认为用分形计算ma,bb可能给出更准确的结果,但一直没试过,一个是没有时间
一个也是不知道怎么处理一些情况,所以看了这篇文章有些启发,有收获
不过看了以后,我另一个感受是这个方法问题挺多的(可能主要还是自己水平不够)它
的计算倒不复杂,但没有考虑进去的因素很多,比方关键一个vol和价格之间的关系。
。。
还有ann rtn ~10%左右,我觉得一些人没用这么fancy的分析但采用的策略有效收益却
高的多,这个方法loss也不低》-10%,谈不上“精准”,说到底还是不如人的操作经验
重要,不过这样的方法可能更适合自动交易

【在 g****t 的大作中提到】
: 下面是我之前的帖子,我后来提及,你可能没找到,我重贴一遍。
: 同一个网站也有adaptive MACD,simple MACD,等的回测结果。
: 共同研究和讨论吧。
: 发信人: guvest (我爱你老婆Anna), 信区: Stock
: 标 题: 这个fractal moving average 有哪个tool可以画吗?
: 发信站: BBS 未名空间站 (Thu Oct 15 21:33:58 2015, 美东)
: http://etfhq.com/blog/2010/10/09/frama-is-it-effective/
: 按着篇文章的说法,比macd准多了。
: /etfhq.com/blog/2010/10/09/frama-is-it-effective/

1 (共1页)
进入Stock版参与讨论
相关主题
请教做shit桶的,trading signal-based strategy 如何calibrate?关心SINA的来看看老美的技术分析
哪本书讲MACD最适合蝌蚪?SCOTTRADE帐户里能不能看 STOCK REAL-TIME PLOT?
贴个 SPX 期指 5-min intraday 吧TA大牛们分析下ROYL
SPX1350 is the target请高手看看我的thinkorswim chart set up(附图)
TTM和wnr做多的非常危险泡泡说的pivot point 指标的文献
大家能说说自己平时分析走势主要用哪些indicator吗?Weekly Market Review 201213
牛市最迟下周三断气其实我说的ETF机制有更深层次的意义。
第三天喊熊,大家现在觉得能接受这个观点么?如何做swing trade
相关话题的讨论汇总
话题: inputdata话题: pos话题: int话题: lastbars话题: tmparray