Hi friends
I have a small problem with renko chart.
Often renko chart comes blank in Amibroker.
-----------------------------------------------------------------
ERROR 10
Array subscript out of range.
you must not access array elements outside 0 .. (Barcount-1) range.
------------------------------------------------------------------
Fed up with this problem,new traders stop using RENKO chart.
The idea here is find a small fix and get rid of the problem using addition of a small code line.
It may look a cilly thing but it saves big hassels and makes life easier so that one can go on testing renko chart if it suits or not.
I dont mind finding right brick size by trial and error when I am not trading.
Once I find right bricksize,then I like to put the code line that makes the afl to create renko chart with specified brick size setting the moment i select that symbol.
The code line for single symbol is as follows.
IIf( "ticker"== ParamStr(" ticker","NIFTY14JAN6200CE"),brick =2,0);
IIf( "ticker" == ParamStr(" ticker","SILVERM14FEBFUT"),brick =20,0);
IIf( "Ticker"== ParamStr( " ticker", "LT"),brick =2.4,0); //uses 2.4 as brick size
===========================
I can use only one code line at a time. it works for that sym,bol or any symbol having sama range of brick size setting.
When symbol changes from a stock having brick=2 to a commodity having brick=20,I like the code line to make a smooth transition to deliver new chart.
without manual intereference during trading hours.
suppose i have 10 favourite symbols and their specific brick size values, how can I write these individual code lines together in one line?
Something like
=======================================================
chart afl here
========================
Hope somebody can help link the code lines for single symbols together to get a trouble free renko chart as we change symbol. we need to use comma or OR etc for linking the code lines of 10 symbols into one code line.
------------------------
why Renko chart? becoz it minimises noise and points out trend clearly.
thanks
ford7k
I have a small problem with renko chart.
Often renko chart comes blank in Amibroker.
-----------------------------------------------------------------
ERROR 10
Array subscript out of range.
you must not access array elements outside 0 .. (Barcount-1) range.
------------------------------------------------------------------
Fed up with this problem,new traders stop using RENKO chart.
The idea here is find a small fix and get rid of the problem using addition of a small code line.
It may look a cilly thing but it saves big hassels and makes life easier so that one can go on testing renko chart if it suits or not.
I dont mind finding right brick size by trial and error when I am not trading.
Once I find right bricksize,then I like to put the code line that makes the afl to create renko chart with specified brick size setting the moment i select that symbol.
The code line for single symbol is as follows.
IIf( "ticker"== ParamStr(" ticker","NIFTY14JAN6200CE"),brick =2,0);
IIf( "ticker" == ParamStr(" ticker","SILVERM14FEBFUT"),brick =20,0);
IIf( "Ticker"== ParamStr( " ticker", "LT"),brick =2.4,0); //uses 2.4 as brick size
===========================
I can use only one code line at a time. it works for that sym,bol or any symbol having sama range of brick size setting.
When symbol changes from a stock having brick=2 to a commodity having brick=20,I like the code line to make a smooth transition to deliver new chart.
without manual intereference during trading hours.
suppose i have 10 favourite symbols and their specific brick size values, how can I write these individual code lines together in one line?
Something like
=======================================================
chart afl here
HTML:
//Brick = LastValue( Max(0.02*C, 0.05) );//WORKS GOOD
//Brick = Param( "Brick Size", 0.1, 0.01, 100.00, 0.01 );
reverse = 2;
IIf( "ticker" == ParamStr(" ticker","SILVERM14FEBFUT"),brick =20,0);
//IIf( "Ticker"== "NIFTY14JANFUT",Brick ==10,0),
IIf( "ticker"== ParamStr(" ticker","NIFTY14JAN6200CE"),Brick ==2,0);
//IIf( "ticker"==ParamStr( " ticker","NIFTY14JAN6400PE"),Brick ==2,0) ,
//IIf( "Ticker"== ParamStr( " ticker", "LT",Brick==2.4,0);
// 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;// + (Up-down)*Brick/2;
rO = RC - (Up-down)*Brick;
rH = Max(rC,rO);
rL = Min(rC,rO);
*/
C = RKC * Brick;// + (Up-down)*Brick/2;
O = C - (Up-down)*Brick;
H = Max(C,O);
L = Min(C,O);
Plot( C, "", colorGrey50,styleCandle);
// plot chart
//plotOHLC( rO, rH, rL, rC, "Renko Price " , colorBlack, styleCandle);
GraphXSpace=5;
Title = Name() + " - {{INTERVAL}} {{DATE}} - Renko Chart : Last Value = " + RKC * Brick + ", Brick Size = " + Brick;
Hope somebody can help link the code lines for single symbols together to get a trouble free renko chart as we change symbol. we need to use comma or OR etc for linking the code lines of 10 symbols into one code line.
------------------------
why Renko chart? becoz it minimises noise and points out trend clearly.
thanks
ford7k
Last edited: