Skip to content

Allow to buy/sell in fractional units (a portion of Bitcoin) #134

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

Closed
dgrr opened this issue Sep 5, 2020 · 1 comment
Closed

Allow to buy/sell in fractional units (a portion of Bitcoin) #134

dgrr opened this issue Sep 5, 2020 · 1 comment
Labels
question Not a bug, but a FAQ entry top-choice

Comments

@dgrr
Copy link

dgrr commented Sep 5, 2020

Hello,

I am pretty new with this library. I am trying to test some strategies on Bitcoin, but I am struggling with the library because I don't see the way to buy or sell a little amount of BTC. If the price is 11k I need to have a balance of at least 11k to buy a unit.
BTC allows you to purchase a little amount of it. Is there any current feature supporting that? If not, can you implement it?

Thanks.

@kernc
Copy link
Owner

kernc commented Sep 5, 2020

Here's an easy workaround for you: convert the input data to contain prices per one Satoshi (1e-8 BTC) or per one micro bitcoin (μBTC, as below):

df: pd.DataFrame  # Bitcoin OHLC prices

df = (df / 1e6).assign(Volume=df.Volume * 1e6)  # μBTC OHLC prices

@kernc kernc closed this as completed Sep 5, 2020
@kernc kernc changed the title Allow to buy/sell a portion Allow to buy/sell in fractional units (a portion of Bitcoin) Sep 5, 2020
@kernc kernc added the wontfix This will not be worked on label Sep 5, 2020
kernc added a commit that referenced this issue Oct 13, 2020
@kernc kernc added the question Not a bug, but a FAQ entry label Jul 6, 2021
Goblincomet pushed a commit to Goblincomet/forex-trading-backtest that referenced this issue Jul 5, 2023
@kernc kernc marked this as a duplicate of #510 Feb 2, 2025
@kernc kernc marked this as a duplicate of #1198 Feb 2, 2025
@kernc kernc marked this as a duplicate of #421 Feb 2, 2025
@kernc kernc added top-choice and removed wontfix This will not be worked on labels Feb 17, 2025
kernc added a commit that referenced this issue Feb 18, 2025
Implementation according to #134

BTCUSD historical data summarized from:
https://www.kaggle.com/datasets/mczielinski/bitcoin-historical-data
Thanks @mczielinski/kaggle-bitcoin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not a bug, but a FAQ entry top-choice
Projects
None yet
Development

No branches or pull requests

2 participants