Could you please write this simple AFL for...

casoni

Well-Known Member
#12
Thanks KelvinHand,

I am still getting some error with AFL. Please correct it if you can.

Thanks in advance.


H1= TimeFrameGetPrice("H",inDaily,-1);
L1= TimeFrameGetPrice("L",inDaily,-1);
Plot(H1,"",colorLightYellow,1|styleNoRescale|style NoLabel);
Plot(L1,"",colorLightYellow,1|styleNoRescale|style NoLabel);

as suggested by KelvinHand
remove space which comes between , style NoLabe , this will solve your problem "style NoLabe" , should be one whole word .
this your solve the issue , if not post image to show the error
Thank you
or delete |style NoLabel
 
#13
Hi Casoni,

I removed the space @ style Nolabel => styleNolabel

I am still getting some error, could you please have look at it &
correct.

I tried but could not attach the (error) image, but i typed exactly
the same (see below). Thanks very much for your help.

Price:
H1= TimeFrameGetPrice(H, inDaily,-1);
L1= TimeFrameGetPrice(L, inDaily,-1);
Plot(H1,
-------^

Error 29.
Variable h1 used Without having been initialized.

Use Edit Formula to correct Error
 

sudris

Well-Known Member
#14
@buskar7,

try this one. now it wont alter the numbering even if you select any bar

Code:
GraphXSpace = 5;

SetChartOptions( 0, chartShowArrows | chartShowDates );
_N( Title = StrFormat( "{{NAME}} - {{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() );

iBars = BarsSince( Day() != Ref( Day(), -1 ) );

for ( i = BarCount - ( LastValue( iBars ) + 1 ); i < BarCount; i++ )
{
    j[i] = abs( ( LastValue( BarCount ) - 2 * i - ( LastValue( iBars - i ) ) - 2 ) );
    PlotText( NumToStr( j[i], 1 ), i, L[i] - L[i]*0.001, colorBlue );
}

Plot( TimeFrameGetPrice( "H", inDaily, -1 ), "Y'Day High", 4 );

Plot( TimeFrameGetPrice( "L", inDaily, -1 ), "Y'Day Low", 5 );
 

sudris

Well-Known Member
#16
@buskar7,

here is the one for alternate numbering :

Code:
GraphXSpace = 5;

SetChartOptions( 0, chartShowArrows | chartShowDates );
_N( Title = StrFormat( "{{NAME}} - {{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() );

iBars = BarsSince( Day() != Ref( Day(), -1 ) );

for ( i = BarCount - ( LastValue( iBars ) + 1 ); i < BarCount; i=i+2 )
{
    j[i] = abs( ( LastValue( BarCount ) - 2 * i - ( LastValue( iBars - i ) ) - 2 ) );
    PlotText( NumToStr( j[i], 1 ), i, L[i] - L[i]*0.001, colorBlue );
}

Plot( TimeFrameGetPrice( "H", inDaily, -1 ), "Y'Day High", 4 );

Plot( TimeFrameGetPrice( "L", inDaily, -1 ), "Y'Day Low", 5 );
 

KelvinHand

Well-Known Member
#17
Hi Casoni,

I removed the space @ style Nolabel => styleNolabel

I am still getting some error, could you please have look at it &
correct.

I tried but could not attach the (error) image, but i typed exactly
the same (see below). Thanks very much for your help.

Price:
H1= TimeFrameGetPrice(“H”, inDaily,-1);
L1= TimeFrameGetPrice(“L”, inDaily,-1);
Plot(H1,
-------^

Error 29.
Variable ‘h1’ used Without having been initialized.

Use ‘Edit Formula’ to correct Error”
Don't know what version of Amibroker are you using.
This kind of error, to solve it usually you should try reset h1 to 0 before all statement.

In all cases, any posting of code should be bracketed with :
[C o d e ] & [/ C o d e ]. (Note: no space between letters)
 
#18
Hi Friends,

I am new in stock market. I use amibroker software for analyses. I want write one simple afl in intraday 30 min candle chart when candle color is green and after closing these green candle and next candle is break high of previous green candle buy call and vise versa in case of red candle

if any one do these pls try.......

Thanks
 
#19
Hi KelvinHand,

I am using Amibroker 5.30 Professional Edition. I am still getting the error.

thanks.



Don't know what version of Amibroker are you using.
This kind of error, to solve it usually you should try reset h1 to 0 before all statement.

In all cases, any posting of code should be bracketed with :
[C o d e ] & [/ C o d e ]. (Note: no space between letters)
 

Similar threads