I require some assistance with exrem() function.
I have noticed that quite a few AFL trading systems using the exrem() function, particularly after the generation of the buy sell signals in AFL.
I assumed I understood exrem(), and to confirm it I wrote the following simple AFL code to generate some test signals to use as parameters for exrem(), the purpose of which was to test my understanding of exrem().
// This is just an example to create some data for testing exrem
Array1 = IIf( Random() > 0.5, True, False);
Array2 = IIf( Random() > 0.5, True, False);
Array1ExRem = ExRem(Array1,Array2);
Array2ExRem = ExRem(Array2,Array1);
Filter =True;
AddColumn(Array1,"Array1",1.0,colorDefault,colorAqua);
AddColumn(Array2,"Array2",1.0,colorDefault,colorAqua);
AddColumn(Array1ExRem,"Array1ExRem",1.0,colorDefault,colorAqua);
AddColumn(Array2,"Array2",1.0,colorDefault,colorLime);
AddColumn(Array1,"Array1",1.0,colorDefault,colorLime);
AddColumn(Array2ExRem,"Array2ExRem",1.0,colorDefault,colorLime);
However, after seeing the following results ( from explore output) it seems that my understanding was not complete.
I thought that exrem() removed excessive signals from array1 and array2 effectively acted as toggle/reset for the state read from array1.
The issue is that, my understanding of this does not match the output from the simple test as I am not able to clearly interpret the interaction of array2 with respect to array1.
Could someone please assist in describing in more detail the exrem() function in particular the logic of array2 (2nd parameter) with respect to array1. I require clarification in understanding the result (logic) of the highlighted rows shown in the explore output above.
Thanks