This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added if statements so the exchange can have it's cut out of the purchase of the asset. Most exchanges want their cut in BTC rather than the alt-coin being processed. This modification allows for the exchange fee to be removed from the overall purchase price allowing for 100% of the currency balance to be spent without an insufficient funds error popping up.
- Loading branch information
b53abcc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for not doing this also for selling signals?
b53abcc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My experience has been that when you convert an asset into currency the exchange fee is deducted from the resulting balance of that swap. So there will always end up being enough currency to cover the fee in sell situations.
With buy situations, especially when the buy percent is 100%, it is necessary to leave enough currency in the account to cover the exchange fee. This is why it is necessary to have this calculation performed on buy scenarios.
With Bittrex it gets tricky, because they do not allow transactions that result in less than 0.00050000 BTC. They consider those "dust trades" and are not allowed. If the balance ever gets that low, then it is going to take manual intevention to either add more asset to allow the sell or increase the BTC balance to cover the buy. However, if everything goes well, balances should never drop to less then 0.00050000. ;-)
Hope this explanation helps.
b53abcc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this broke buy_pct. My buy_pct command doesnt work anymore and it always buys 100%. Also your if and esle statements dont have brackets on them. Please fix this.
(edit) I have confirmed this being the reason for buy_pct not working by replacing the new lines with the old and it works again.
b53abcc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goodness @brucetus, you are absolutely right. I see the problem and will put in the fix for it very shortly. Just need to test it. My deepest apologies.