But for some other reasons, the strategy does not act symmetrically until I remove ulcer and only ulcer from the equation therefore the problem is ulcers internal calculations
I'm guessing this below should do it (but I can't easily check my work because SQX reverts changes when I recompile and I don't feel like tediously reconstructing all the rules in algowizard making a clone of ulcer)
...
if(Mode == 1){ // UP UI=1
highestCalculator.onBarUpdate(Input.Close.get(0), CurrentBar);
double hc = highestCalculator.getHighestValue();
double dd = 100d*((Input.Close.get(0))-hc)/hc;
ddBuffer.set(0,dd);
double sum =0;
for(int k = 0;k<Period;k++){
sum = sum + Math.pow(ddBuffer.get(k),2);
}
double uI = SQUtils.round(Math.sqrt((sum/Period)),4);
Value.set(0,uI);
}
else if(Mode == 2){ // Down UI=2
lowestCalculator.onBarUpdate(Input.Close.get(0), CurrentBar);
double lc = lowestCalculator.getLowestValue();
double dd = 100d*(lc-(Input.Close.get(0)))/lc;
ddBuffer.set(0,dd);
double sum =0;
...
Or maybe it should be this:
double dd = 100d*(lc/(lc-(Input.Close.get(0))));
something like that.
Attachment Strategy 10615021-ulcerclone.sqx added
Attachment SQExtension-ulcerclone.sxp added
Trades Symmetry 98%