This is what I have but it counts data1 instead of data2:
Code: Select all
inputs:
ShareOrPosition( 1 ),
Price(Close),
cBars( 0 );
variables:
Count( 0 ),
Closedown(false),
Countconfirm(false);
{ ==== CONDITIONS ================================================================}
Closedown = Price[0] data2 < Price[1] data2;
if Closedown then
Count = Count + 1 else Count = 0 ; //Should count data2. The problem seems here
Countconfirm = Count = cBars;
{ ===== SETUP AND ENTRY =====================================================================}
if Countconfirm then
Buy ("LE") next bar open; // Should Buy data1