For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Coins balance in backtesting

  • Hi guys,

    I'm using the backtrader with Binance, through CCXT Store lib. The CCXT broker give me my coin balance with"BTC"). But, in simulations only the cash values is available with How I can access the coin amount in backtests?

    The second question is: I'm using the follow code to use all my funds to buy with 100% of the value. There is a different way to define an automatic size to use all my funds do buy coins?
    P.S: 0.99 is used to avoid decimal precision issues.

    price = self.data0.close[0]
    amount = ( / price) * 0.99

Log in to reply