High1 is the last swingHigh Occurrence
High2 is the previous
etc.
On each new swing high, High1 will be new; High2 will get the value of previous High1, High3 will get the value of previous High2, etc.
I was trying to be sure I was getting the right Highs by printing every value but when I compare to the chart, the value doesn't seem to be right. First two instances seem to be ok, but the rest won't calculate properly.
This is my code so far:
if (
Swing(StrengthLarge).SwingHighBar(0,1,0) != -1
)
{
double High1 = High[Math.Max(0, Swing(StrengthLarge).SwingHighBar(0, 1, 2000))];
double High2 = High[Math.Max(0, Swing(StrengthLarge).SwingHighBar(0, 2, 2000))];
double High3 = High[Math.Max(0, Swing(StrengthLarge).SwingHighBar(0, 3, 2000))];
double High4 = High[Math.Max(0, Swing(StrengthLarge).SwingHighBar(0, 4, 2000))];
double High5 = High[Math.Max(0, Swing(StrengthLarge).SwingHighBar(0, 5, 2000))];
double High6 = High[Math.Max(0, Swing(StrengthLarge).SwingHighBar(0, 6, 2000))];
Print (Time[0] + " * HIGHS * " +
+ High1 + " / "
+ High2 + " / "
+ High3 + " / "
+ High4 + " / "
+ High5 + " / "
+ High6);
}
Thanks in advance for your help.

Comment