For example, here is my code (simplified):
If (A) // first occurrence of "A" pattern on the chart
{
B = high[0]
A1 = True
}
If ((A) // that is, if "A" happens again - the second occurrence of "A" pattern on the chart
&& A1 == True
&& High > B ) // which never returns - True. Always, returning False.
{
C = high[0]
B1 = True
}
The problem with the above code is this line "&& High > B". It is never true because whenever "A" is True,it assigns the High[0} to B. Thus, the High[0] is never greater than "B".
How do I keep track of multiple instances of "A" occurring? I'm trying to track each instances of "A" occurring independently.
Specifically, I want to independently track the pattern below each time it occurs on my chart.
if((Close[0] < Open[0])
&& (Close[1] < Open[1])
&& (Close[2] > Open[2])
&& (Close[3] > Open[3]) )
Your assistance will be greatly appreciated.
Comment