How to optimise these two symbols: < and >

Hello everyone.
I searched the forum and Google but couldn't find anything, so I'm going to ask you here.

How can I use the optimize function with these two symbols: < >.

For example, I would like to do this ( I know it doesn't work as it is):

DirectionLowerBB = Optimize("DirectionLowerBB ’, <,<,>);
DirectionRSI = Optimize("DirectionRSI ’, <=,<=,>=);
CondBuy = C (DirectionLowerBB ) LowerBandBB AND RSI(PeriodeRSI) (DirectionRSI) (NivRSI)

I hope my request is clear.
Thank you in advance for your help.

You need to have change the code to use NUMBERS in Optimize() calls

DirectionLowerBBLessThan = Optimize("DirectionLowerBBKLessThan", 1,0,1,1);
DirectionRSILessThan = Optimize("DirectionRSILessThan", 1,0,1,1);
CondBuy = IIF( DirectionLowerBBLessThan, 
               C < LowerBandBB, C > LowerBandBB) 
      AND IIF( DirectionRSILessThan, 
               RSI(PeriodeRSI) <= NivRSI, RSI(PeriodeRSI) >= NivRSI );

Last but not least:
When posting the formula, please make sure that you use Code Tags (using </> code button) as explained here: How to use this site.

Using code button

Code tags are required so formulas can be properly displayed and copied without errors.

1 Like

Thanks a lot for your answer.
Just one last question:
How can we know what the 1 or the O stands for?
That is to say how to know if the 1 for example corresponds to the ">", or if the 0 corresponds to the "<=" for example.
Thank you in advance.

The variable name is "less than". 1 stands for True in AFL. So when it is 1 it means "less than". Obviously.

@Tomasz Thanks a lot for your answer