Closed xzmeng closed 1 month ago
err no? when you buy, you add money to the trade - so sign should be positive when you sell - you remove money out of the trade - so sign should be negative
It's not really a "spot or futures" question either i think.
This PR seems to invert this - using "-" for buys, suggesting we're subtracting money when buying? What from?
I guess your argument is "you subtract money from the account" - but i don't think that's intuitive. I've never seen this displayed in this way on any exchange platform so far - everywhere it's "bought 200$" - not "bought -200$"
So from from looking and testing this (spot, futures, backtesting and dry-run) - i don't think this change is correct - and kinda contradicts (my?) logic. Your screenshots look correct to me - but the new code inverts that behavior, causing a long entry to be "-".
2nd screenshot from a short entry ... (which is a sell)
"add money to the trade/remove money out of the trade" makes sense to me.
I guess your argument is "you subtract money from the account" - but i don't think that's intuitive. I've never seen this displayed in this way on any exchange platform so far - everywhere it's "bought 200$" - not "bought -200$"
My intuition probably comes partly from some backtesting libraries that display an "available cash" curve alongside in the result.
Thanks for your patient explaination.
Thanks for your patient explaination.
I wouldn't call it explanation - rather discussion 😆 it's how it is now - built by me - based on how i thought (and think) about this - which doesn't mean it couldn't be improved or benefit from other views.
I am not sure if it's intentional, but intuitively (for spot trading) we -$344 when we buy, and +$348 when we sell, right?