| |
 |
Views:
1751 |
| Added: June 02, 2008 |
| |
| |
|
| This formula has not been rated yet |
|
|
| |
email this link
|
| |
| |
| Tags:
TradeStation, indicator
|
| |
 |
Here's an indicator version. I use it with an audio alert with "enable alert" set on and "disable alert once hit" unchecked. It will alert only once per bar if trend changes. I also uncheck "update value intra-bar" so that I don't get confused by multiple changes during bar formation. It works better for me with longer timeframe bars.
Code:
Type : Indicator, Name : Heikin Ashi II
{ HA Indicator 1/21/04
uses modified Heikin-Ashi technique
Designed for a Subgraph below main chart
plots cross as UpColor for up trend
plots cross as DnColor for dn trend
alerts when trend changes...will alert only once
per bar (thanks to eKam and others for this)
}
inputs: UpColor(green),DnColor(red),CompBars(0);
vars: haClose(0),haOpen(0),haHigh(0),haLow(0),
color(0),AlertTime(0),TextID(-1);
if BarNumber = 1 then
begin
haOpen = open;
haClose = (O+H+L+C)/4;
haHigh = MaxList( high, haOpen, haClose);
haLow = MinList( low, haOpen,haClose);
TextId = Text_New( date, time, 0, "A" );
end;
if BarNumber > 1 then
begin
haClose = (O+H+L+C)/4;
haOpen = (haOpen [1] + haClose [1])/2 ;
haHigh = MaxList(High, haOpen, haClose) ;
haLow = MinList(Low, haOpen, haClose) ;
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;
plot1(0,"HA",color);
if color <> color[1] then
begin
AlertTime = text_GetTime(TextID);
if AlertTime <> time then
begin
if color = DnColor then
alert(GetSymbolname + NumToStr(BarInterval,0)+" minute trend is down no pro blame oh ");
if color = UpColor then
alert(GetSymbolname + NumToStr(BarInterval,0)+" minute trend is up all bee back");
text_SetLocation(TextID,date,time,0);
end;
end;
end;
Source: http://www.tradestation.com
all formulas for TradeStation
all formulas
|