portfolio
portfolio copied to clipboard
Fix transaction dialog with negativ quote
Fixes #3365
See comment https://github.com/buchen/portfolio/issues/3365#issuecomment-1557594261
https://github.com/buchen/portfolio/assets/45203494/dc145614-8645-4612-bfa4-40ccf8bbe76a
I have not found a solution for this error case.
I don't think the fix is optimal. If someone is active with options, you could not post more negative prices than in 2020 with crude oil. A truth might be better as the case is very rare
@stoeggich
If someone is active with options, you could not post more negative prices than in 2020 with crude oil.
Can you elaborate on your comment? Do you have an alternative approach (for the "not optimal fix")?
In general, PP does not support options. And it should not be possible to create an inbound delivery with a negative value. Therefore I consider this a bug and would merge the fix by @Nirus2000. But I also know that many folks are using it to maintain options and I do not want to unnecessarily prevent this.
Negative courses are possible, so the possibility should be retained that you can enter them. It is probably mostly a typo, so asking if the input is correct might be an option.
But the Performance cannot be calculated for this position
I have never seen a negative price on securities. However, the situation in April 2020 with crude oil cannot be transferred to stocks. What happens is a total loss or insolvency of the company. See here
I have never seen a negative price on securities.
I believe what @stoeggich wants to say if users are using PP to model options, then it might require to have a negative asset price.
I am hesitant here. I know PP does not officially support options, but I also know that some users have found a good way to track them anyway (and live with the glitches here and there). I do not want to just shut it down.
Maybe we can have an easier transition - by default check the values, but if experimental features are activated, we are more lenient. This way we can find out the feedback from the community. What do you think?