merge multiple trades into one

74 views
Skip to first unread message

kprab...@gmail.com

unread,
Sep 7, 2020, 11:59:52 AM9/7/20
to Beancount
Dear members,

I frequently encounter multiple trades that gets executed for a single order. In India, the tradebook provided by the broker lists all the such trades with same date,symbol and trade price individually(refer attached). When i import from this tradebook, this causes too many transactions in my beancount file, which is not really needed.

Is there a way to merge multiple trades into one if they have same date,symbol and trade price.
Is there any solution already implemented in any other importer code? I tried searching in this mailing list, but can't locate any thread on this.

The current importer code zerodha.py that i use can be found here https://github.com/prabusw/beancount-importers-india.

Any pointer or ideas to implement the same is highly appreciated.

Cheers,
Prabu
zerodha20191126.csv

Martin Blais

unread,
Sep 7, 2020, 12:09:22 PM9/7/20
to Beancount
Implement merging in your importer code.



--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/96f44c85-9e8c-456f-81a1-906ed63fb6c6n%40googlegroups.com.

redst...@gmail.com

unread,
Sep 15, 2020, 2:11:12 PM9/15/20
to Beancount
Prabu, doing what Martin said is quite simple. Let us know if you run into problems.

Prabu Anand Kalivaradhan

unread,
Sep 15, 2020, 11:02:23 PM9/15/20
to bean...@googlegroups.com
Dear Redstreet,

Thanks for the follow up email and help.

I have no programming background and managed to do the importers earlier by trial and error based on work by Martin Blais and Matt Terwilliger. I was then under a tighter deadline to do my Indian taxes, so did a quick reading of the book "A Byte of Python" and completed the importers based on their importers and did manually edit the csv's wherever needed to populate my ledger with data from the past decade. I've done my taxes with more accuracy and less time this year, thanks to Beancount.

Now I'm trying to improve the importers, so that they reach the quality of other importers listed here. Unfortunately, I have not managed to learn Python sufficiently yet, as knowledge gaps are too much to understand the Beancount code and excellent comments accompanying it. So I've decided to properly learn Python and I'm currently here in my learning.

Give me some time to acquire a decent knowledge of python and i'll definitely ask this friendly mailing list for any help.

Thanks again to you, and the members of the mailing list for the helpful attitude. My foremost thanks goes to Martin Blais for creating this excellent software and maintaining a friendly atmosphere for new users like me.

If there was no Fava, i don't think i could have come so far. So thanks to Dominik Aumayr and the Team Fava.

Cheers,
Prabu






You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/fxVFd9nvXSw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/f13a2cde-1eaa-44f0-bda3-fda51658d6e4n%40googlegroups.com.

redst...@gmail.com

unread,
Sep 16, 2020, 12:34:46 PM9/16/20
to Beancount
Of course! Wish you the best in your learning journey! If you ever get stuck or want another pair of eyes, feel free to past your code into https://pastebin.com/ (or a similar site), and share the link here.
Reply all
Reply to author
Forward
0 new messages