Need Afl for BBand

#1
Dear All,

I need an AFL for

exploration where today s Bollinger band is greater then or lesser then previous day

(Todays BBandTop - Todays BBandBot) < = (Yesterdays BBandTop - Yesterdays BBandBot)

OR
(Todays BBandTop + Todays BBandBot) < = (Yesterdays BBandTop + Yesterdays BBandBot)

or in any other sense as you like....


thanks
 
Last edited:
#2
Dear All,

I need an AFL for

exploration where today s Bollinger band is greater then or lesser then previous day

(Todays BBandTop - Todays BBandBot) < = (Yesterdays BBandTop - Yesterdays BBandBot)

OR
(Todays BBandTop + Todays BBandBot) < = (Yesterdays BBandTop + Yesterdays BBandBot)

or in any other sense as you like....


thanks
check before use pls.

///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
//pra1968, traderji members request
//created by https://twitter.com/ert_analiz. used amibroker's bb formula

P = ParamField("Price field",-1);
Periods = Param("Periods", 20, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
bbtop=BBandTop( P, Periods, Width );
bbbot=BBandBot( P, Periods, Width );
fark= bbtop-bbbot;

Plot( bbtop, "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( bbbot, "BBBot" + _PARAM_VALUES(), Color, Style );

aranan =fark <= Ref(fark,-1);//(Todays BBandTop - Todays BBandBot) < = (Yesterdays BBandTop - Yesterdays BBandBot)

Filter=aranan;

AddColumn(fark,"fark",1.2);
AddColumn(Ref(fark,-1),"-1day",1.2);
AddColumn(Ref(fark,-2),"-2day",1.2);
AddColumn(Ref(fark,-3),"-3day",1.2);
AddColumn(Ref(fark,-4),"-4day",1.2);
AddColumn(Ref(fark,-5),"-5day",1.2);

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
 
#3
use this one. Previous one gives different values from orginal bb values. If i use "periods" param it gives different values. So i made a tiny change.

and again check before use pls.

////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////

//pra1968, traderji members request
//created by https://twitter.com/ert_analiz. used amibroker's bb formula

P = ParamField("Price field",-1);
zaman = Param("zaman", 20, 2, 300, 1 );//used term "zaman" for "periods"
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
bbtop=BBandTop( p, zaman, 2 );
bbbot=BBandBot( p, zaman, 2 );
fark= bbtop-bbbot;

Plot( bbtop, "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( bbbot, "BBBot" + _PARAM_VALUES(), Color, Style );

aranan =fark <= Ref(fark,-1);//(Todays BBandTop - Todays BBandBot) < = (Yesterdays BBandTop - Yesterdays BBandBot)

Filter=aranan;

AddColumn(fark,"fark",1.3);
AddColumn(Ref(fark,-1),"-1day",1.3);
AddColumn(Ref(fark,-2),"-2day",1.3);
AddColumn(Ref(fark,-3),"-3day",1.3);
AddColumn(Ref(fark,-4),"-4day",1.3);
AddColumn(Ref(fark,-5),"-5day",1.3);

///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
 

Similar threads