Giter VIP home page Giter VIP logo

Comments (10)

grzesir avatar grzesir commented on June 15, 2024

from lumibot.

Daniel-ltw avatar Daniel-ltw commented on June 15, 2024
 self.get_historical_prices(self.base, 50, 'day', quote=self.quote).df

Was trying to backtest on binance and ccxt.

from lumibot.

grzesir avatar grzesir commented on June 15, 2024

This is a question for @mrchaos , who created this feature. @mrchaos any ideas how to fix this?

I also don't think we have documentation for this yet

from lumibot.

grzesir avatar grzesir commented on June 15, 2024

As an aside: it seems like we should be using a different type for duckdb. Crypto can have both very large and very small values, so I don't think double is the appropriate data type. I think can either use something like bigint and move the decimals, or save it as a string.

@Daniel-ltw feel free to submit a pull request if you make a fix

from lumibot.

Daniel-ltw avatar Daniel-ltw commented on June 15, 2024

Drop a breakpoint before the insert and the culprit is the volume column value.

Will test running it with bigint now and see how that works.
If this goes well, will put in a pr for it.

from lumibot.

grzesir avatar grzesir commented on June 15, 2024

from lumibot.

Daniel-ltw avatar Daniel-ltw commented on June 15, 2024

Yup. DuckDB allows us to use decimal for the columns.

con.execute("""CREATE TABLE IF NOT EXISTS candles (
                            datetime DATETIME,
                            open DECIMAL, high DECIMAL, low DECIMAL, close DECIMAL, volume DECIMAL, missing INTEGER)""")

Just need to update line 230-232 to the above.

Will drop in a PR for this small change.

The rest of the prices were in float but was also throwing errors, which cause the trade_cost calculation in the backtesting_broker to fail. The above change should address this issue.

from lumibot.

Daniel-ltw avatar Daniel-ltw commented on June 15, 2024

PR created. #416

from lumibot.

grzesir avatar grzesir commented on June 15, 2024

from lumibot.

Daniel-ltw avatar Daniel-ltw commented on June 15, 2024

Has been merged. Will close this issue for now.

from lumibot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.