设为首页收藏本站

 找回密码
 注册
楼主: 飞鸟
打印 上一主题 下一主题

中国程序化交易的发展需要更多分享和合作。希望大家支持 [复制链接]

Rank: 2

精华
0
UID
114758
积分
89
帖子
58
主题
1
阅读权限
30
注册时间
2013-1-10
最后登录
2013-2-27
21#
发表于 2013-1-30 10:11:12 |只看该作者
强烈支持~

使用道具 举报

Rank: 2

精华
0
UID
110975
积分
59
帖子
27
主题
0
阅读权限
30
注册时间
2012-6-15
最后登录
2013-5-12
22#
发表于 2013-2-8 16:53:43 |只看该作者
% The Hurst exponent
%--------------------------------------------------------------------------
% The first 20 lines of code are a small test driver.
% You can delete or comment out this part when you are done validating the
% function to your satisfaction.
%
% Bill Davidson, quellen@yahoo.com
% 13 Nov 2005

function []=hurst_exponent()
disp('testing Hurst calculation');

n=100;
data=rand(1,n);
plot(data);

hurst=estimate_hurst_exponent(data);

[s,err]=sprintf('Hurst exponent = %.2f',hurst);disp(s);

%--------------------------------------------------------------------------
% This function does dispersional analysis on a data series, then does a
% Matlab polyfit to a log-log plot to estimate the Hurst exponent of the
% series.
%
% This algorithm is far faster than a full-blown implementation of Hurst's
% algorithm.  I got the idea from a 2000 PhD dissertation by Hendrik J
% Blok, and I make no guarantees whatsoever about the rigor of this approach
% or the accuracy of results.  Use it at your own risk.
%
% Bill Davidson
% 21 Oct 2003

function [hurst] = estimate_hurst_exponent(data0)   % data set

data=data0;         % make a local copy

[M,npoints]=size(data0);

yvals=zeros(1,npoints);
xvals=zeros(1,npoints);
data2=zeros(1,npoints);

index=0;
binsize=1;

while npoints>4
   
    y=std(data);
    index=index+1;
    xvals(index)=binsize;
    yvals(index)=binsize*y;
   
    npoints=fix(npoints/2);
    binsize=binsize*2;
    for ipoints=1:npoints % average adjacent points in pairs
        data2(ipoints)=(data(2*ipoints)+data((2*ipoints)-1))*0.5;
    end
    data=data2(1:npoints);
   
end % while

xvals=xvals(1:index);
yvals=yvals(1:index);

logx=log(xvals);
logy=log(yvals);

p2=polyfit(logx,logy,1);
hurst=p2(1); % Hurst exponent is the slope of the linear fit of log-log plot

return;

使用道具 举报

Rank: 2

精华
0
UID
110975
积分
59
帖子
27
主题
0
阅读权限
30
注册时间
2012-6-15
最后登录
2013-5-12
23#
发表于 2013-2-8 16:54:10 |只看该作者
Hurst指数能编写成TB指标吗?上面是Matlab的源码

使用道具 举报

Rank: 3Rank: 3

精华
0
UID
64858
积分
197
帖子
80
主题
23
阅读权限
40
注册时间
2011-9-11
最后登录
2021-3-28
24#
发表于 2013-2-19 18:24:03 |只看该作者
支持楼主!

使用道具 举报

Rank: 9Rank: 9Rank: 9

精华
3
UID
2459
积分
14088
帖子
179
主题
19
阅读权限
150
注册时间
2008-9-26
最后登录
2015-12-3
25#
发表于 2013-2-24 14:16:19 |只看该作者
后生可畏!
向飞鸟哥学习

使用道具 举报

Rank: 3Rank: 3

精华
0
UID
117784
积分
147
帖子
67
主题
17
阅读权限
40
注册时间
2013-4-5
最后登录
2013-10-22
26#
发表于 2013-10-11 11:46:51 |只看该作者
你的新浪博客打不开啊

使用道具 举报

Rank: 4

精华
0
UID
114391
积分
294
帖子
89
主题
6
阅读权限
50
注册时间
2012-12-25
最后登录
2015-7-22
27#
发表于 2013-10-11 20:34:17 |只看该作者

使用道具 举报

Rank: 3Rank: 3

精华
0
UID
66209
积分
128
帖子
78
主题
19
阅读权限
40
注册时间
2011-9-18
最后登录
2020-12-20
28#
发表于 2013-10-28 11:07:28 |只看该作者
楼主人在新加坡?

使用道具 举报

Rank: 2

精华
0
UID
67878
积分
61
帖子
27
主题
1
阅读权限
30
注册时间
2011-9-26
最后登录
2014-3-13
29#
发表于 2013-10-28 14:52:14 |只看该作者
支持楼主,好贴留名马克!

使用道具 举报

Rank: 4

精华
0
UID
218974
积分
322
帖子
265
主题
17
阅读权限
50
注册时间
2015-9-5
最后登录
2023-5-7
30#
发表于 2015-10-23 14:59:10 |只看该作者
支持交流!
我手头有一大堆的TS和MT4源代码,

就是不会编为TB的!

苦啊~~~~~~

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-4-20 07:20

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部