Discussion about Renko : (from Varun's thread)

As i myself asked for renko afl few hours before now see i'm sharing :p.......Don't know how it works in live

Code:
function FillRun( dir, num, changedir )
{
   global i, j, modified, RKC, RKO, RKD, RKH, RKL;

   for ( x = 1; x <= num AND j < BarCount - 1; x++ )
   {
     j++;

     extra = ( changedir AND x == 1 ) * dir;

     RKC[ j ] = RKC[ j - 1 ] + dir + extra;
     RKO[ j ] = RKC[ j - 1 ] + IIf( modified, 0, extra );
    
     RKH[ j ] = High[ i - 1 ];
     RKL[ j ] = Low[ i - 1 ];
   }
}

SetBarsRequired( sbrAll, sbrAll );
Brick = Param( "Brick Size",5, 1, 20, 1 );
reverser = Param( "Reverser Size",5, 1, 20, 1 );
modified = ParamToggle( "Modified", "No|Yes", 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;
RKD = 0;
RKH = 0;
RKL = 0;
RestorePriceArrays();

dir = -1; // 1 is up, -1 is down

// Loop to produce the Renko values in number of bricks

for ( i = 1; i < BarCount - 1; i++ )
{
 if ( j >= BarCount ) break; // no more room -> finish

 if ( CF[i] <= RKC[j] - 1 AND dir < 0 ) // Continue down
 {
    num = RKC[j] - CF[i];
    FillRun( dir, num, False );
 }
 else
 if ( CR[i] >= RKC[j] + reverser AND dir < 0 ) // Change down to up
 {
    num = CR[i] - RKC[j];
    dir = 1;
    FillRun( dir, num, True );
 }
 else
 if ( CR[i] >= RKC[j] + 1 AND dir > 0 ) // Continue Up
 {
    num = CR[i] - RKC[j];
    FillRun( dir, num, False );
 }
 else
 if ( CF[i] <= RKC[j] - reverser AND dir > 0 ) // Change up to down
 {
    num = RKC[j] - CF[i];
    dir = -1;
    FillRun( dir, num, True );
 }
}

// 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 );
RKD = Ref( RKD, -delta );
RKH = Ref( RKH, -delta );
RKL = Ref( RKL, -delta );

C = RKC * Brick;
O = RKO * Brick;
H = IIf( modified, RKH, Max( C, O ) );
L = IIf( modified, RKL, Min( C, O ) );

Plot( C, "", IIf( C > O, colorGreen, colorRed ), styleCandle );

xnum = floor( RKD / 100 );
XChange = IIf( xnum != Ref( xnum, -1 ), 1, Null );

Plot( XChange, "", colorGrey50, styleHistogram | styleOwnScale, 0, 1 );


Title = Name()  + " - Renko Chart : Last Value = " + RKC * Brick + " H: " + RKH + " L: " + RKL + ", Brick Size = " + Brick;

GraphXSpace = 5;

_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
 

doss186

Well-Known Member
It seems Nickel is breaking out for bull run intraday. As we can see the trading range achieved so far is only 9.7 and the average trading range is around 24, we can expect the scrip to move up by another 14 points or expect the target @934
 

Attachments

doss186

Well-Known Member
It seems Nickel is breaking out for bull run intraday. As we can see the trading range achieved so far is only 9.7 and the average trading range is around 24, we can expect the scrip to move up by another 14 points or expect the target @934
wrong trade short @917
 

doss186

Well-Known Member
Ok friends lets have some fun on this quiz! what values are the non repainting in trading? Is it close, High, Low or Opening. If we can find the right answer, we can win 70% of the trade.
 

Similar threads