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

Thiru-Optimum-Avg for Amibroker (AFL)
tmnkin
about 12 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 5)
Tags:
amibroker, exploration, advanced

Optimum moving with can be usefull to both sideways and trending market

Screenshots

Similar Indicators / Formulas

Ultimate-volatility-trading-system-v-2a
Submitted by jaipal7786 about 11 years ago
super trend tracker
Submitted by jaipal7786 over 11 years ago
Stock scan formula
Submitted by meceng1985 about 11 years ago
Deel - Average Dollar Price Volatility
Submitted by kaiji over 15 years ago
Pattern Correlation
Submitted by vargasc1 almost 14 years ago
10 % return by 15 day uptrend exploration
Submitted by mayur_a14 almost 14 years ago

Indicator / Formula

Copy & Paste Friendly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
_SECTION_BEGIN("thiru-optimum-moving");
price = ParamField("field");
n = Param("periods",34);
SA=MA(Price,n);
v1=(StDev(Price,n))^2;
 
Ca=Null;
Ca[n]=sa[n];
 
for(i=n+1; i<BarCount;i++){
v2[i]=(CA[i-1]-SA[i])^2;
k[i]=IIf(V2[i]<V1[i],0,1-V1[i]/V2[i]);
CA[i]=CA[i-1]+K[i]*(SA[i-1]-CA[i-1]);
}
Plot(Ca,"OMA("+WriteVal(n,1.0)+")",colorBlue,styleThick);
Col = IIf(BarsSince(Ref(Ca,-1)>Ca)>BarsSince(Ref(Ca,-1)<Ca),colorBrightGreen,colorRed);
Plot(C,"",Col,styleCandle );
 
_SECTION_END();
 
////////////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN( "Chart Settings" );
SetChartOptions( 0, chartShowArrows | chartShowDates  );
//SetChartBkColor( ParamColor( "Outer Panel", colorDarkGrey ) );
//SetChartBkGradientFill( ParamColor( "Upper Chart", colorWhite ), ParamColor( "Lower Chart", colorWhite ) );
_SECTION_END();
Kisa = Param( "KISA GÃœN", 12, 0.1, 500, 0.1 );
Uzun = Param( "UZUN GÃœN", 43, 0.1, 100, 0.1 );
Tetik = Param( "TETI.K GÃœN", 21, 0.1, 50, 0.1 );
_SECTION_BEGIN( "Periodlar" );
function KisaPeriodTopla( Kisa )
{
    ka = Kisa;
 
    for ( i = 1; i < Kisa; i++ )
    {
        ka = ka + i;
    }
 
    return ka;
}
 
function UzunPeriodTopla( Uzun )
{
    au = Uzun;
 
    for ( iu = 0; iu < Uzun; iu++ )
    {
        au = au + iu;
    }
 
    return au;
}
 
function TetikPeriodTopla( Tetik )
{
    a = Tetik;
 
    for ( i = 0; i < Tetik; i++ )
    {
        a = a + i;
    }
 
    return a;
}
 
_SECTION_END();
_SECTION_BEGIN( " Gün Toplamlar?" );
function KisaGunTopla( Kisa )
{
    a = Kisa;
    kd = a * C;
 
    for ( i = 0;i < Kisa;i++ )
    {
        b = Ref( C, -i );
 
        if ( a > 0 )
            a--;
 
        kd = kd + ( a * b );
    }
 
    return kd;
}
 
function UzunGunTopla( Uzun )
{
    au = Uzun;
    ku = au * C;
 
    for ( iu = 0;iu < Uzun;iu++ )
    {
        bu = Ref( C, -iu );
 
        if ( au > 0 )
            au--;
 
        ku = ku + ( au * bu );
    }
 
    return ku;
}
 
Period12Toplam = KisaPeriodTopla( Kisa );
Day12Toplam = KisaGunTopla( Kisa );
LWMA12 = Day12Toplam / Period12Toplam;
Period43Toplam = UzunPeriodTopla( Uzun );
Day43Toplam = UzunGunTopla( Uzun );
LWMA43 = Day43Toplam / Period43Toplam;
_SECTION_END();
 
_SECTION_BEGIN( " TSR HESAPLANMASI" );
function XDAY( Tetik )
{
    X = ( ( 2 * LWMA12 ) - LWMA43 );
    aX = Tetik;
    kX = AX * X;
 
    for ( iX = 0;iX < Tetik;iX++ )
    {
        bX = Ref( X, -iX );
 
        if ( aX > 0 )
            aX--;
 
        kX = kX + ( aX * bX );
    }
 
    return kX;
}
 
XDayToplam = XDAY( Tetik );
XPeriodToplam = TetikPeriodTopla( Tetik );
TSR = ( XDayToplam / XPeriodToplam );
_SECTION_END();
_SECTION_BEGIN( " EKRANA BASMA I.S,LEMI." );
Plot( C, "Kapanis", colorWhite, styleCandle );
tsrcolor = IIf( TSR > Ref( TSR, -1 ), colorLime, colorRed );
Plot( TSR, "TSR", tsrcolor, styleDots + styleLine );
_SECTION_END();
 
_SECTION_BEGIN( "EXPLORATION" );
//AL=TSR>Ref(TSR,-1);
//SAT=Ref(TSR,-1)>TSR;
AL = Cross( C, TSR );
SAT = Cross( TSR, C );
AL_status = WriteIf( AL, "Al?s, Yap", " " );
SAT_status = WriteIf( SAT, "Sat?s, Yap", " " );
AL_Col = IIf( AL, colorDarkGreen , colorWhite );
SAT_Col = IIf( SAT, colorRed, colorWhite );
Filter = AL OR SAT;
AddColumn( C, "KAPANIS,", 1.2, IIf( C > Ref( C, -1 ), colorBlue, colorRed ) );
AddTextColumn( AL_status, "TSR ALIS,", 1.2, colorWhite, AL_col );
AddTextColumn( SAT_status, "TSR SATIS,", 1.2, colorWhite, SAT_col );
_SECTION_END();
////////////////////////////////////////////////////////////////////////////////////

5 comments

1. velmont

simple but effective…thnx a lot

2. goldwing01

I agree, seems to be effective, but getting “out of range” when running explore.

3. tmnkin

i am new to afl, will work on few things to improve this indicator

4. Divyesh

@tmnkin,

i want to use your AFL in my formula…!
can i use this AFL…?

5. SIRISHA

Hi tmnkin,

error in line No. 11

Error 10. Subscript out of range. You must not access array elements outside 0..(BarCount-1) range

appreciate if you can guide me to correct this.

Regards,
Sirisha

Leave Comment

Please login here to leave a comment.

Back