Amibroker For Dummies........a Beginner's Forum On How To Use Amibroker

will this thread serve its purpose?

  • yes

    Votes: 397 93.2%
  • no

    Votes: 29 6.8%

  • Total voters
    426
a lot afl's when applied giving me this error and chart goes missing like this , when i delete afl from the delete indicator chart comes back again .

right now its the pivots afl giving error but a lot of others did almost same thing too.

kindly help guys
And what kind of help do you expect if the AFL is unknown? You possibly have line breaks because of copying it from some website. Post the whole AFL with code tags but not just some picture that doesn't tell much.
 
Last edited:

a1b1trader

Well-Known Member
http://www.traderji.com/amibroker/34069-pivot-points-intraday-chart-afl-needed.html

i took these from here @tj too , these also doing same error , i shown above
Actually do you know, what is the main problem
One will not write clearly his problem.
Now you have given a link and that page has 3 afls.
Now how can I know which afl is throwing error.

Anyway, afls of post 2 and 3 are OK.
There is no problem

Afl of post 5 is

Code:
_SECTION_BEGIN("Multi Pivots");
_SECTION_BEGIN ("Multi Pivots - StockManiacs");
//chart colors
SetChartBkColor(ParamColor("Outer panel",colorSkyblue));
SetChartBkGradientFill(
ParamColor("Inner panel upper",colorLightBlue),
ParamColor("Inner panel lower",colorLightYellow)
,ParamColor("TitleBlock",colorWhite)); 
SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);

//basic price plotting
_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() ); 

T_F =ParamList("Pivot T_F","iDay|Hourly|2_Hrs|3_Hrs|4_Hrs|EOD|Weekly|Mon thly");

if (T_F=="iDay") 
{
H_1 = TimeFrameGetPrice( "H", inDaily, -1 );
L_1 = TimeFrameGetPrice( "L", inDaily, -1 );
C_1 = TimeFrameGetPrice( "C", inDaily, -1 );
O = TimeFrameGetPrice("O", inDaily); // current day's open
}
else if (T_F == "Hourly") 
{
H_1 = TimeFrameGetPrice( "H", inHourly, -1 );
L_1 = TimeFrameGetPrice( "L", inHourly, -1 );
C_1 = TimeFrameGetPrice( "C", inHourly, -1 );
O = TimeFrameGetPrice( "O", inHourly );
}
else if (T_F == "2_Hrs") 
{
H_1 = TimeFrameGetPrice( "H", inHourly*2, -1 );
L_1 = TimeFrameGetPrice( "L", inHourly*2, -1 );
C_1 = TimeFrameGetPrice( "C", inHourly*2, -1 );
O = TimeFrameGetPrice( "O", inHourly*2);
}
else if (T_F == "3_Hrs") 
{
H_1 = TimeFrameGetPrice( "H", inHourly*3, -1 );
L_1 = TimeFrameGetPrice( "L", inHourly*3, -1 );
C_1 = TimeFrameGetPrice( "C", inHourly*3, -1 );
O = TimeFrameGetPrice( "O", inHourly*3);
}
else if (T_F == "4_Hrs") 
{
H_1 = TimeFrameGetPrice( "H", inHourly*4, -1 );
L_1 = TimeFrameGetPrice( "L", inHourly*4, -1 );
C_1 = TimeFrameGetPrice( "C", inHourly*4, -1 );
O = TimeFrameGetPrice( "O", inHourly*4 );

}
else if (T_F == "EOD") 
{
H_1 = TimeFrameGetPrice( "H", inDaily, 0 );
L_1 = TimeFrameGetPrice( "L", inDaily, 0 );
C_1 = TimeFrameGetPrice( "C", inDaily, 0 );
O = TimeFrameGetPrice( "O", inDaily );

}
else if (T_F == "Weekly") 
{
H_1 = TimeFrameGetPrice( "H", inWeekly, -1 );
L_1 = TimeFrameGetPrice( "L", inWeekly, -1 );
C_1 = TimeFrameGetPrice( "C", inWeekly, -1 );
O = TimeFrameGetPrice( "O", inWeekly );
}
else if (T_F == "Monthly") 
{
H_1 = TimeFrameGetPrice( "H", inMonthly, -1 );
L_1 = TimeFrameGetPrice( "L", inMonthly, -1 );
C_1 = TimeFrameGetPrice( "C", inMonthly, -1 );
O = TimeFrameGetPrice( "O", inMonthly );
}

// To calculate the Pivot Levels 

R = H_1 - L_1; // Range
_N(Pivot =ParamList("Pivot Type ", "Classical|Woodies|Fibonacci|WF"));

if (Pivot =="Classical" )
{
PP = (H_1 + L_1 + C_1) / 3;
r1 = (2 * PP) - L_1 ;
s1 = (2 * PP) - H_1 ;
r2 = PP - s1 + r1;
s2 = PP - (r1 - s1) ;
r3 = 2 * (PP - L_1) + H_1 ;
s3 = L_1 - (2 * (H_1 - PP));
r4 = Null;
s4 = Null;
}
else if(Pivot =="Woodies" )
{
PP = (H_1 + L_1 + C_1 + O) / 4;
r1 = (2 * PP) - L_1;
r2 = PP + R;
r3 = H_1 + 2 * (PP - L_1);
r4 = r3 + R;
s1 = (2 * PP) - H_1;
s2 = PP - R;
s3 = L_1 - 2 * (H_1 - PP);
s4 = S3 - R;
}

else if(Pivot =="Fibonacci" )
{
PP = (H_1 + L_1 + C_1) / 3;
r3 = PP + 1.000 * R;
r2 = PP + 0.618 * R;
r1 = PP + 0.382 * R; 
s1 = PP - 0.382 * R; 
s2 = PP - 0.618 * R; 
s3 = PP - 1.000 * R;
r4 = Null;
s4 = Null;
}
else if (Pivot == "WF")
{
PP = (H_1 + L_1 + O + O) / 4;
s1 = PP - (R * 0.38);
s2 = PP - (R * 0.62);
s3 = PP - (R * 1.272);
r1 = PP + (R * 0.38);
r2 = PP + (R * 0.62);
r3 = PP + (R * 1.272);
r4 = Null;
s4 = Null;
}

//Defining TF on charts
procedure AddT_fParam(defaultvalue)
{
global T_F;
T_F = ParamList("Time Frame", List = "iDay|Hourly|2_Hrs|3_Hrs|4_Hrs|EOD|Weekly|Monthly" , defaultvalue);

if(T_F == "iDay") T_F = inDaily; 
else if(T_F == "Hourly")	T_F = inHourly;
else if(T_F == "2_Hrs")	T_F = inHourly*2; 
else if(T_F == "3_Hrs")	T_F = inHourly*3;
else if(T_F == "4_Hrs")	T_F = inHourly*4; 
else if(T_F == "EOD") T_F = inDaily; 
else if(T_F == "Weekly") T_F = inWeekly; 
else if(T_F == "Montly") T_F = inMonthly; 
}

//	Plot Pivot Levels in the charts

Plot (PP,"PP",colorViolet,styleDots,styleThick,1);
Plot (r1,"R1",colorDarkRed,styleLine,styleThick,1);
Plot (r2,"R2",colorDarkRed,styleLine,styleThick,1);
Plot (r3,"R3",colorDarkRed,styleLine,styleThick,1);
Plot (s1,"S1",colorDarkGreen,styleLine,styleThick,1);
Plot (s2,"S2",colorDarkGreen,styleLine,styleThick,1);
Plot (s3,"S3",colorDarkGreen,styleLine,styleThick,1);
Plot (r4,"R4",colorDarkRed,styleLine,styleThick,1);
Plot (s4,"S4",colorDarkGreen,styleLine,styleThick,1);


//	Add Pivot levels on charts as text
Title = Title + EncodeColor(colorDarkTeal)+
"\n,Pivot T_F = "+T_F + " \n " +
EncodeColor(colorRed)+"R4 = "+ r4 +"\n"+
EncodeColor(colorRed)+"R3 = "+ r3 +"\n"+
EncodeColor(colorRed)+"R2 = "+ r2 + "\n"+
EncodeColor(colorRed)+"R1 = "+ r1 + "\n"+ "\n"+
EncodeColor(colorViolet)+"PP = "+ PP + "\n"+ "\n" +
EncodeColor(colorGreen)+"S1 = "+ s1 + "\n"+
EncodeColor(colorGreen)+"S2 = "+ s2 + "\n"+
EncodeColor(colorGreen)+"S3 = "+ s3 + "\n"+
EncodeColor(colorGreen)+"S4 = "+ s4 + " \n" ;

_SECTION_END ();
_SECTION_END();
Try now

But one thing is for sure
You have not posted the afl for which you have posted the image.
 
Last edited:

a1b1trader

Well-Known Member
thanks you @a1b1trader

but is it right ploting of indicator ? is it not supposed to be plotted in straight lines ? it doesn't feel right
It seems you have zoomed in the chart
Just zoom out the chart and I think, it should plot correctly
If not, then sorry I dont have a solution for this.

BTW, In my ami, it is plotting correctly and zoom in zoom out make no difference.
 

a1b1trader

Well-Known Member
Hi toocool

Just check the plotting of chart in other time frames. (1/5/15/30 mins)
As for me, it is similar to that of yours, in daily chart.
 


thanks you @a1b1trader

but is it right ploting of indicator ? is it not supposed to be plotted in straight lines ? it doesn't feel right
It does plot straight lines if using intra-day data although that AFL is badly coded!

Set to iDay in parameters! You want pivots of day not of hour.
 
Last edited:

Similar threads