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

[amibroker] Need help with a little AFL code...



PureBytes Links

Trading Reference Links

Hey Guys,

I am trying to modify an NRx formula. Please find the formula at the bottom of my message.

The formula looks at the 'LLV' for the high and low range (rang) in 7 of the most recent bars on a chart.

The problem with the RT data is that sometimes it shows data with the same O, H, L, C and, therefore, results in a zero range value usually around the end of a trading day). This upsets the whole system, as it identifies it as the narrow range bar we've been looking for.

What I need is a small snippet which would tell the system to ignore ranges with a value equaling zero.

Can someone please help?

Thanks,
Younus





_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C=
%g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue(
ROC( C, 1 )) ));
PriceStyle = GetPriceStyle();
PriceStyleOpt = ParamStyle("Style") | PriceStyle;

if (PriceStyle==styleCandle)
   Plot( C, "", colorBlack,  PriceStyleOpt); 
else
   Plot( C, "", IIf( Close >= Ref(C, -1), colorBlue, colorRed ),
PriceStyleOpt);


NRx = ParamList("4 or 7 Days Narrow Range", "All|NR4|NR7");

rang=High-Low;

if (NRx=="NR4" OR NRx=="All")
{
   nr4=IIf(rang==LLV(rang,4),shapeDigit4,shapeNone);
   PlotShapes(nr4,colorRed,0,L);
}

if (NRx=="NR7" OR NRx=="All")
{
   nr7=IIf(rang==LLV(rang,7),shapeDigit7+shapePositionAbove,shapeNone);
   PlotShapes(nr7,colorGreen,0,H);

}

InsideBar = Inside() OR (Ref(H, -1)==H AND Ref(L, -1)<L) OR (Ref(H, -1)>H AND
Ref(L, -1)==L);
nr1=IIf(InsideBar, shapeDigit1,shapeNone);

PlotShapes(nr1,colorBrown,0,(L+H)/2);
GraphXSpace = 5;



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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/