I want to satisfy multiple conditions one by one to take position

Hi there,

I am creating a strategy with VWAP where I need to satisfy 3 conditions to take position, but each condition must be satisfied to go onto the next one.

  1. Price must cross the VWAP up or down.
    ----This is our trigger. only if this condition satisfies we move onto the next one

  2. After the trigger, the low/high of the any candle after the trigger candle must be above/below the VWAP.
    ----- basically after the trigger, I wish to keep the 2nd condition that is Low > VWAP/ High< VWAP on for the rest of the day until the condition satisfies.

  3. Only after the 2nd condition satisfies, any candle after that must cross the High/Low of the candle that satisfied the 2nd condition. This is our final buy/sell signal. The position will be taken on the PRICE(not the same candle) of High/Low of the the candle that satisfies the 2nd condition.
    Again I need to keep this condition on until it satisfies.

--SL will be our VWAP line. If any of the first two condition satisfy but again go in opposite direction, It should reset and start from step 1 again in the opposite direction.

VWAP demo2

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();


_SECTION_BEGIN("VWAP");
/*
The VWAP for a stock is calculated by adding the dollars traded for every
transaction in that stock ("price" x "number of 
      shares traded") and dividing the total shares traded. A VWAP is computed
from the Open of the market to the market Close, AND is 
      calculated by Volume weighting all transactions during this time period
*/

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 091500, BarIndex());
TodayVolume = Sum(V,Bars_so_far_today);
IIf (BarIndex() >= StartBar, VWAP = Sum (C * V, Bars_so_far_today  ) /
TodayVolume,0);
Plot (VWAP,"VWAP",colorOrange, styleDots);

_SECTION_END();


_SECTION_BEGIN("Strategy");
//Looped_Codeblocks_Buy_Short

CrossB = Cross(High,vwap);		//----Condition I
CrossS = Cross(vwap,Low);
CondB = IIf(crossb,Hold(Low > vwap,10),Null);		//----Condition II
CondS = IIf(crossb,hold(High < vwap,10),Null);
	
BarHigh = ValueWhen(CondB,High);
BarLow = ValueWhen(CondS,Low);
buyarray =	Cross(High,barhigh);
shortarray = Cross(barlow,Low);

Buysig = IIf(condb,buyarray,Null);				//----Condition III
Shortsig =	IIf(conds,shortarray,Null);
PlotShapes(shapeCircle*crossB,colorWhite,0,Low,-40);
PlotShapes(shapeCircle*condB,colorAqua,0,Low,-40);

//Sell_Cover Conditions
CondSell = Cross(Vwap,Low);
CondCover = Cross(High,Vwap);

PlotShapes(shapeUpArrow*Buysig,colorYellow,0,Low,-40);
PlotShapes(shapeHollowdownTriangle*Shortsig,colorwhite,0,Low,-30);

Buy =	buysig; 	
Sell = CondSell;
Short = shortsig;
Cover = CondCover;

//Reducing_excess_signals
Buy = ExRem(Buy,Short);
sell = ExRem(Sell,Buy);
Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);

//Visualization
PlotShapes(shapeUpArrow*Buy,colorYellow,0,Low,-40);
PlotShapes(shapeDownArrow*Short,colorYellow,0,High,-40);
PlotShapes(shapeHollowdownTriangle*Sell,colorwhite,0,Low,-30);
PlotShapes(shapeHollowupTriangle*Cover,colorWhite,0,High,-30);

This is my code so far but does not work. I have also tried using Barssince() instead of iif() but that too did not give me correct result. I'm pretty sure i'm doing something wrong but not sure what. Can someone help me figure this out?

Thanks in advance.