Comments (10)
from lumibot.
self.get_historical_prices(self.base, 50, 'day', quote=self.quote).df
Was trying to backtest on binance and ccxt.
from lumibot.
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.
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.
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.
from lumibot.
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.
PR created. #416
from lumibot.
from lumibot.
Has been merged. Will close this issue for now.
from lumibot.
Related Issues (20)
- Error when attempting `pip install lumibot` HOT 6
- Polygon feather cache files become stale on splits HOT 1
- OOM when using PolygonBacktesting with many (100+) stocks
- Bug: strategy returns wrong position quantity when requested after order is filled (`self.get_position(asset)`)
- Bug: `get_orders()` not working
- Github Codespace incompatibility HOT 2
- Naive time - no tzinfo set HOT 13
- Adjusted option prices become stale too when stocks split.
- Polygon Backtesting does not include dividends HOT 8
- Python version 3.9 does not support match statements HOT 4
- Error emitted on keyboard interrupt HOT 1
- metadata-generation-failed HOT 3
- Tradier order.average_fill_price and order.get_fill_price() are both 0.0 HOT 2
- Backtesting broker should check cash before processing pending orders HOT 7
- Backtesting could get data from the future
- Websocket streaming for tradier HOT 8
- Order avg_fill_price is 0.0 when backtesting
- Interactive Brokers crypto support
- Add chart support for candlestick
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lumibot.