Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Soultrader

Heikin Ashi Trend Indicator

Recommended Posts

Here's an interesting indicator I picked off at the TS forum. It's a slightly modifed version of the heikin ashii indicator.

 

So What Does It Do?

 

If the 5th bar of the last 5 bars closes above the 50% line of the previous 5 bar average, it stays the same color. If the 5th bar closes below the the 50% average it changes color.

 

50% range = Average True Range

 

It really depends on how you want to use it. This can be applied on multiple timeframes. Its a great way to visually see the trend of the market.

 

Screenshot is attached.

trendindicator.gif.4f3697110e1a0911d2f960df033e9c4e.gif

20050523033558TTMTREND.ELD

Share this post


Link to post
Share on other sites

Cool - I like the Heikin Ashii trend too since I am a fan of Hubert.

I watch his free videos almost every day.

 

I created his workspace by watching his videos and by getting the indicators from the TS forums.

 

I have attached both, in case someone is interested. Import the ELD first and then the workspace.

 

thum_10584592c267631b3.jpg

HUBERTS-WS-INDICATORS.ELD

ER2-Hubert-workspace.zip

Share this post


Link to post
Share on other sites

thanks nick,

 

the brick indictaor looked a bit too much for me, but the squeeze and ttm trend look pretty cool. I never really thought about looking at the tradestation forums, so thanks for the tip :p

 

Do people make money with these indicators? I've always thought indicators were a waste of time but these look ok!

 

ah! that workspace looked interesting although i dont really know what the WPCVA or ESINK is :confused: Although, I trade the YM myself.

 

cheers, jay.

Share this post


Link to post
Share on other sites

thanks for those videos nick - are they from the live trading room from trade the markets.com. - i always wanted to know what it looked like in there :p

 

are you a member at tradethemarkets.com. I always fancied joining up, but its a bit expensive without really knowing if its any good!

Share this post


Link to post
Share on other sites

Here it is in C++

 

BaseDataIn 0 is open, 1 is high, 2 is low and 3 is close:

 

int pos, updn=0;

float jO=0, jH, jL, jC=0, jHm1, jLm1;

sg.DataStartIndex=15;

 

jL=sg.BaseDataIn[4][0]; jO=jL; jC=jL; jH=jL;

for (pos=5; pos < sg.ArraySize; pos++)

{

jHm1=jH;

jLm1=jL;

jO=(jO+jC)/2;

jC=(sg.BaseDataIn[0][pos]+sg.BaseDataIn[1][pos]+sg.BaseDataIn[2][pos]+sg.BaseDataIn[3][pos])/4;

 

if(jO>sg.BaseDataIn[1][pos] && jO>jC) jH=jO; else if(jC>sg.BaseDataIn[1][pos]) jH=jC; else jH=sg.BaseDataIn[1][pos];

if(jO<sg.BaseDataIn[2][pos] && jO<jC) jL=jO; else if(jC<sg.BaseDataIn[2][pos]) jL=jC; else jL=sg.BaseDataIn[2][pos];

 

if(jH>jHm1 && jL>=jLm1) {updn=1;} else

if(jL<jLm1 && jH<=jHm1) {updn=-1;};

 

if((sg.Input[2].FloatValue!=1 && sg.Input[2].FloatValue!=-1) || (sg.Input[2].FloatValue==1 && updn==1) || (sg.Input[2].FloatValue==-1 && updn==-1))

{

sg.Subgraph[0].Data[pos]=jO;

sg.Subgraph[1].Data[pos]=jH;

sg.Subgraph[2].Data[pos]=jL;

sg.Subgraph[3].Data[pos]=jC;

};

}

Share this post


Link to post
Share on other sites

This is the code for the TTM Trend:

 

{ ModHA PaintBarStudy  1/20/04

modified Heikin-Ashi technique

compares current bar open to close range
with prior bars...if current is within
prior then color remains the same

Taken from
https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=22399

Modified by mm to make it more like TTM Trend - appears to match
www.tradethemarkets.com

}
inputs:	CompBars(6), UpColor(Blue), DnColor(Red), BarWidth(1);

vars:	haClose(0), haOpen(0), color(0);

if BarNumber = 1 then
begin
haOpen = open;
haClose = (O+H+L+C)/4;
end;

if BarNumber > 1 then
begin
haClose = (O+H+L+C)/4; 
haOpen = (haOpen [1] + haClose [1])/2 ;

{ ................................................................................ }

if haClose > haOpen then color = UpColor
else color = DnColor;

for value1 = 1 to CompBars
begin
	if haOpen <= MaxList(haOpen[value1],haClose[value1]) and
 		haOpen >= MinList(haOpen[value1],haClose[value1]) and
		haClose <= MaxList(haOpen[value1],haClose[value1]) and
		haClose >= MinList(haOpen[value1],haClose[value1]) then
			color = color[value1];		
end;

{ ................................................................................ }


//	plotPB(haOpen,haClose,"heikin-ashi",color);
plotPB(High,Low,"heikin-ashi",color);
SetPlotWidth(1,BarWidth);
SetPlotColor(1,color);

end;
{ ................................................................................ }

Share this post


Link to post
Share on other sites

This is the code for the Squeeze aka BB Squeeze:

 

[LegacyColorValue = true]; 

{@@14439@@}
{04/05/2006}
//Updated by TradingDude, fixed "division by zero error"

{02/16/2005}
{Updated by Redlock}
{		
Well, I have been working in this indicator. I have made a couple of changes: 
(1) that if the momentum changes direction, it changes color. 
(2) I have taken out the plotting of the alertline 
(3) have the dots plotted along the axis 
(4) Have changed the name of the indicator to BBSqueeze (cuts down on confusion).

I think that you will find that it resembles what is on the TTM indicator.}

{------------------------------------------------------------------}
{mmillar, 05/12/2005
For anyone interested I made a small change to the indicator(s) above.
I found that the indicator displayed fine for ES, YM etc but screwed up for FX - 
this is due to the number of decimal places used by the symbol. 
I just added a multiplier so the indicator is normalised across all symbols.

Add the following lines...
Vars: LHMult(0);
if ( barnumber=1 ) then Begin
LHMult=pricescale/minmove;
end;

And modify the following line so that it includes the LHMult variable...

Plot3(value2*LHMult, "NickmNxtMove", color);

}

{ Bolinger Band Squeeze (BBS) Indicator }

{ A variation of an idea by nickm001 (Originally coded by eKam) that when Bollinger Bands (BB) fit inside
the Keltner Channel (KC), a breakout is about to occur. It works on longer term charts, such as
15 minute to daily charts.

This code creates an indicator that plots the ratio of BB width to KC width. When BB and KC widths are
the same, the ratio (BBS_Ind)is equal to one (1). When the BB width is less than the KC Width (i.e. BB
fit inside KC), the BBS_Ind is less than one and a breakout is indicated.

An Alert Line is provided to indicate the level at which the trader considers that the "sqeeze is on" and 
a breakout is eminant.

Coded by Kahuna 9/10/2003

Added by eKam: 9/10/2003
The average of where price has been relative to the Donchian mid line and Exponential average of the
same length is also plotted as an attempt to predict the direction of the breakout.

Added 2/1/2005 For decreasing Delta bar....darker colors to highlight the change.}

Inputs: {------------------------------------------------}
Price(Close),
Length(20), { Length for Average True Range (ATR) & Std. Deviation (SD) Calcs }
nK(1.5), { Keltner Channel ATRs from Average }
nBB(2), { Bollinger Band Std. Devs. from Average }
AlertLine( 1 ), { BBS_Index level at which to issue alerts }
NormalColor( Red ), { Normal color for BBS_Ind }
AlertlColor( Blue ); { Color for BBS_Ind below alert line }


Variables: {---------------------------------------------}
ATR(0), { Average True Range }
SDev(0), { Standard Deviation }
BBS_Ind(0), { Bollinger Band Squeeze Indicator }
alertTextID(-1),
Denom(0),
LHMult(0);



if ( barnumber=1 ) then 
Begin
If minmove <> 0 then
	LHMult = pricescale/minmove;
end;

if barnumber = 1 and alertTextID = -1 then
alertTextID = Text_New(date,time,0,"dummy");

{-- Calculate BB Squeeze Indicator ----------------------}
ATR = AvgTrueRange(Length);
SDev = StandardDev(Price, Length, 1);

Denom = (nK*ATR);
If Denom <> 0 then
BBS_Ind = (nBB * SDev) /Denom; 

If BBS_Ind < Alertline then
SetPlotColor(1, NormalColor)
else
SetPlotColor(1, AlertlColor);

{-- Plot the Index & Alert Line -------------------------}
Plot1(0, "BBS_Ind");

{-- Plot delta of price from Donchian mid line ----------}
value2 = LinearRegValue(price-((Highest(H, Length)+Lowest(L, Length))/2
		+ xAverage(c,Length))/2,Length,0);

var:color(0); color = yellow;

if value2 > 0 then 
if value2 > value2[1] then 
color = green
else
color = darkgreen;

if value2 < 0 then 
if value2 < value2[1] then color = red
else
color = darkred;

Plot3(value2*LHMult, "NickmNxtMove", color);
{plot3(value2,"BB Squeeze",color);}

{-- Issue Alert when the Squeeze is On ------------------}
if BBS_Ind crosses below AlertLine
 and Text_GetTime(alertTextID) <> time then 
 begin
text_setLocation(alertTextID, date, time, 0);
Alert("Check for Squeeze Setups on " + SymbolName);
 end;

{-- Issue Alert when the Squeeze Releases ---------------}
if BBS_Ind crosses above AlertLine
 and Text_GetTime(alertTextID) <> time then 
 begin
text_setLocation(alertTextID, date, time, 0);
Alert("Squeeze is Over on " + SymbolName);
 end;

if BBS_Ind crosses below AlertLine then
SetPlotColor(1, Green);

Share this post


Link to post
Share on other sites

This is the code for the 3 Bricks Reversal:

 

[LegacyColorValue = true]; 

{*********************************************************  
3_LineBrk_V4  Modified 2/12/04 WAV

added input to show/hide paintbars (true/false)
added input to show/hide brk line (true/false)
added input for BrkLine length
alert once per bar only

 use: how to hide regular price bars
  ( format symbol, style, BarType to Line on Close or dot,
   color to chart background or similar )
**********************************************************

"3 Brick Reversal" Modified and Renamed 06/21/06 PatientTrader
(Lonnie VanZandt)

added TrendLine drawing to draw the tops and bottoms of
the "bricks"

cleaned up the Alert reporting

added a vertical Trendline as the last PaintBar of a box
prior to a new box, to close the box cleanly.

The end result is visually identical to John Carter and
Hubert's "TTM Bricks" indicator. I compared the transitions
to those in "Mastering the Trade" and they appear to match.
(Note that Figure 11.8 (@YM Daily) in that book does not
match the 2006 data for @YM for Fourth Quarter 2006. Odd...
}

inputs:
TrendWeight(2),
ShowPB(True),
UpColor(Cyan),
DnColor(Red);

vars:
TrendLeading(-1), TrendTrailing(-1), LastPb(-1),
LastHigh (0),LastLow(0),DrawColor(0),
AlertTime(0);

arrays:
LineH[2](0),
LineL[2](0),
color[2](0);

if BarNumber = 1 then
begin
 LastHigh = h;
 LastLow  = l;
end;
{--------------------------------------
handle first 3 lines separately
---------------------------------------}

If BarNumber = 4 then
begin
for value1 = 0 to 2
begin
  if c[value1+1]  > LastHigh then
  begin
    LineH[0] = c[value1+1];
    LineL[0] = LastHigh;
    color[0] = UpColor;
       LastLow  = LastHigh;
    LastHigh = c[value1+1];	 
  end else
  if c[value1+1] < LastLow then
  begin
    LineL[0] = l[value1+1];
    LineH[0] = LastLow;
    color[0] = DnColor;
    LastHigh = LastLow;
    LastLow  = c[value1+1];
  end;
   end;
end
else

{--------------------------------------
long side
---------------------------------------}

begin
{ see if close > high of last 3 lines }
if c > MaxList(LineH[0],LineH[1],LineH[2]) then
begin

 { see if last line was down color...if so then break }
  	if color[2] = DnColor then
	begin

	  	if TL_Exist( TrendLeading ) then TL_SetEnd( TrendLeading, Date, Time, LineL[2] );
		TrendLeading = TL_New( Date, Time, Close, Date, Time, Close );
		TL_SetSize( TrendLeading, TrendWeight );
		TL_SetColor( TrendLeading, UpColor );

		if TL_Exist( TrendTrailing ) then TL_SetEnd( TrendTrailing, Date, Time, LineH[2] );
		TrendTrailing = TL_New( Date, Time, LineH[2], Date, Time, LineH[2] );
		TL_SetSize( TrendTrailing, TrendWeight );
		TL_SetColor( TrendTrailing, UpColor );

		if AlertTime <> time then
		begin
			AlertTime = time;
  	  		alert("Brick Reversal Long Setup on " + GetSymbolName + ".");
		end;		
	end
	else
	begin

  		if TL_Exist( TrendLeading ) then TL_SetEnd( TrendLeading, Date, Time, LineH[2] );
		TrendLeading = TL_New( Date, Time, Close, Date, Time, Close );
		TL_SetSize( TrendLeading, TrendWeight );
		TL_SetColor( TrendLeading, UpColor );

		if TL_Exist( TrendTrailing ) then TL_SetEnd( TrendTrailing, Date, Time, LineL[2] );
		TrendTrailing = TL_New( Date, Time, LineH[2], Date, Time, LineH[2] );
		TL_SetSize( TrendTrailing, TrendWeight );
		TL_SetColor( TrendTrailing, UpColor );
	end;

    for value1 = 0 to 1
	begin
	  LineH[value1] = LineH[value1+1];
	  LineL[value1] = LineL[value1+1];
	  color[value1] = color[value1+1];
	end;{for value1}

	LineH[2]  = c;
	LineL[2]  = LastHigh;
	LastLow   = LastHigh;
	LastHigh  = c;
	color[2]  = UpColor;
	DrawColor = UpColor;

	LastPb = TL_New( Date, Time, LineH[1], Date, Time, LineL[1] );
	TL_SetSize( LastPb, 1 );
	TL_SetColor( LastPb, color[1] );

end
else
begin

{--------------------------------------
short side
---------------------------------------}

{ see if close < low of last 3 lines }
	if c < MinList(LineL[0],LineL[1],LineL[2]) then
	begin

  	  { see if last line was up color...if so then break }
	  	if color[2] = UpColor then
		begin

		  	if TL_Exist( TrendLeading ) then TL_SetEnd( TrendLeading, Date, Time, LineH[2] );
			TrendLeading = TL_New( Date, Time, Close, Date, Time, Close );
			TL_SetSize( TrendLeading, TrendWeight );
			TL_SetColor( TrendLeading, DnColor );

		  	if TL_Exist( TrendTrailing ) then TL_SetEnd( TrendTrailing, Date, Time, LineL[2] );
			TrendTrailing = TL_New( Date, Time, LineL[2], Date, Time, LineL[2] );
			TL_SetSize( TrendTrailing, TrendWeight );
			TL_SetColor( TrendTrailing, DnColor );

		 	if AlertTime <> time then
			begin
				AlertTime = time;
	  	  		alert( "Brick Reversal Short Setup on " + GetSymbolName + ".");
			end;				
		end
		else
		begin
	  		if TL_Exist( TrendLeading ) then TL_SetEnd( TrendLeading, Date, Time, LineL[2] );
			TrendLeading = TL_New( Date, Time, Close, Date, Time, Close );
			TL_SetSize( TrendLeading, TrendWeight );
			TL_SetColor( TrendLeading, DnColor );

		  	if TL_Exist( TrendTrailing ) then TL_SetEnd( TrendTrailing, Date, Time, LineH[2] );
			TrendTrailing = TL_New( Date, Time, LineL[2], Date, Time, LineL[2] );
			TL_SetSize( TrendTrailing, TrendWeight );
			TL_SetColor( TrendTrailing, DnColor );
		end;


	    for value1 = 0 to 1
	    begin
		  LineH[value1] = LineH[value1+1];
		  LineL[value1] = LineL[value1+1];
		  color[value1] = color[value1+1];
	    end;{for value1}

	    LineL[2]  = c;
	    LineH[2]  = LastLow;
	    LastHigh  = LastLow;
	    LastLow   = c;
	    color[2]  = DnColor;
	    DrawColor = DnColor;

		LastPb = TL_New( Date, Time, LineH[1], Date, Time, LineL[1] );
		TL_SetSize( LastPb, 1 );
		TL_SetColor( LastPb, color[1] );

	end
	else
	begin

		if ( DrawColor = UpColor )
		then
			begin
				if TL_Exist( TrendLeading ) then TL_SetEnd( TrendLeading, Date, Time, LineH[2] );
			  	if TL_Exist( TrendTrailing ) then TL_SetEnd( TrendTrailing, Date, Time, LineL[2] );
			end
		else
			begin
				if TL_Exist( TrendLeading ) then TL_SetEnd( TrendLeading, Date, Time, LineL[2] );
			  	if TL_Exist( TrendTrailing ) then TL_SetEnd( TrendTrailing, Date, Time, LineH[2] );
			end;

	end;
end;
end;

if ShowPB then
begin
Plot1(LineH[2], "LineHigh",DrawColor);
Plot2(LineL[2], "LineLow" ,DrawColor);
end;

Share this post


Link to post
Share on other sites

Hi traders !

 

I have a question about this indikator. i want to build it (let it build) in my chartsoftware.

I have to explain it to someone who should create this for me - thats the reason why i have to understand totaly.

 

What soultrader says at the beginning is :

 

It's a slightly modifed version of the heikin ashii indicator.

 

If the 5th bar of the last 5 bars closes above the 50% line of the previous 5 bar average, it stays the same color. If the 5th bar closes below the the 50% average it changes color.

 

 

Now my understanding of this :

 

At first the only thing the indikator is interessted in is the 50 %-average of the last 5 (or (n)) Bars

- that means you need only the highs + the lows of these (n) bars to calculate this 50%-average of the previous 5 bars.

 

without any Heikin Ashi-formular-stuff - is this right so far ?

 

Then you need the close of the "now"-bar

(to compare it at least with the 50%-average from above)

And this importend close is calculated with the heikin ashi-formular.

Is this right ?

 

And then you must compare it :

if this close is above the 50%-Average - the bar is blue

if this close is below the 50%-Average - the bar is red

 

 

Thank you for a short comment !

 

max-td

Share this post


Link to post
Share on other sites

Here's a copy of the code for you:

 

inputs:	CompBars(6), UpColor(Blue), DnColor(Red), BarWidth(1);

vars:	haClose(0), haOpen(0), color(0);

if BarNumber = 1 then
begin
haOpen = open;
haClose = (O+H+L+C)/4;
end;

if BarNumber > 1 then
begin
haClose = (O+H+L+C)/4; 
haOpen = (haOpen [1] + haClose [1])/2 ;

{ ................................................................................ }

if haClose > haOpen then color = UpColor
else color = DnColor;

for value1 = 1 to CompBars
begin
	if haOpen <= MaxList(haOpen[value1],haClose[value1]) and
 		haOpen >= MinList(haOpen[value1],haClose[value1]) and
		haClose <= MaxList(haOpen[value1],haClose[value1]) and
		haClose >= MinList(haOpen[value1],haClose[value1]) then
			color = color[value1];		
end;


{ ................................................................................ }


//	plotPB(haOpen,haClose,"heikin-ashi",color);
plotPB(High,Low,"heikin-ashi",color);
SetPlotWidth(1,BarWidth);
SetPlotColor(1,color);

end;
{ ................................................................................ }

 

Hope this helps

 

Blu-Ray

Share this post


Link to post
Share on other sites

ThanX Blu-Ray,

i saw that code yet but i am not able to read or code anything at all.

i am just trader ;-)

I must understand the indicator / his function.

Thats why i tried do this "in words" !

And i need a correction or confirmation for this - in words ;)

 

Greets max-td

Share this post


Link to post
Share on other sites

I downloaded the indicators (ttm trend, haiken asihi, scalper buy and sells) but seem to get a formula error message every time I try to load it onto my e-signal chart. Does any one know how I can get it to load correctly?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.