[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ConsolidatedBars indicator from eld to els or txt



PureBytes Links

Trading Reference Links

At 08:46 AM 8/2/2005, Alexandra wrote:

>would someone be so kind and could send me an els or
>txt file out of this eld file.
>i'm still using ts2k and like to play with this
>creating "one bar - out of two days indicator"




Here is the text of the two indicators in the ELD.

Bob Fulks 
// ConsolidateBars Indicator				|
// ©2005, JRG, v8.1, 15 Apr 2005			|
//__________________________________________|

	INPUTS: Bars_To_Consolidate		( 2 ),		
			Bar_Width				( 1 ),		// set TL style
			Up_Bar_Color			( Green ),
			Down_Bar_Color			( Red ),
			Flat_Bar_Color			( White ),
			Tic_Width				( 2 ),		// set open/close tick style
			Open_Tic_Color			( White ),
			Close_Tic_Color			( Yellow ),
			Erase_UnderLying_Plot	( False ) ;	// erase individual price bars

 VARIABLES: Consolidated_Open		( 0 ),		// open price of new group of bars
			Chart_BG_COlor			( GetBackgroundColor ),	// use to erase plots
			Bars_Remaining			( 0 ),		// until next 
			Bars_Back				( 0 ) ;

// ***** Compute Current Bar *****
	Bars_Remaining = Mod( CurrentBar, Bars_To_Consolidate ) ;
	if Bars_Remaining = 0 then
		Bars_Back = Bars_To_Consolidate 
	else
		Bars_Back = Bars_Remaining ;
	Consolidated_Open = Open[Bars_Back -1] ;

// ***** Plot Consoldiated Bars *****
	Plot1( Consolidated_Open, "Open", Open_Tic_Color, Default, Tic_Width ) ;	// open tick mark
	Plot2( Close,"Close", Close_Tic_Color, Default, Tic_Width ) ;		// close tick mark
	Plot3( Highest( High, Bars_Back), "High" ) ;
	Plot4( Lowest( Low, Bars_Back), "Low" ) ; 
	
// ***** Set Plot Attributes *****	
	if Bars_Remaining = 0 then 				// consolidated bar
		SetPlotWidth( 3, Bar_Width ) 
	else								// intermediate bar
		SetPlotWidth( 3, 0 ) ;
	if Plot1 < Plot2 then 				// up bar
		SetPlotColor( 3, Up_Bar_Color ) 
	else 
		if Plot1 > Plot2 then			// down bar
			SetPlotColor( 3, Down_Bar_Color )
		else 							// flat bar
			SetPlotColor( 3, Flat_Bar_Color ) ;

// ***** Manage Intermediate Bars *****
	if Bars_Remaining <> 0 and
		BarStatus(1) = 2 then	// last tick on bar
			begin
				if Erase_Underlying_Plot then
					begin
						SetPlotColor( 1, Chart_BG_COlor ) ;
						SetPlotColor( 2, Chart_BG_Color ) ;
						SetPlotColor( 3, Chart_BG_Color ) ;
					end	// erase intermediate plot price bar
				else begin	// show price plot
						NoPlot(1) ;
						NoPlot(2) ;
						NoPlot(3) ;
						NoPlot(4) ;
					end ;	// erase intermediate plots	& retain price
			end ;	// manage plots
	



// ConsolidateCandles Indicator				|
// ©2005, JRG, v8.1, 15 Apr 2005			|
//__________________________________________|

	INPUTS: Bars_To_Consolidate		( 2 ),		
			Wick_Width				( 0 ),		// set TL style
			Wick_Color				( White ),
			Candle_Width			( 5 ),
			Up_Bar_Color			( Green ),
			Down_Bar_Color			( Red ),
			Flat_Bar_Color			( White ),
			Erase_UnderLying_Plot	( False ) ;	// erase individual price bars

 VARIABLES: Consolidated_Open		( 0 ),		// open price of new group of bars
 			Bar_Color				( 0 ),
			Chart_BG_COlor			( GetBackgroundColor ),	// use to erase plots
			Bars_Remaining			( 0 ),		// until next 
			Bars_Back				( 0 ) ;

// ***** Compute Current Bar *****
	Bars_Remaining = Mod( CurrentBar, Bars_To_Consolidate ) ;
	if Bars_Remaining = 0 then
		Bars_Back = Bars_To_Consolidate 
	else
		Bars_Back = Bars_Remaining ;
	Consolidated_Open = Open[Bars_Back -1] ;

// ***** Candle Color *****	
	if Consolidated_Open < Close then 		// up bar
		Bar_Color = Up_Bar_Color 
	else 
		if Consolidated_Open = Close then	// flat bar
			Bar_Color = Flat_Bar_Color 
		else 								// down bar
			Bar_Color = Down_Bar_Color ;

// ***** Plot Consoldiated Bars *****
	Plot1( Consolidated_Open, "Open", Bar_Color, default, Candle_Width ) ;	// open tick mark
	Plot2( Close,"Close" ) ;		// close tick mark
	Plot3( Highest( High, Bars_Back), "High", Wick_Color, default, Wick_Width ) ;
	Plot4( Lowest( Low, Bars_Back), "Low" ) ; 

// ***** Manage Intermediate Bars *****
	if Bars_Remaining <> 0 and
		BarStatus(1) = 2 then	// last tick on bar
			begin
				if Erase_Underlying_Plot then
					begin
						SetPlotColor( 1, Chart_BG_COlor ) ;
						SetPlotColor( 2, Chart_BG_Color ) ;
						SetPlotColor( 3, Chart_BG_Color ) ;
						SetPlotColor( 4, Chart_BG_Color ) ;
					end	// erase intermediate plot price bar
				else begin	// show price plot
						NoPlot(1) ;
						NoPlot(2) ;
						NoPlot(3) ;
						NoPlot(4) ;
					end ;	// erase intermediate plots	& retain price
			end ;	// manage plots