Ah i just need to remove
if args.fractional:
cerebro.broker.addcommissioninfo(CommInfoFractional())
Ah i just need to remove
if args.fractional:
cerebro.broker.addcommissioninfo(CommInfoFractional())
hi,
I copy-pasted the sample code from:
https://www.backtrader.com/blog/posts/2019-08-29-fractional-sizes/fractional-sizes/#trading-cryptocurrencies-fractions
From the blog itself, the log should be :
But mine is:
As you can see, the sample log's size is -16.4574...
mine does not have any decimals.
Am I doing anything wrong or am I missing something?
Because I have
and still:
"So the good way to play with the Backtrader's samples is to actually clone the Backtrader repository and work directly with it."
and how do I do this? How do I clone the backtrader repository into my directory? or how do I place the specific data into the place where I needed to place? Where do i place it?
I have downloaded the file. I just don't know what do with it.
@vladisld
My question is how do I install it? I apologize if my question is not clear.
@vladisld it would be helpful if you elaborate more. I have pasted the directory to my project directory and the problem persists. Which source code are you talking about?
Hi there,
I am trying to run the sample code from:
https://www.backtrader.com/blog/posts/2019-08-29-fractional-sizes/fractional-sizes/
,and it uses the sample data from backtrader library. Since I copy pasted the code and ran it, it says there is no such data, so I will assume I have to download it manually. And I guess this is where to get the data from:
https://github.com/mementum/backtrader
But how do I install it? the installation note :
Which I already did when I first installed backtrader.
Get you api key and secret from your binance account
Here's what I use for binance.
import config, csv
from binance.client import Client
client = Client(config.API_KEY, config.API_SECRET)
# prices = client.get_all_tickers()
# for price in prices:
# print(prices)
'''
GUIDELINES
To change the timeframe to 1minute data, replace "1HOUR" with
to "1MINUTE".
'''
csvfile = open("data/1HOUR/ZILBTC_Start_311220_1HOUR.csv", "w", newline="")
candlestick_writer = csv.writercsvfile,delimiter=',')
candlesticks = client.get_historical_klines("ZILBTC", Client.KLINE_INTERVAL_1HOUR,"01 Jan 2017","31 Dec 2020")
for candlestick in candlesticks:
candlestick[0] = candlestick[0] / 1000
candlestick_writer.writerow(candlestick)
csvfile.close()