@Gloriafilamino in any exploration you can add as many columns as you want.
In general, when you have some complex rules, it is beneficial to use explorations as a debugging tool, adding a column for each condition to be sure that you are actually applying the desired logic rules.
Here is a modified version of your code to add many more columns (some are commented out, but you should be able to uncomment and test them when you apply it to your data).
I also added a little utility custom function that I use to make the result exploration more readable. I apply it to boolean arrays (logic conditions): I prefer to see only True values (1 - ones) leaving the False (0 - zeros) cells empty.
// some fake conditions to test
buyAdd1 = C > O;
sellAdd1 = C < L;
BuyAdd2 = C > Ref( H, -1 ); // was buyaAd2
SellAdd2 = C < Ref( L, -1 );
/* Uncomment when you have true data
ExtraCondition1 = Ref(C,0) >PRICERANGE;
ExtraCondition2 = T >= STARTTIME;
ExtraCondition3 = T <= ENDTIME;
ExtraCondition4 = TimeNum()>100000;
ExtraCondition = ExtraCondition1 AND ExtraCondition2 AND ExtraCondition3 AND extraCondition4;
*/
// comment out when uncommenting the above block
ExtraCondition = True;
BuyCond1 = buyAdd1 AND ExtraCondition;
SellCond1 = sellAdd1 AND ExtraCondition;
BuyCond2 = buyAdd2 AND ExtraCondition;
SellCond2 = sellAdd2 AND ExtraCondition;
Buy = Buycond1 or Buycond2;
Sell = Sellcond1 or Sellcond2;
PlotShapes( shapeUpArrow*Buy, colorAqua, 0, L, -20 );
PlotShapes( shapeDownArrow*Sell, colorAqua, 0, H, -20 ) ;
/////// Exploration
// A small utility function to improve readibility of exploration
// results for boolean arrays - only ones (1) will appear
function nil(array)
{
return (IIf(array, 1, Null));
}
// Filter = 1;
Filter = Buy OR Sell;
Addcolumn( nil(Buy), "Buy", 1 );
Addcolumn( nil(Sell), "Sell", 1 );
AddColumn( nil(buyAdd1), "BuyAdd1", 1 );
AddColumn( nil(sellAdd1), "SellAdd1", 1 );
AddColumn( nil(buyAdd2), "BuyAdd2", 1 );
AddColumn( nil(sellAdd2), "BuySell2", 1 );
AddColumn( nil(BuyCond1), "BuyCond1", 1 );
AddColumn( nil(SellCond1), "SellAdd1", 1 );
AddColumn( nil(BuyCond2), "BuyCond2", 1 );
AddColumn( nil(SellCond2), "SellCond2", 1 );
/* Uncomment when you have true data
AddColumn( nil(ExtraCondition1), "Extra 1", 1);
AddColumn( nil(ExtraCondition2), "Extra 2", 1);
AddColumn( nil(ExtraCondition3), "Extra 3", 1);
AddColumn( nil(ExtraCondition4), "Extra 4", 1);
*/
AddColumn( nil(ExtraCondition), "Extra Combined", 1);