Code Monkey home page Code Monkey logo

Comments (7)

laroche avatar laroche commented on July 16, 2024

Each lines shows the individual profits and losses. Apart from conversion from USD to Euro, this mostly only
involves FIFO computations, so not something complex.

Can you give examples where a gain instead of a loss is calculated? Also is the starting and ending cash value correct,
what about the net asset value?

Love to hear more details about this. Very often it takes some time to see the details of the inner calculations.

best regards,

Florian La Roche

from tastyworks-pnl.

XNet80 avatar XNet80 commented on July 16, 2024

Thanks for answering. I'm covering the Stillhalter stuff first, because it's only two positions:
I opened a STO position for 0.17 USD and later closed it BTC for 0.18 USD.
Here are the lines from my Tastyworks transaction CSV which I used with your tool:

01/14/2021 3:56 PM | Trade | Sell to Open | GME | Sell | Open | 1 | 07/16/2021 | 5 | P | 0.17 | 1152 | 17 | Sold 1 GME 07/16/21 Put 5.00 @ 0.17 | Individual

03/01/2021 4:01 PM | Trade | Buy to Close | GME | Buy | Close | 1 | 07/16/2021 | 5 | P | 0.18 | 0.14 | -18 | Bought 1 GME 07/16/21 Put 5.00 @ 0.18 | Individual

Here's what the PNL tool put out in its CSV:

2021-01-14 | Stillhalter-Option | 936.16 | -936.16 | -1135.00 | 1.2124 | -1 | GME P5 21-07-16 | True | 0.00 | 0.00

2021-03-01 | Stillhalter-Option | -15.05 | -15.05 | -18.14 | 1.2053 | 1 | GME P5 21-07-16 | False | 0.00 | 0.00

The second case something similar happened. I STO for 0.46 USD and BTC for 0.22 USD but the tool says I STO for 11.06 USD

Any idea how this happened?

from tastyworks-pnl.

XNet80 avatar XNet80 commented on July 16, 2024

Here's an example from my long options.
I bought a 0DTE Call for 39.14 USD which expired worthless (was automatically sold for $1)
Here are the lines from my Tastyworks transaction CSV which I used with your tool:

01/15/2021 3:30 PM | Trade | Buy to Open | GME | Buy | Open | 1 | 01/15/2021 | 47 | C | 0.38 | 1.14 | -38 | Bought 1 GME 01/15/21 Call 47.00 @ 0.38 | Individual

01/15/2021 9:25 PM | Trade | Sell to Close | GME | Sell | Close | 1 | 01/15/2021 | 47 | C | 0.01 | 152 | 1 | Sold 1 GME 01/15/21 Call 47.00 @ 0.01 | Individual

The PNL tool however thinks I made a profit of over $90:

2021-01-15 | Long-Option | 0.00 | -32.29 | -39.14 | 1.2123 | 1 | GME C47 21-01-15 | False | 0.00 | 0.00

2021-01-15 | Long-Option | 92.27 | -124.56 | -151.00 | 1.2123 | -1 | GME C47 21-01-15 | False | 0.00 | 0.00

from tastyworks-pnl.

laroche avatar laroche commented on July 16, 2024

Your very first line from Tastyworks CSV:

  • It contains "17" as cash amount in USD for this transaction which looks right.
  • Right before this are the fees for this transaction and it lists "1152", which would mean that Tastyworks would bill a 1152 USD on fees for it. My script computes overall transaction with "amount - fees" = 17 - 1152 = -1135 USD as overall transaction for this item.

This looks like you probably have fees of "1.152" USD (a bit more than one USD, not more than a thousand dollars.

Looks like "," and "." for thousand are not set correctly for data processing.

Can you check if using LANG=de_DE.UTF-8 right at the begging of your command line gives correct processing?
("locale -a" gives a list of working locale settings.) Are you running the script with en_US locale settings?

best regards,

Florian La Roche

from tastyworks-pnl.

laroche avatar laroche commented on July 16, 2024

Btw second line for Stillhalter GME looks all right, closing trade: 18 USD to buy back the option and 0.14 USD with fees gives overall cost of $18.14 with a EURUSD conversion of 1.2053 results 15.05 Euro costs to close this trade.

best regards,

Florian La Roche

from tastyworks-pnl.

laroche avatar laroche commented on July 16, 2024

I had one report where opening and then storing data with Excel changes values. Can you run the
scrip directly on the data from Tastyworks? If you have to combine data from several files into one,
maybe you can use a normal text editor instead of a spreadsheet program?

best regards,

Florian La Roche

from tastyworks-pnl.

XNet80 avatar XNet80 commented on July 16, 2024

I just saw your last answer. That's exactly what happened. Somehow when combining several files in LibreOffice it changed fees of -0.1152 to +1152.
I re-downloaded all my transactions and combined them in the text editor. Now the report looks correct: 1000 Euro losses instead of 6000 Euro gains ;-)

from tastyworks-pnl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.