Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

SRI (Super Renko Indicator) for Amibroker (AFL)

Rating:
5 / 5 (Votes 2)
Tags:
amibroker, price chart

A type of chart, developed by the Japanese, that is only concerned with price movement; time and volume are not included. It is thought to be named for the Japanese word for bricks, “renga”. A renko chart is constructed by placing a brick in the next column once the price surpasses the top or bottom of the previous brick by a predefined amount. White bricks are used when the direction of the trend is up, while black bricks are used when the trend is down. This type of chart is very effective for traders to identify key support/resistance levels. Transaction signals are generated when the direction of the trend changes and the bricks alternate colors.

Note on some stock this indicator show the subscript out of range error

Screenshots

Similar Indicators / Formulas

Price all style
Submitted by bobylam about 14 years ago
Intraday High Low Range
Submitted by mrugen over 14 years ago
Heikin-Ashi (Koma-Ashi) with Moving Average Type
Submitted by brevco almost 15 years ago
N line break
Submitted by empottasch about 14 years ago
Dhiraj System
Submitted by mariapparaja1 over 14 years ago

Indicator / Formula

Copy & Paste Friendly
  SetBarsRequired(100000,100000);
//------------------------------------------------------------------+
// Block 1                                                          |
//------------------------------------------------------------------+
  VR=ParamToggle("View Renko","Bricks|Lines/Bars",0);                
  FV=Param("Initial size volatility",0.5,0.001,50,0.001);            
  MV=Param("Method calculation volatility",0,0,2,1);                 
  PeriodVol=Param("Period calculation volatility",14,2,100,1);       
  Multiplier=Param("Multiplier volatility",1,0.1,10,0.1);           
  MR=ParamToggle("Method Renko","floating|fixed",1);         
  SG=ParamToggle("Show gap","No|Yes",1);                     
  CG=ParamColor("Colour show gap",11);                     
  MaxBS=Param("Maximum size brick",0,0,10,0.1);             
  MinBS=Param("Minimum size brick",0,0,10,0.1);              
  RenkoUp=ParamColor("Colour Renko upwards",colorBlack);      
  RenkoDown=ParamColor("Colour Renko downwards",colorBlack);
  SB=ParamStyle("View bars",defaultval=styleCandle,mask=maskPrice);    
  color3=ParamColor("Colour bars",colorBlack);
  History=Param("History size",5000,2,BarCount-1,1);              
//------------------------------------------------------------------+
// Block 2                                                          |
//------------------------------------------------------------------+
  i=Max(BarCount-1-History,PeriodVol+1);                             
  r=j=0;                                                             
  direction=0;                                                       
  iGapUp=iGapDown=0; 
  rOpen[0]=rHigh[0]=rLow[0]=rClose[0]=jUp=jDown=Open[i];             
//------------------------------------------------------------------- 
  switch(MV)
    {
     case 0: Volatility=FV; break;                                   
     case 1: Volatility=ATR(PeriodVol)*Multiplier; break;             
     case 2: Volatility=StDev(Open,PeriodVol)*Multiplier; break;     
    }         
  BrickSize=Volatility[i-1];                                         
//-------------------------------------------------------------------+
// Block 3                                                           |
//-------------------------------------------------------------------+
  while(i<=BarCount-1)
    { 
     if(SG==1)
       {
        if(High[i-1]<Low[i])
          {
           iGapUp[i]=1;                                       
          }
          else
          {
           if(Low[i-1]>High[i])
             {
              iGapDown[i]=1;
             }
          }
       } 
//------------------------------------------------------------------- 
     if(MR==0)  
       {
        BrickSize=Volatility[i-1];
        if(MaxBS>0) {BrickSize=Min(MaxBS,BrickSize);}                 
        if(MinBS>0) {BrickSize=Max(MinBS,BrickSize);}                
       } 
//------------------------------------------------------------------+
// Block 4                                                          |
//------------------------------------------------------------------+
     if(direction==0)                                                 
       {                                                   
        if(Open[i]-rClose[r]>BrickSize)                              
          {                                                 
           rClose[r]=rOpen[r]+BrickSize;
           rHigh[r]=rClose[r];
           direction=1;
//------------------------------------------------------------------- 
           BrickSize=Volatility[i];
           if(MaxBS>0) {BrickSize=Min(MaxBS,BrickSize);}                
           if(MinBS>0) {BrickSize=Max(MinBS,BrickSize);}
//------------------------------------------------------------------- 
           if(iGapUp[i]==1|iGapDown[i]==1)                           
             {
              color[r]=CG;                                           
             }
             else
             {
              color[r]=RenkoUp;                                      
             }
           continue;                                                                                       
          }                                                           
//------------------------------------------------------------------- 
          else
          {
           if(rClose[r]-Open[i]>BrickSize)                             
             {
              rClose[r]=rOpen[r]-BrickSize;
              rLow[r]=rClose[r];
              direction=2;
//------------------------------------------------------------------- 
              BrickSize=Volatility[i];
              if(MaxBS>0) {BrickSize=Min(MaxBS,BrickSize);}                
              if(MinBS>0) {BrickSize=Max(MinBS,BrickSize);}
//------------------------------------------------------------------- 
              if(iGapUp[i]==1|iGapDown[i]==1)
                {
                 color[r]=CG;                                        
                }
                else
                {
                 color[r]=RenkoDown;                                         
                }
              continue;                                         
             }
          }
       }
//------------------------------------------------------------------+
// Block 5                                                          |
//------------------------------------------------------------------+
       else                                                          
       { 
        if(direction==1)                                             
          {
           if(rOpen[r]-Open[i]>BrickSize)                                                                     
             {
              r++;
              rOpen[r]=rOpen[r-1];
              rHigh[r]=rOpen[r];
              rClose[r]=rOpen[r]-BrickSize;
              rLow[r]=rClose[r];
              direction=2;
//------------------------------------------------------------------- 
              BrickSize=Volatility[i];
              if(MaxBS>0) {BrickSize=Min(MaxBS,BrickSize);}                
              if(MinBS>0) {BrickSize=Max(MinBS,BrickSize);}
//------------------------------------------------------------------- 
              if(iGapUp[i]==1|iGapDown[i]==1)
                {
                 color[r]=CG;                                        
                }
                else
                {
                 color[r]=RenkoDown;                                         
                }
              continue;                                                   
             }
//------------------------------------------------------------------- 
             else
             {
              while(Open[i]-rClose[r]>BrickSize)        
                {
                 r++;
                 rOpen[r]=rClose[r-1];
                 rLow[r]=rOpen[r];
                 rClose[r]=rOpen[r]+BrickSize;
                 rHigh[r]=rClose[r];
//------------------------------------------------------------------- 
                 BrickSize=Volatility[i];
                 if(MaxBS>0) {BrickSize=Min(MaxBS,BrickSize);}                
                 if(MinBS>0) {BrickSize=Max(MinBS,BrickSize);}
//------------------------------------------------------------------- 
                 if(iGapUp[i]==1|iGapDown[i]==1)
                   {
                    color[r]=CG;                                        
                   }
                   else
                   {
                    color[r]=RenkoUp;                                         
                   }
                }
             }
          }
//------------------------------------------------------------------+
// Block 6                                                          |
//------------------------------------------------------------------+
          else
          {
           if(direction==2)                                          
             {
              if(Open[i]-rOpen[r]>BrickSize)
                {
                 r++;
                 rOpen[r]=rOpen[r-1];
                 rLow[r]=rOpen[r];
                 rClose[r]=rOpen[r]+BrickSize;
                 rHigh[r]=rClose[r];
                 direction=1;
//------------------------------------------------------------------- 
                 BrickSize=Volatility[i];
                 if(MaxBS>0) {BrickSize=Min(MaxBS,BrickSize);}                
                 if(MinBS>0) {BrickSize=Max(MinBS,BrickSize);}
//------------------------------------------------------------------- 
                 if(iGapUp[i]==1|iGapDown[i]==1)
                   {
                    color[r]=CG;                                        
                   }
                   else
                   {
                    color[r]=RenkoUp;                                         
                   }
                 continue;  
                }
//------------------------------------------------------------------- 
                else
                {
                 while(rClose[r]-Open[i]>BrickSize)                                                        
                   {
                    r++;
                    rOpen[r]=rClose[r-1];
                    rHigh[r]=rOpen[r];
                    rClose[r]=rOpen[r]-BrickSize;
                    rLow[r]=rClose[r];
//------------------------------------------------------------------- 
                    BrickSize=Volatility[i];
                    if(MaxBS>0) {BrickSize=Min(MaxBS,BrickSize);}                
                    if(MinBS>0) {BrickSize=Max(MinBS,BrickSize);}
//-------------------------------------------------------------------
                    if(iGapUp[i]==1|iGapDown[i]==1)
                      {
                       color[r]=CG;                                        
                      }
                      else
                      {
                       color[r]=RenkoDown;                                         
                      }
                    }
                }
             }
          }
       }                                                             
//------------------------------------------------------------------+
// Block 7                                                          |
//------------------------------------------------------------------+
     if(VR==1)                                                       
       {
        jOpen[j]=Open[i];
        jHigh[j]=High[i];
        jLow[j]=Low[i];
        jClose[j]=Close[i];
//-------------------------------------------------------------------
        if(direction==1)
          {
           jUp[j]=rClose[r];
           jDown[j]=rOpen[r];
           color2[j]=color[r];
          }
          else
          {
           if(direction==2)
             {
              jUp[j]=rOpen[r];
              jDown[j]=rClose[r];
              color2[j]=color[r];
             }
          }
        j++;
       }                                                                    
     i++;                                                                                         
    }                                                                
//------------------------------------------------------------------+
// Block 8                                                          |
//------------------------------------------------------------------+
  if(VR==1)                                                          
    {
     delta=BarCount-j;
     jOpen=Ref(jOpen,-delta);                                        
     jHigh=Ref(jHigh,-delta);                                        
     jLow=Ref(jLow,-delta);
     jClose=Ref(jClose,-delta);
     jUp=Ref(jUp,-delta);
     jDown=Ref(jDown,-delta);
     color2=Ref(color2,-delta);
     SetChartOptions(0,chartShowArrows|chartShowDates);
     _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
     PlotOHLC(jOpen,jHigh,jLow,jClose,"SRI",color3,SB);                       
     Plot(jUp,"Up",color2,styleThick);                                                 
     Plot(jDown,"Down",color2,styleThick); 
    }
//-------------------------------------------------------------------
    else                                                             
    {  
     delta=BarCount-1-r;                                              
     rOpen=Ref(rOpen,-delta);                                        
     rHigh=Ref(rHigh,-delta);                                        
     rLow=Ref(rLow,-delta);
     rClose=Ref(rClose,-delta);
     color=Ref(color,-delta);
     PlotOHLC(rOpen,rHigh,rLow,rClose,"SRI",color,styleCandle);      
    }
    



    

8 comments

1. arbind04

not workin error

2. administrator

Read the description i mentioned it there. Is it the same as that one?

3. walid

no its working just save and change the parameters

4. aplusads

what parameters need to changed

i am using amibroker 5.2

5. cnbondre

Dear,

aplusads,

I changed " Method calculation volatility ", to 1. from parameter window.

It is atleast showing graph!

But don"t know is it a right setting ?????

Will somebody explain it ?

cnb

6. worldastro

but how can use plese explain

7. sr114

actually SRI is working better but for scrip quote greater than 1000 the diplay is gone and range out os subscript error creeps.

how to rectify this error

8. pradip_kumar1

There is an error in Block # 5. How to fix. What parameters need to change. Pls suggest.

Leave Comment

Please login here to leave a comment.

Back