Subscript using < issue

Need find H value > BV1 and to the left of xBV1. BV1 fine, but BV2 and BV values in Analysis 1 or 0 rather H price.

_section_begin("BV_Enter");

i=BarCount-1;
//i=SelectedValue(x);

Filter=1;

//Verify Buy Long **********************************

xBV=i-LastValue(LLVBars(L,3));
BV1=H[xBV];
BV2=H[i<xBV]>BV1;
BV=  H[i<xBV]>BV2;

//Analysis******************************
AddtextColumn(FullName(),"Name",1.2);
addColumn(BV1,"s1",1.2);
AddColumn(BV2,"s2",1.2);
AddColumn(BV,"BV",1.2);
AddColumn(xBV,"xBV",1.2);

//Charts********************************
Plot(BV1,"BVsi",colorRed,styleDots);
Plot(BV2,"Bs2",colororange,styleDots);
Plot(BV,"BV",colorgreen,styleDots);

Plot(xBV,"xBV",colorBlue,styledots,1.2);
_SECTION_END();

Unfortunately your question isn't clear enough and does not provide all necessary details to give you an answer. Please follow this advice: How to ask a good question

Sorry!

Building the Guppy countback line Entry:

  1. Locate H at LLV(L,3) :BV1

  2. Find next higher H to the left (a preceding bar): BV2

3.Find next higher (3rd instance) to left of BV2: BV

The code gives BV1 correctly. The problem is BV2 and BV, which produce 0 or 1 in Analysis.

No syntax errors; code seems logical. The issue may be in the use of < operator in subscript. Your help is greatly appreciated.

Code:

_section_begin("BV_Enter");

i=BarCount-1;

//i=SelectedValue(x);

Filter=1;

//Verify Buy Long **********************************

_section_begin("BV_Enter");

i=BarCount-1;

//i=SelectedValue(x);

Filter=1;

//Verify Buy Long **********************************

xBV1=LastValue(i-LLVBars(L,3));

BV1=H[i-xBV1];

//BV2=HighestSince(H>BV1,H[i<xBV1],1); Also tried this**********

BV2=lastvalue(H[i<BV1]>BV1);

BV= lastvalue(H[i<xBV1]>BV2);

//Analysis******************************

AddtextColumn(FullName(),"Name",1.2);

addColumn(BV1,"BV1",1.2);

AddColumn(BV2,"BV2",1.2);

AddColumn(BV,"BV",1.2);

AddColumn(xBV1,"xBV1",1.2);

//Charts********************************

Plot(BV1,"BVsi",colorRed,styleDots);

Plot(BV2,"Bs2",colororange,styleDots);

Plot(BV,"BV",colorgreen,styleDots);

Plot(xBV1,"xBV1",colorBlue,styledots,1.2);

_SECTION_END();