[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] REQUIRED afl code


  • Date: Thu, 21 Jan 2010 08:51:54 +0100
  • From: reinsley <reinsley@xxxxxxxx>
  • Subject: Re: [amibroker] REQUIRED afl code

PureBytes Links

Trading Reference Links

Prasan,

Many moving average, some are smooth ma

BR


// Moving average collection

per=Param("Period", 20, 5, 50, 1);
L1=LastValue(Cum(1));
C1=IIf(Cum(1)>L1-2*per AND 
Cum(1)<=L1-per,110,IIf(Cum(1)<=L1-2*PER,100,105));
Plot(C1,"TEST",1,8);

m10 = ParamToggle("AMA Kaufman", "Hide|Show");
C10 = ParamColor( "AMA_Kaufman Color" , colorRed );
if (m10)
{
    P = C1;
    fast = 2/(2+1);
    slow = 2/(30+1 );
    dir=abs(p-Ref(p,-Per));
    vol=Sum(abs(p-Ref(p,-1)),Per);
    ER=dir/vol;
    sc =( ER*(fast-slow)+slow)^2;
    Plot( AMA(P, SC), "\n AMA_Kaufman", C10, styleThick);
}

m11 = ParamToggle("DEMA", "Hide|Show" );
C11 = ParamColor( "DEMA Color", colorBlue );
if (m11)
{
    P = C1;
    Plot( DEMA( P, per ), "\n DEMA", C11, styleThick );
}

m12 = ParamToggle("EMA", "Hide|Show" );
C12 = ParamColor( "EMA Color", colorOrange);
if (m12)
{
    P = C1;
    Plot( EMA( P, per ), "\n EMA", C12 , styleThick);
}

m13 = ParamToggle("Linear Regression", "Hide|Show" );
C13 = ParamColor( "LinearReg Color", colorAqua );
if (m13)
{
    P = C1;
    Plot( LinearReg( P, Per ), "\n LinearReg", C13, styleThick );
}

m14 = ParamToggle("SMA", "Hide|Show" );
C14 = ParamColor( "SMA Color", colorYellow);
if (m14)
{
    P = C1;
    Plot( MA( P, Per), "\n SMA", C14, styleThick);
}

m15 = ParamToggle("Percentile", "Hide|Show" );
C15 = ParamColor( "Percentile Color", colorWhite);
if (m15)
{
    P = C1;
    Rank = 50;
    Plot( Percentile(p, Per, rank), "\n Percentile", C15, styleThick);
}

m16 = ParamToggle("TEMA", "Hide|Show" );
C16 = ParamColor( "TEMA Color", colorGreen);
if (m16)
{
    P = C1;
    Plot( TEMA( P, Per),"\n TEMA", C16, styleThick);
}

m17 = ParamToggle("TSF", "Hide|Show" );
C17 = ParamColor( "TSF Color", colorCustom12);
if (m17)
{
    P = C1;
    Plot( TSF( P, Per), "\n TSF", C17, styleThick);
}

m18 = ParamToggle("T3", "Hide|Show" );
C18 = ParamColor( "T3 Color", colorPaleBlue);
if (m18)
{
    P = C1;
    a = 0.7 ;
    e1=EMA (P,Per);
    e2=EMA (e1,Per);
    e3=EMA (e2,Per);
    e4=EMA (e3,Per);
    e5=EMA (e4,Per);
    e6=EMA (e5,Per);
    T3 = -a^3 * e6 + (3 * a^2 +3 * a^3) * e5 + (-6 * a^2 - 3 * a - 3 * 
a^3) * e4 + (1 + 3 * a + a^3 + 3 * a^2 ) * e3;
    Plot( T3, "\n T3", C18, ParamStyle("Style"));
}

m19 = ParamToggle("ViDYA(CMO)", "Hide|Show" );
C19 = ParamColor( "ViDYA(CMO) Color", colorLightBlue);
if (m19)
{
    P = C1;
    cmopds = per;
    n = per;
    f = 2/(n+1);
    Up = Sum(IIf(P > Ref(P, -1), (P - Ref(P ,-1)), 0 ), cmopds);
    Dw = Sum(IIf(P < Ref(P, -1), (Ref(P, -1) - P), 0 ), cmopds);
    CMO = abs ((Up - Dw)/(Up + Dw));
    sc = f*CMO;
    Plot( AMA(P, sc), "\n ViDYA(CMO)", C19, ParamStyle("Style" ));
}

m20 = ParamToggle("ViDYA(StDev)", "Hide|Show" );
C20 = ParamColor( "ViDYA(StDev) Color" , colorPaleGreen);
if(m20)
{
    P = C1;
    n = per;
    f = 2/(n+1 );
    K = StDev(P, per)/StDev(P, 2*Per);
    sc = f*K;
    Plot( AMA(P, sc), "\n ViDYA(StDev)", C20, ParamStyle("Style"));
}

m21 = ParamToggle("Wilders", "Hide|Show" );
C21 = ParamColor( "Wilders Color", colorBrown);
if (m21)
{
    P = C1;
    Plot( Wilders( P, Per ), "\n Wilders", C21, ParamStyle("Style") );
}

m22 = ParamToggle("WMA", "Hide|Show" );
C22 = ParamColor( "WMA Color", colorGold);
if (m22)
{
    P = C1;
    Plot( WMA( P, Per ), "\n WMA", C22, ParamStyle("Style") );
}





Le 20/01/2010 21:19, Alan Northam a écrit :
> //simple moving average with smoothing
> P = ParamField("Price field",-1);
> movavgperiod = Param("Period",20, 1,200,1);
> smoothing = Param("Smoothing",9, 1, 20, 1);
> sma1 = MA(P, movavgperiod);
> sma2 = MA(sma1,smoothing);
> Plot(sma2,"Smoothed MA", ParamColor( "Color", colorCycle
> ),ParamStyle("Style"));
>
>
>
> prasantaroy36 wrote:
>>
>> Dear friends
>>
>> I want smooth moving average afl with parametre period settings. Pl ,
>> help.
>> Thanks
>>
>>
>
>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>
>



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/