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

[amibroker] Re: visualising rectangles



PureBytes Links

Trading Reference Links


If you dont mind can u also share its significance and application

Regards
--- In amibroker@xxxxxxxxxxxxxxx, "ed nl" <ed2000nl@xxxx> wrote:
> /*
> 
> Rectangle Development
> 
> after: "Professional Stock Trading", M. Conway / A. Behle, 2003, 
pages 106, 107, 108
> 
> Edward Pottasch, nov 2004
> 
> */
> 
> RectangleLength = 8;
> RangeLength = RectangleLength * 3;
> RangeFactor = 1.5;
> RangeRatioLimit = 0.3;
> AtrPeriod = RangeLength;
> 
> // rectangle
> hg = SelectedValue(HHV(H,RectangleLength));
> lw = SelectedValue(LLV(L,RectangleLength));
> HeightRectangle = hg - lw;
> 
> // preceding range
> hgp = SelectedValue(Ref(HHV(H,RangeLength),RectangleLength * -1));
> lwp = SelectedValue(Ref(LLV(L,RangeLength),RectangleLength * -1));
> HeightRangeLength = hgp - lwp;
> 
> // aspect ratio
> ar = HeightRectangle / HeightRangeLength;
> 
> // ATR
> at = SelectedValue(ATR(AtrPeriod));
> 
> // decide if it is a rectangle
> yon = IIF(ar < RangeRatioLimit AND HeightRectangle < at * 
RangeFactor, 1, 0);
> 
> // visualize the rectangle
> x = Cum(1);
> lastx = LastValue(x); 
> selv = SelectedValue(x);
> 
> // the rectangle
> xx = IIF(x > selv - RectangleLength AND x <= selv, x - (selv - 
RectangleLength),null);
> yy_l = lw + 0.0 * xx;
> yy_h = hg + 0.0 * xx;
> Plot(yy_l, "", IIF(yon,colorBrightGreen,colorRed), IIF(yon,4,1));
> Plot(yy_h, "", IIF(yon,colorBrightGreen,colorRed), IIF(yon,4,1));
> 
> // preceding range
> xx = IIF(x > selv - RectangleLength - RangeLength AND x <= selv - 
RectangleLength, x - (selv - RectangleLength - RangeLength),null);
> yy_l = lwp + 0.0 * xx;
> yy_h = hgp + 0.0 * xx;
> Plot(yy_l, "", colorWhite, 1);
> Plot(yy_h, "", colorWhite, 1);
> 
> Plot(C,"",colorwhite,64);
> 
> "Aspect Ratio: " + writeval(ar);
> "Height rectangle: " + writeval(HeightRectangle);
> "ATR * Rangefactor: " + writeval(at * RangeFactor);
> "Rectangle detected: " + writeif(yon," TRUE"," FALSE");
> 
> [Non-text portions of this message have been removed]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/