Affichage des articles dont le libellé est False Bar Stochastic. Afficher tous les articles
Affichage des articles dont le libellé est False Bar Stochastic. Afficher tous les articles

mercredi 26 octobre 2016

False Bar Stochastic

Hello,
I had posted this question before but as I got no suitable reply I am posting it again with some changes
The False Bar Stochastic for Advanced Get can be duplicated in Amibroker thus

_SECTION_BEGIN("Stochastic_45-4-2_833");

ColorX=colorBlack;
//ColorX=colorWhite;

SetChartBkColor(ParamColor("Panel color ",ColorX));

periods = Param( "Periods", 45, 1, 200, 1 );
K1smooth = Param( "%K1 avg", 4, 1, 200, 1 );
//Plot( StochK( periods , K1smooth), _DEFAULT_NAME(), colorCustom3, styleNoLabel | styleThick | styleDots);


periods = Param( "Periods", 45, 1, 200, 1 );
K1smooth = Param( "%K1 avg", 4, 1, 200, 1 );
D1smooth = Param( "%D1 avg", 2, 1, 200, 1 );
//Plot( StochD( periods , K1smooth, D1Smooth ), _DEFAULT_NAME(), colorCustom3, styleNoLabel | styleThick | styleDots);



A = StochK( periods , K1smooth);
B = StochD( periods , K1smooth, D1Smooth );


Plot (20, "", colorTan, styleNoLabel);
Plot (50, "", colorLavender, styleNoLabel);
Plot (80, "", colorTan, styleNoLabel);

PlotOHLC( 100, 100 , 95 , 95 , "", IIf(A>80,colorAqua,ColorX), styleCloud | styleNoLabel);
PlotOHLC( 5, 5 , 0 , 0 , "", IIf(A<20,colorAqua,ColorX), styleCloud | styleNoLabel);

periods = Param( "Periods", 8, 1, 200, 1 );
K1smooth = Param( "%K1 avg", 3, 1, 200, 1 );



periods = Param( "Periods", 8, 1, 200, 1 );
K2smooth = Param( "%K1 avg", 3, 1, 200, 1 );
D2smooth = Param( "%D1 avg", 3, 1, 200, 1 );

M = StochK( periods , K2smooth);
N = StochD( periods , K2smooth, D2Smooth );

ColorK=IIf(A>B,colorBrightGreen,colorRed);

Plot( M,"StoK", ColorK, styleNoLabel|styleThick);
Plot( N,"StoD", colorDarkYellow, styleNoLabel|styleDashed);



//PlotOHLC( 0, A , B , B , "Cloud", IIf(A > B ,colorAqua,colorRed), styleCloud | styleNoLabel);


_SECTION_END();

What I want is an exploration to return the first instance of a false bar appearance in a security
I tried

k = StochK();
d = StochD();

overbought = k > 80;
falseSignal = Ref( overbought, -1 ) AND C > Ref( C, -1 );

Filter = falseSignal;
AddColumn( Close, "Close" );
AddColumn( Ref( Close, -1), "Prev Close" );
AddColumn( Ref( k, -1), "Prev %k" );

But this did not work either

Can somebody help?


False Bar Stochastic