Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Mann-Kendall Trend Detection for Amibroker (AFL)

Rating:
2 / 5 (Votes 5)
Tags:
amibroker

If the indicator value is zero non trending market…

If -1 down trend ,vice versa…

Enjoy it…!!!

Screenshots

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn almost 13 years ago
3_6Day GuaiLiLv
Submitted by motorfly almost 13 years ago
Williams Alligator System
Submitted by durgesh1712 about 13 years ago
*Level Breakout system*
Submitted by Tinych about 13 years ago
Horizontal Live Priceline Tool
Submitted by northstar about 13 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Mann-Kendall");
Length= Param( "Period", 21, 5, 200, 1 ); 
function Trend(Price,Length) {
 Price=C;
    Result = 0;
 
     
 
    for (k=Length;k<BarCount;k++) {
 
        S = 0;
 
        for (i=k-Length+1;i<k;i++) {         
            for (j=k-Length;j<i-1;j++) {
                Signum = sign(Price[i]-Price[j]);
                S += Signum;
            }           
        }
         
        Variance =( Length*(Length-1.0)*(2*Length+5.0))/18.0;       
        StdDev = sqrt(Variance);
 
        zScore = 0;
        if (S >= 0) {
            zScore=((S-1)/StdDev);
        }else {
            zScore=(S+1)/StdDev;
        }
 
        Result[k] = 0; //0- no trend, -1 - decreasing trend, 1 - increasing trend
 
        isTrend = False;
        if ((zScore>=1.65)||(zScore<=-1.65)) { 
            isTrend=True;
        }
 
        if (isTrend)    {       
            if (S<0){
                Result[k] = -1;
            }else {
                Result[k] = 1;
            }
        }
 
    }
 
    return Result;
}
Plot(C,"",colorRed,styleCandle);
Plot(Trend(C,Length),"",colorRed,styleLine+styleThick|styleOwnScale);
_SECTION_END();

1 comments

1. ole

This formula was posted 3 days ago by isozaki.

Leave Comment

Please login here to leave a comment.

Back