[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Help for Intraday indicator afl



PureBytes Links

Trading Reference Links

hi,
I need help for writing afl.
i need buy signal in intraday chart when price closes abv. previous
day high and once it occurs then next buy level would be highest
high value after last buy and so on.
I started to write this as below

H1= TimeFrameGetPrice( "H", inDaily, -1 );
L1=TimeFrameGetPrice( "L", inDaily, -1 );
C1=TimeFrameGetPrice( "C", inDaily, -1 );

up= H1;
down=L1;
B1=Cross(C,up) AND TimeNum()>=101500;
S1=Cross(down,C) AND TimeNum()>=101500;

//timenum()is used for avoiding buy sell levels before 10.15 AM

// this part is for calculating next levels
up1=HighestSince(B1,H);
down1=LowestSince(S1,L);

B2=Cross(C,up1) AND TimeNum()>=101500;
S2=Cross(down1,C) AND TimeNum()>=101500;

//Generating Signals

Buy=B1 OR B2;
Sell=S1 OR S2;
Buy = ExRemSpan( Buy, 3 );
Sell = ExRemSpan( Sell,3 );

// For Exploration and Scanning and Arrow Display
Signalshape=Buy*shapeUpArrow + Sell*shapeDownArrow;
pos = 1*ATR(50);
pos1 = 2.5*ATR(50);
PlotShapes( Signalshape, IIf( Buy, colorGreen, colorRed ),0, IIf(
Buy, Low-pos, High+pos ),0 );
//PlotShapes((shapeSmallCircle *Buy ,colorBrightGreen,0,L,5)

for( i = 0; i < BarCount; i++ ) {
if( Buy[i] ) PlotText( "@ Buy : " +"\n"+ up[i], i, Low[i] -
pos1[i], colorGreen );
if( Sell[i] ) PlotText( "@ Sell : " +"\n"+ down[i], i, H[i] +
pos1[i], colorRed );
};

====================================================================
But it is not working properly. Every time its putting arrow after
price crosses the previous high.
I think I have to arrest up and down variables after first buy sell
signal of the particular day and for the next time onwards teh
values would be new high and low.

Please help
Debdulal
Kolkata
India



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/