Skip to content
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

Did TR swap the word positions in the body text for limit orders? #20

Open
bufemc opened this issue Dec 12, 2021 · 0 comments
Open

Did TR swap the word positions in the body text for limit orders? #20

bufemc opened this issue Dec 12, 2021 · 0 comments

Comments

@bufemc
Copy link

bufemc commented Dec 12, 2021

Since a while it seems TR changed the body texts.. the words "limit" plus "buy" or "sell" might have change positions.

        # Sell
        elif (
            (body.startswith("Verkauf") and not body.__contains__("Verkauf-Order abgelehnt"))
            or body.startswith("Limit Verkauf zu")
            or (body.startswith("Sell order") and not body.__contains__("Sell order declined"))
            or body.startswith("Limit Sell order")
        ):

does not (any longer?) match to:

			"body": "Sell Limit order executed for a price of 52.20 \u20ac per share\nProfit: \ufffc 2.15 %",        			

and the same for the other:

does not (any longer?) match to:

			"body": "Buy Limit order executed for a price of 50.00 \u20ac per share",

Quick Fix:

sell part:
or body.startswith("Limit Sell order") or body.startswith("Sell Limit order")

buy part:

        # Savings plan execution or normal buy
        elif (
            body.startswith("Sparplan ausgeführt")
            or body.startswith("Kauf")
            or body.startswith("Limit Kauf zu")
            or body.startswith("Savings Plan executed")
            or body.startswith("Buy order")
            or body.startswith("Limit Buy order")
            or body.startswith("Buy Limit order")
        ):
            fee = 0
            if (
                body.startswith("Kauf") or body.startswith("Limit Kauf zu")
                or body.startswith("Buy order") or body.startswith("Limit Buy order") or body.startswith("Buy Limit order")
            ):

Unfortunately there seems also now an additional "per share" in the body, which breaks again this:

        profit = abs(float(re.findall("[-+]?\d.*\.\d+|\d+", body)[1].replace(",", "")) / 100) #as decimal (percentage)

To make it short: the instable "chaos TR API" seems to provide much more and endless fun ,-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant