PureBytes Links
Trading Reference Links
|
Thank you Graham for Renko chart code. Its interesting to see how to filter
data in more ways (Kagi,Renko,PF etc). Its not so important does it plots
similar to other charting packages. The differences could be purely because
of data loss, data errors etc.
Sincerely
Drazen
----- Original Message -----
From: "wavemechanic" <wd78@xxxxxxxxxxxx>
To: "AmiBroker, User" <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, August 14, 2004 7:27 AM
Subject: RE: [amibroker] Renko chart code revC
> Graham:
>
> My bad. Ver D does plot OK. I failed to copy a line or two when I
transferred it from the e-mail to AB. However, it is still not duplicating
Metastock (see Files section). If Metastock is OK then most likely the
logic/code needs some tweaking. You have produced a good basis for that
effort, if someone wants to use this technique.
>
> Bill
>
> ---------- Original Message --------
> From: "Graham" <gkavanagh@xxxx>
> Date: Fri Aug 13, 2004 7:25 pm
> Subject: RE: [amibroker] Renko chart code revC
>
>
> ADVERTISEMENT
>
>
> Ver D plots fine for me. Sorry I allocated just a few hours to get
this plot
> done. I will have to leave it to someone else to iron out the
wrinkles. I
> need to be able to have a plot that I can compare on screen as I
make
> adjustments, but unfortunately I do not have this. Hopefully someone
else
> with more knowledge of the renko charts and can see where my formula
is
> astray can help.
>
> Cheers,
> Graham
> http://e-wire.net.au/~eb_kavan/
>
> -----Original Message-----
> From: wavemechanic [mailto:wd78@x...]
> Sent: Friday, August 13, 2004 10:12 PM
> To: AmiBroker, User
> Subject: Re: [amibroker] Renko chart code revC
>
> Graham:
>
> I cannot get ver D to plot, but ver C is OK. However, I still see
the same
> problem as the charts that I sent you relative to Metastock.
Specifically,
> using a box (brick) size of 144 with DJI the Metastock and ver C are
> different (count the red and green (white) boxes). I will put these
charts
> into the Files section so that you can see them. It looks like you
are
> close, but for some reason still not duplicating Metastock.
>
> Bill
> ----- Original Message -----
> From: Graham
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Friday, August 13, 2004 2:41 AM
> Subject: RE: [amibroker] Renko chart code revC
>
>
> Bill you will find the same with what I have produced. Bricks DO NOT
> correspond to actual dates on the normal price chart, and if you
look at
> the
> 3rd line of my chart it says it there. " // Custom Indicator, date
axis
> does not apply "
> I think I have a better representation of it now in revD below. I
will say
> again I have no actual renko chart to compare what I am doing with.
> Examples
> are fine and I followed the logic of it from sites like the equis,
but it
> is
> hard not to be able to compare as I go. Plus I have never used the
renko
> chart, so I have no "feel" for how it is supposed to look.
> You will need to decide how you size the bricks yourselves.
>
> Here is revD
>
>
> Cheers,
> Graham
> http://e-wire.net.au/~eb_kavan/
>
> // Renko Chart
> // Graham Kavanagh 13 Aug 2004 ver D
> // Custom Indicator, date axis does not apply
>
> SetBarsRequired(10000,10000);
> // Brick size is dependant on what you want, if too small will not
produce
> a
> chart due to insufficient x-axis bars
> //Brick = LastValue( ATR(100) );
> Brick = LastValue( Max(0.02*C, 0.02) );
> reverse = 2;
>
> // Convert the closing price to rising and falling rounded bricks
> CF = ceil(C/Brick);
> CR = floor(C/Brick);
>
> // initialize first element
> j = 0;
> RKC[j] = CF[0];
> RKO[j] = CF[0] + 1;
>
> down[j] = 1; // By default the first bar is a down bar.
> up[j] = 0;
>
> // Loop to produce the Renko values in number of bricks
>
> for( i=1; i<BarCount-1; i++ )
> {
> if( CF[i] <= RKC[j] - 1 && down[j] ) // Continue down
> {
> num = RKC[j] - CF[i];
> for( x=1; x<=num; x++ )
> {
> j++;
> up[j] = 0;
> down[j] = 1;
> RKC[j] = RKC[j-1] - 1;
> RKO[j] = RKC[j] + 1;
> }
> }
> else
> {
> if( CR[i] >= RKC[j] + Reverse && down[j] ) // Change down
> to up
> {
> num = CR[i] - RKC[j];
> j++;
> up[j] = 1;
> down[j] = 0;
> RKC[j] = RKC[j-1] + 2;
> RKO[j] = RKC[j] - 1;
> for( x=2; x<=num; x++ )
> {
> j++;
> up[j] = 1;
> down[j] = 0;
> RKC[j] = RKC[j-1] + 1;
> RKO[j] = RKC[j] - 1;
> }
> }
> else
> {
> if( CR[i] >= RKC[j] + 1 && up[j] ) // Continue Up
> {
> num = CR[i] - RKC[j];
> for( x=1; x<=num; x++ )
> {
> j++;
> Up[j] = 1;
> Down[j] = 0;
> RKC[j] = RKC[j-1] + 1;
> RKO[j] = RKC[j] - 1;
> }
> }
> else
> {
> if( CF[i] <= RKC[j] - Reverse && up[j] ) //
> Change up to down
> {
> num = RKC[j] - CF[i];
> j++;
> Up[j] = 0;
> Down[j] = 1;
> RKC[j] = RKC[j-1] - 2;
> RKO[j] = RKC[j] + 1;
> for( x=2; x<=num; x++ )
> {
> j++;
> up[j] = 0;
> down[j] = 1;
> RKC[j] = RKC[j-1] - 1;
> RKO[j] = RKC[j] + 1;
> }
> }
> }
> }
> }
> }
>
>
> // move the chart to right end of chart space, ie last brick on last
bar
> position
> delta = BarCount-1 - j;
>
> RKC = Ref( RKC, -delta );
> RKO = Ref( RKO, -delta );
>
> Up = Ref( Up, -delta );
> Down = Ref( Down, -delta );
>
>
>
> rC = RKC * Brick;
> rO = RC - (Up-down)*Brick;
> rH = Max(rC,rO);
> rL = Min(rC,rO);
>
> // plot chart
> PlotOHLC( rO, rH, rL, rC, "Brick size = " + brick + "Renko Price ="
,
> colorBlack, styleCandle);
> GraphXSpace=5;
>
> Title = "{{NAME}} - {{INTERVAL}} {{DATE}} - Renko Chart : Last Value
= " +
> RC + ", Brick Size = " + Brick;
>
>
>
>
> 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
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> 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
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> 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
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/
|