137_DEV4 Greater than for negative numbers possible BUG

Hello, it lookslike SQx think that 2 negative numbers are incorrectly calculater.

for example it state that -0.73 is greater than -0.65 ( wrong , it is smaller )


here is an example of how this calculation screw my calculation:


Strategy 92.14.45 calculation of the FIlter: RET/DD -0.73 Is Greater than -0.65 = TRUE  , the strategy pass the condition. 
But it is  false ->  should have failed, -0.73 is less than -0.65 ( at least for excel )

I also checked on line on some Math website and they report same as excel.


Could u please check this out?


Attachments
Greater than for negative numbers.png
(41.73 KiB)
  • Votes +4
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

l
#1

Loonly

19.03.2023 00:49

Task created

l
#2

Loonly

19.03.2023 01:15
Voted for this task.
l
#3

Loonly

19.03.2023 09:41

Attachment image.png added

Attachment image 1.png added

image.png
(13.65 KiB)
image 1.png
(133.53 KiB)
l
#4

Loonly

21.03.2023 09:59
The BUG is not olny for Filtering, but it involves also Building Blocks building strategy!


JJ
#5

jjsb41

21.03.2023 11:34
Voted for this task.
KB
#6

kbtech

21.03.2023 18:56
Voted for this task.
TT
#7

Tamas

22.03.2023 13:20

Status changed from New to Waiting for information

Hello, thanks for reporting the bug.  Fixed


The problem was in Filtering logic. What do you mean that it is related also to BB ? Can you provide more info or printscreen where I can see the problem ?

l
#8

Loonly

22.03.2023 15:20
Hello Tamas,
line 39 and 40 of IsGreater:
double val1 = SQUtils.round(Left.evaluateBlock(), 6); Since i assume the fix of chatGBT was correct, we have to delete the round(6) function, or negative numbers are not evaluated correctly, we have the same identically issue on "Builtin/Snippets/SQ/Comparisons" modules that compare, so Isgreater (>) but also >=, <, <=.


But i see same issued also on other comparison , for example NotEquals !

So i would check athe whole lines in java that have round function.

ChatGPT wrote that the issue is there, we need to remove the round function.

Could i ask how the code of the FIlter was before the fix since we can not see that code? and how it is now?

Best.

l
#9

Loonly

22.03.2023 15:29

Attachment Solution.png added

Solution.png
(234.45 KiB)
E
#10

Emmanuel

22.03.2023 16:22
Voted for this task.
TT
#11

Tamas

28.03.2023 09:26

Status changed from Waiting for information to Fixed

Attachment image-0.png added

image-0.png
(218.61 KiB)
The percentage of negative numbers was wrongly calculated.


It was miscalculated 

if(value>=0) {

value = value * ((double)pctRatio/100);

} else {

value = value / ((double)pctRatio/100);

}



l
#12

Loonly

28.03.2023 10:01
Excellent, ready to try the fix once DEV5 will be out Tamas, strategies affected are ready to be retested.
Thank you.

Votes: +4

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please