Req-Help : I need help to modify this AFL with Scanner!!

#1
_SECTION_BEGIN("BackGroundColorSetting");
SetChartBkGradientFill( ParamColor("BackGroundTop", colorBlack),

ParamColor("BackGroundBottom", colorBlack),ParamColor("TitleBlock",colorBlack ));
_SECTION_END();


_SECTION_BEGIN("HIGHER HIGH LOWER LOW");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - HIGHER HIGH LOWER LOW - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

Q = Param( "% Change", 2, 0.1, 10, 0.1 );
Z = Zig( C , q ) ;
HH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( z, q, 1 ) > Peak( Z, q, 2 ) ) );
LH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( Z, q, 1 ) < Peak( Z, q, 2 ) ) );
HL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) > Trough( Z, q, 2 ) ) );
LL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) < Trough( Z, q, 2 ) ) );
GraphXSpace = 5;
dist = 0.5 * ATR( 20 );

for ( i = 0; i < BarCount; i++ )
{
if ( HH )
PlotText( "HH", i, H[ i ] + dist, colorRed );

if ( LH )
PlotText( "LH", i, H[ i ] + dist, colorRed );

if ( HL )
PlotText( "HL", i, L[ i ] - dist, colorBrightGreen );

if ( LL )
PlotText( "LL", i, L[ i ] - dist, colorBrightGreen );

}



Please help me to modify this AFL with scanner. Thanks
 

asnavale

Well-Known Member
#2
_SECTION_BEGIN("BackGroundColorSetting");
SetChartBkGradientFill( ParamColor("BackGroundTop", colorBlack),

ParamColor("BackGroundBottom", colorBlack),ParamColor("TitleBlock",colorBlack ));
_SECTION_END();


_SECTION_BEGIN("HIGHER HIGH LOWER LOW");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - HIGHER HIGH LOWER LOW - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

Q = Param( "% Change", 2, 0.1, 10, 0.1 );
Z = Zig( C , q ) ;
HH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( z, q, 1 ) > Peak( Z, q, 2 ) ) );
LH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( Z, q, 1 ) < Peak( Z, q, 2 ) ) );
HL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) > Trough( Z, q, 2 ) ) );
LL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) < Trough( Z, q, 2 ) ) );
GraphXSpace = 5;
dist = 0.5 * ATR( 20 );

for ( i = 0; i < BarCount; i++ )
{
if ( HH )
PlotText( "HH", i, H[ i ] + dist, colorRed );

if ( LH )
PlotText( "LH", i, H[ i ] + dist, colorRed );

if ( HL )
PlotText( "HL", i, L[ i ] - dist, colorBrightGreen );

if ( LL )
PlotText( "LL", i, L[ i ] - dist, colorBrightGreen );

}



Please help me to modify this AFL with scanner. Thanks


This AFL is for plotting and marking peaks and troughs. Not for scanning.

-Anant
 
#4
Mr. Anant,

Is there other way for me to find out which stocks are in the position on Lower Low n Higher low to make easy n fast to look?

Thanks
 
Last edited:

asnavale

Well-Known Member
#5
Mr. Anant,

Is there other way for me to find out which stocks are in the position on Lower Low n Higher low to make easy n fast to look?

Thanks
Hi Rudal,

You can compare the current price with most recent HH or LL. Add the comparison code to the Above AFL posted by Glenn.

-Anant
 

pkgmtnl

Well-Known Member
#6
_SECTION_BEGIN("BackGroundColorSetting");
SetChartBkGradientFill( ParamColor("BackGroundTop", colorBlack),

ParamColor("BackGroundBottom", colorBlack),ParamColor("TitleBlock",colorBlack ));
_SECTION_END();


_SECTION_BEGIN("HIGHER HIGH LOWER LOW");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - HIGHER HIGH LOWER LOW - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

Q = Param( "% Change", 2, 0.1, 10, 0.1 );
Z = Zig( C , q ) ;
HH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( z, q, 1 ) > Peak( Z, q, 2 ) ) );
LH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( Z, q, 1 ) < Peak( Z, q, 2 ) ) );
HL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) > Trough( Z, q, 2 ) ) );
LL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) < Trough( Z, q, 2 ) ) );
GraphXSpace = 5;
dist = 0.5 * ATR( 20 );

for ( i = 0; i < BarCount; i++ )
{
if ( HH )
PlotText( "HH", i, H[ i ] + dist, colorRed );

if ( LH )
PlotText( "LH", i, H[ i ] + dist, colorRed );

if ( HL )
PlotText( "HL", i, L[ i ] - dist, colorBrightGreen );

if ( LL )
PlotText( "LL", i, L[ i ] - dist, colorBrightGreen );

}



Please help me to modify this AFL with scanner. Thanks


Put in Buy and Sell conditions to make it expl AFL
 

SwingKing

Well-Known Member
#7
A user had asked for the same AFL ... I have modified it and sent it to him ... Tht users name is kooldude1411 ... ask him to post it on this thread ...

Tc
 
#8
Try this :)
-------------------------------------------------
_SECTION_BEGIN("BackGroundColorSetting");
SetChartBkGradientFill( ParamColor("BackGroundTop", colorBlack),

ParamColor("BackGroundBottom", colorBlack),ParamColor("TitleBlock",colorBlack ));
_SECTION_END();


_SECTION_BEGIN("HIGHER HIGH LOWER LOW");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - HIGHER HIGH LOWER LOW - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

Q = Param( "% Change", 2, 0.1, 10, 0.1 );
Z = Zig( C , q ) ;
HH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( z, q, 1 ) > Peak( Z, q, 2 ) ) );
LH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( Z, q, 1 ) < Peak( Z, q, 2 ) ) );
HL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) > Trough( Z, q, 2 ) ) );
LL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) < Trough( Z, q, 2 ) ) );
GraphXSpace = 5;
dist = 0.5 * ATR( 20 );

for ( i = 0; i < BarCount; i++ )
{
if ( HH )
PlotText( "HH", i, H[ i ] + dist, colorRed );

if ( LH )
PlotText( "LH", i, H[ i ] + dist, colorRed );

if ( HL )
PlotText( "HL", i, L[ i ] - dist, colorBrightGreen );

if ( LL )
PlotText( "LL", i, L[ i ] - dist, colorBrightGreen );

}

Filter=HH OR HL OR LH OR LL;
AddColumn(HH,"HH",1);
AddColumn(LH,"LH",1);
AddColumn(HL,"HL",1);
AddColumn (LL,"LL",1);
 
#9
Mr Indicators,

Thanks for your reply n help. I have tried but still didnt work. How do i have to do next?

If i add

Buy = (C=LL=HL>LH=HH);
Sell = (HH=LH<HL=LL=C);

Its working but
It doesnt look right to me but its better than before.
Could you help to fix it, please?

Thanks
-Rossi
 

Similar threads