Renko

 
Hi Guys,

Is there any way to implement Renko charts in MetaTrader 4 ?

Cheers
Martin
 
Also I would like to see Point Break, Kagi and Momentum bars as chart types

Thanks
EK
 
sorry. no kagi, no renko. may be in custom indicators like Heiken Ashi
 
Hi Slawa,

Unfortunately you have to be pretty clever coding-wise to be able to put together a custom indicator. This knowledge I don't have.

I've seen many people ask for Renko over at the Yahoo forums and no-one has even replied - I suspect due to the complexity of such an indicator.

Renko is used more and more in today's charting. FXSol, XTick and a few others have it built in. I personally love the MetaTrader platform which is why I'm asking here for help and consideration. I appreciate you guys are all probably flat out with your own priorities but would respectfully request you at least investigate Renko as an inclusion to your development priorities.

Further, what's the chance of also including a 3 min chart option? (I know I'm asking a lot but as a user I'm giving feedback to make a great product even better for other users)

Best Regards
Martin
 
So Slawa, what do you think?
Is it at all possible to get Renko happening as a standard MT4 chart type ?

If it is an indicator, how do you remove the current chart candles from the chart so only a Renko would be visible?

Come on, it would only take you clever guys just a tiny little while to code it up :)

Cheers
Martin
 
If it's any help, the following is some Renko code for eSignal. Does this help in getting this charting method into MT4 ?
I appreciate any efforts here.

/********************************************************************
Title:		Renko Script for eSignal 7.x
By:         Chris D. Kryza (Divergence Software, Inc.)
Email:      c.kryza@gte.net, ckryza@sr-analyst.com
Web:		http://www.sr-analyst.com
Incept:     10/16/2004
Version:    1.1.0

=====================================================================
Fix History:

12/13/2004 -	Fixed Renko calculation and added plot of next up/down
1.1.0			block levels.

10/16/2004 -   	Initial Release
1.0.0

=====================================================================
Project Description:   

EFS implementation of a Renko Chart.


Dislaimer: For educational purposes only! Obviously, no guarantees 
whatsoever and use at your own risk.

**********************************************************************/


//External Variables
var grID                = 0;
var nBarCounter			= 0;
var nBarsSince			= 0;
var nBlock				= null;
var nStatus				= 0;				//long or short
var nHighLevel			= null;
var nLowLevel			= null;
var nConsecUp			= 0;
var nConsecDn			= 0;
var aFPArray			= new Array();
var bInitialized		= false;


//== PreMain function required by eSignal to set things up
function preMain() {
var x;

    setPriceStudy(true);
    setStudyTitle("Renko");
    setCursorLabelName("High", 0);
    setCursorLabelName("Low", 1);
    setCursorLabelName("Consec. Blocks", 2 );
    setDefaultBarFgColor( Color.blue,   0 );
    setDefaultBarFgColor( Color.red,    1 );
    setDefaultBarFgColor( Color.purple, 2 );
    setDefaultBarThickness( 2, 0 );
    setDefaultBarThickness( 2, 1 );    
    setPlotType( PLOTTYPE_FLATLINES, 0 );
    setPlotType( PLOTTYPE_FLATLINES, 1 );    
    setShowTitleParameters( false );

    grID = 0;
    
    //initialize formula parameters
	x=0; 
	aFPArray[x] = new FunctionParameter( "fBlockSize", FunctionParameter.NUMBER);
	with( aFPArray[x] ) {
		setName( "Block Size" );
		setLowerLimit( 0 );
		setUpperLimit( 125 );
		setDefault( 2 );
	}  
	x++; 
	aFPArray[x] = new FunctionParameter( "fUpColor", FunctionParameter.COLOR);
	with( aFPArray[x] ) {
		setName( "Up Background Color" );
		setDefault( Color.RGB(215,251,210) );
	}      
	x++; 
	aFPArray[x] = new FunctionParameter( "fDnColor", FunctionParameter.COLOR);
	with( aFPArray[x] ) {
		setName( "Dn Background Color" );
		setDefault( Color.RGB(255,198,198) );
	}      
	

}

//== Main processing function
function main( fBlockSize, fUpColor, fDnColor ) {
var x;
	
	//script is initializing
    if ( getBarState() == BARSTATE_ALLBARS ) {
        return null;
    }

	if ( fBlockSize <= 0 ) return( null );

	if ( bInitialized == false ) {
	
		//initialize break levels to close of first bar we process
		nIndex = -1; //getOldestBarIndex();
		nHighLevel 	= close(nIndex);
		nLowLevel  	= close(nIndex);
		nBlock		= fBlockSize;
		
		setStudyTitle( "Renko (Blocksize: " + nBlock + ")" );
		
		bInitialized = true;
	}

	//called on each new bar
	if ( getBarState() == BARSTATE_NEWBAR ) {
	
		//get close of bar that just completed
		nCheck = close(-1);
		
		bChange = false;
		
		//current renko down
		if ( nStatus == -1 ) {
			//new down renko bar
			if ( nCheck <= ( nLowLevel-nBlock ) ) {
				nTotBlocks = Math.floor( (nLowLevel-nCheck)/nBlock );				
				nBarsSince = 1;
				nHighLevel = nLowLevel;
				nLowLevel  = nHighLevel-(nTotBlocks*nBlock);
				nHighLevel = nLowLevel+nBlock;
				nConsecDn  += nTotBlocks;
				nStatus = -1;
				bChange=true;
			}
			//reversal to long
			else if ( nCheck >= ( nHighLevel+nBlock ) ) {
				nTotBlocks = Math.floor( (nCheck-nHighLevel)/nBlock );
				nBarsSince = 1;
				nLowLevel  = nHighLevel;
				nHighLevel = nLowLevel+(nTotBlocks*nBlock);
				nLowLevel  = nHighLevel-nBlock;
				nConsecUp  = nTotBlocks;
				nConsecDn  = 0;				
				nStatus = 1;
				bChange=true;
			}
				
		}
		//current renko long
		else if ( nStatus == 1 ) {
		
			//new long renko bar
			if ( nCheck >= ( nHighLevel+nBlock ) ) {
				nTotBlocks = Math.floor( (nCheck-nHighLevel)/nBlock );
				nBarsSince = 1;
				nLowLevel  = nHighLevel;
				nHighLevel = nLowLevel+(nTotBlocks*nBlock);
				nLowLevel  = nHighLevel-nBlock;
				nConsecUp  += nTotBlocks;
				nStatus = 1;
				bChange=true;
			}
			//reversal to short
			else if ( nCheck <= ( nLowLevel-nBlock ) ) {
				nTotBlocks = Math.floor( (nLowLevel-nCheck)/nBlock );				
				nBarsSince = 1;
				nHighLevel = nLowLevel;
				nLowLevel  = nHighLevel-(nTotBlocks*nBlock);
				nHighLevel = nLowLevel+nBlock;
				nConsecDn  = nTotBlocks;
				nConsecUp  = 0;
				nStatus = -1;
				bChange=true;
			}
		
		}
				
		//Renko not initialized yet
		if ( nStatus==0 ) {
		
			if ( nCheck >= ( nHighLevel+nBlock ) ) {
				nTotBlocks = Math.floor( (nCheck-nHighLevel)/nBlock );
				nBarsSince = 1;
				nLowLevel  = nHighLevel;
				nHighLevel = nLowLevel+(nTotBlocks*nBlock);
				nLowLevel  = nHighLevel-nBlock;
				nConsecUp  = nTotBlocks;
				nConsecDn  = 0;
				nStatus = 1;
				bChange=true;
			}		
			else if ( nCheck <= ( nLowLevel-nBlock ) ) {
				nTotBlocks = Math.floor( (nLowLevel-nCheck)/nBlock );				
				nBarsSince = 1;
				nHighLevel = nLowLevel;
				nLowLevel  = nHighLevel-(nTotBlocks*nBlock);
				nHighLevel = nLowLevel+nBlock;
				nConsecDn  = nTotBlocks;
				nConsecUp  = 0;
				nStatus = -1;	
				bChange=true;		
			}
		
		}
	
	
		nBarCounter++;
		
	}
	
	//color the chart background based upon whether the renko is currently long or short
	if ( nStatus==1 ) {
		setDefaultBarBgColor( fUpColor, 0, nLowLevel, nHighLevel );
	}
	if ( nStatus==-1 ) {
		setDefaultBarBgColor( fDnColor, 0, nLowLevel, nHighLevel );
	}
	
	drawLineRelative( 0, nHighLevel+nBlock, 15, nHighLevel+nBlock, PS_SOLID, 2, Color.teal,   -200 );
	drawLineRelative( 0, nLowLevel-nBlock, 15, nLowLevel-nBlock, PS_SOLID, 2, Color.maroon, -201 );	
	
	return new Array( nHighLevel, nLowLevel, nStatus==1 ? nConsecUp+"" : nConsecDn+"" );

}


/*************************************************
             SUPPORT FUNCTIONS                    
**************************************************/    
    
//== gID function assigns unique identifier to graphic/text routines
function gID() {
    grID ++;
    return( grID );
}