Traders Laboratory - View Single Post - Heikin Ashi Trend Indicator
View Single Post
  #15 (permalink)  
Old 02-09-2007, 06:47 PM
nicknextmove nicknextmove is offline
nicknextmove has no status.

 
Join Date: Dec 2006
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Heikin Ashi Trend Indicator

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; { ................................................................................ }

Reply With Quote