I'm integrating a Supertrend indicator I found in your "Version 7 Indicators" forum, and I'm able to access the UpTrend and DownTrend values found in the DataBox.
While I could easily write some code that distinguishes when a trend reverses via the indicator (i.e. when UpTrend and DownTrend equal each other), is there a way to access the tag number of the arrow that's drawn?
I know the syntax is something like (arrow.CurrentBar), but the following code from the indicator doesn't give me a clue how to bring it up:
if (CurrentBar < Lenght)
{
Trend.Set(true);
UpTrend.Set (Close[0]);
DownTrend.Set(Close[0]);
return;
};
if (Close[0]>DownTrend[1])
Trend.Set(true);
else
if (Close[0]<UpTrend[1])
Trend.Set(false);
else
Trend.Set(Trend[1]);
if(Trend[0] && !Trend[1])
{
UpTrend.Set(Median[0] - ATR(Lenght)[0]*Multiplier);
UpTrend.Set(1, DownTrend[1]);
if (ShowArrows)
DrawArrowUp(CurrentBar.ToString(), true, 0, UpTrend[0] - TickSize, Color.Blue);
} else
if (!Trend[0] && Trend[1])
{
DownTrend.Set(Median[0] + ATR(Lenght)[0]*Multiplier);
DownTrend.Set(1, UpTrend[1]);
if (ShowArrows)
DrawArrowDown(CurrentBar.ToString(), true, 0, DownTrend[0] + TickSize, Color.Red);
} else
if (Trend[0])
UpTrend.Set((Median[0] - ATR(Lenght)[0]*Multiplier) > UpTrend[1] ? (Median[0] - ATR(Lenght)[0]*Multiplier) : UpTrend[1]);
else
DownTrend.Set((Median[0] + ATR(Lenght)[0]*Multiplier) < DownTrend[1] ? (Median[0] + ATR(Lenght)[0]*Multiplier) : DownTrend[1]);
}
Thanks in advance!

is the same for both down/up arrows. So while it attempts to record the CurrentBar as a value, that only helps determine when the event occured, but not what type of event it is.
Comment