Need Buy/Sell Values for this AFL

KelvinHand

Well-Known Member
#12
Hi Kelvinhand,

can u suggest any other statement for my above question .. which will we be cause less problem .

Thanks in advance..

Go and stand in Mr. partha644 shoe and think the problem.
Don't assume he is using your AFL, ask him to lay it out.

Go through all the details with him, to see what went wrong.
then you can know how to cause less problem.


His statement can something send the text beyond the screen.


casoni point the arrow to the close price to ask you to enter.
The other point the arrow to the bar high/low for entry.
 
Last edited:

mastermind007

Well-Known Member
#14
What for this line is used
Thanks
SetBarsRequired FUNCTION set number of previous and future bars needed for script/DLL to properly execute. If your formula is pure AFL you don't need to use this function at all, as AmiBroker automatically calculates number of bars required for all its built-in functions. But if you are using script or a DLL you may need to use this function to make sure that your indicators are properly calculated in QuickAFL mode. Specifying -1 means no change. For example if you are using the script that calculates 100 bar moving average you may need to call SetBarsRequired( 100, 0 ); at the very beginning of your formula. Please note that in most cases it is not necessary (even if you are using script or DLL) because AmiBroker always provides at least 30 past data bars more than needed. Starting from AmiBroker version 5.20 you can use sbrAll (-2) constant to tell AmiBroker to use ALL available bars:
 
#15
_SECTION_BEGIN("MABIUTS");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

Buy=EMA(C,13)>EMA(EMA(C,13),9) AND Cross (C,Peak(C,5,1));
Sell=Cross (EMA(EMA(C,13),9),EMA(C,13));
MYcolor = IIf( EMA(C,13)>EMA(EMA(C,13),9) AND C>Peak(C,2,1), colorGreen, IIf(EMA(C,13)>EMA(EMA(C,13),9) AND C<Peak(C,2,1),colorBlue, colorOrange ));

PlotOHLC( Open, High, Low, Close, "", Mycolor, styleBar );

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );

GraphXSpace = 5;
dist = 1.5*ATR(10);

for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist, colorGreen );
if( Sell ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist, colorRed);
 

Similar threads