-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unintended complex numbers output #19
Comments
Something else to note.
This clipped ratio value will be 1 if skew >= 0.5. Which is fine for bid_sizes however in ask_sizes you add 0.5 clipped_r squared by some value. If clipped ratio == 1 which it will be for skew >= 0.5. The geometric ratio in ask_sizes will be 1.5 so exceeding 1.0. This might cause issues down the line. |
oop, im surprised i didnt encounter these in my few hours of running it... will make fixes for this, many thanks for point it out! |
No worries. I had a brief look at your feature calcs. Not sure if you're running the same ones live but there are some that cannot return negative values. Like the weighted mids and stuff can only return negative values if there are negative prices. So that might be why you didn't encounter the negative skew one as perhaps the skew never got negative because half of the features only output postive values? Anyways I'll have a deeper look at everything later. |
yeah there is missing stuff to in the feature calcs, the mids are supposed to be np.log(wmid/mid), not just plain wmid/mid... all still WIP of course but clearly theres a lot more missing stuff than expected (found some more unintended behaviour in the quote gen, will push soon). thanks again! |
addressed the issue here (and more missing stuffs): 80900f2 hope this fixes it, will close this issue once i get time to run it live and monitor quoting logic w/feat values |
Just as a heads up in the v2 alpha branch in smm/quote_generators/plain.py.
You allow negative numbers as input.
Negative skew values will be used in:
This will cause unintended issues. Best shown by an example.
Output:
Afaik interprets python the one with the skew variable used as:
(-0.99)**0.5.
While interpreting the one without the var used as:
-(0.99**0.5)
.Raising a negative number to a fractional exponent results in a complex number rather than the expected float.
Have you not yet encountered this? I haven't looked at the skew calcs in depth yet and I know it's still a WIP maybe the current skew calcs will never output negative skew or the skew value is coming from somewhere else idk.
The text was updated successfully, but these errors were encountered: