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

Show position % increase/decrease in status? #2

Closed
thewelshrich opened this issue May 24, 2021 · 5 comments
Closed

Show position % increase/decrease in status? #2

thewelshrich opened this issue May 24, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@thewelshrich
Copy link

Love the work you've done so far!

Would you consider adding the % increase/decrease of an open position in the status?

Also are pull requests welcome, or would you prefer to work on this alone?

Thanks!

@beeb beeb added the enhancement New feature or request label May 24, 2021
@beeb
Copy link
Owner

beeb commented May 24, 2021

Hi! Thanks for the feedback. Yes that's definitely something I want to add very soon.

My current idea is this: when a new buy order is placed, the effective price after tax is saved together with the token record in the database. This allows calculating a price difference that correlates with "profitability". If there were taxes on the transaction, this percentage will be negative at first (due to the value lost during transaction). When the percentage reaches zero, the "buy" tx fees have been paid for by the price increase.

Now when a sell order is placed, I envision to keep the reference price as it was, because the sell might be only partial (i.e. some balance is left). And I would imagine people would like to still track the price of the asset since they bought.

When a new buy order is placed, there are two options:

  • A new effective buy price is calculated pro rata from the balance before the order was placed, and the newly added tokens, as a weighted average
  • The effective buy price of the latest transaction replaces the old one

Let me know what you think!

Regarding PRs, I'm generally open to them but I have not written a contribution guide yet. I'll probably have to create some pre-commit hooks as well.

@thewelshrich
Copy link
Author

Thanks for the reply!

I think tracking the position pro rata would be a great option to have - one of the things I'm using this for is to compound existing positions (using limit buys) while the market is so volatile.

Python isn't my language of choice but I have a local shelf where I've added a couple of things that I personally find useful (eg. wallet monitoring on BscScan), but likely have no real value in the project. I have no doubt that the work you're doing will grow in popularity as more people find it, and would love to get involved where available.

I'll keep an eye out for the contribution guide :)

@beeb
Copy link
Owner

beeb commented May 25, 2021

The change requested in this issue is now live on the develop branch. Feel free to test if you feel comfortable. Currently, the effective buy price is only populated by a buy order being closed (executed). There is no manual way of setting this buy price in the token record. Would that be something interesting? Maybe through the /edittoken conversation/command.

@thewelshrich
Copy link
Author

I'll take a look at the develop branch.

It might be worth being able to manually set the buy price. I use the bot on a new wallet where transactions are only made through the bot, but being able to manually set the buy price would let people populate the buy price where orders were placed outside of Telegram.

@beeb
Copy link
Owner

beeb commented May 31, 2021

Closed through release of v0.4.1.

@beeb beeb closed this as completed May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants