Comments (12)
Thumbs up for shorting feature.
from vectorbt.
Update on the shorting branch: Shorting feature is almost ready in its core, some final touches are left. It will work similar to how it's implemented in backtrader: size > 0 means long, size < 0 means short. On top of that, np.inf
means buying for all cash, -np.inf
means borrowing the amount that can be covered by current portfolio value. One can still borrow more than that by providing a finite number. There won't be any limits or forced short cover though (portfolio value just turns negative). Target sizes all work as expected. I think this builds a great backbone that can be further extended by custom portfolio functions. If there is any other shorting related feature or idea drop it here.
from vectorbt.
Implemented in 0.15.0. Refer to Portfolio docs for details. Basically there is a keyword argument direction
that defaults to longonly
for signals and all
for orders and custom order function. Defaults can be changed in vectorbt.settings
. There are tons of other features as well that I tried to fit into the release, that's why it lasted a bit longer, but it was worth it.
from vectorbt.
Hi @erwan-rouzel, I'm up to finish iterative signal factory this week and then start implementing shorting. Can't give any estimates right now.
from vectorbt.
Cool! Good news. Looking forward for it.
from vectorbt.
Hi, that’s a great suggestion, shorting is definitely something to work on in the future. Right now we are more focused on writing the project documentation, I think that’s something everyone would love to have. After this, we will continue working on new features.
from vectorbt.
do you have prerelease version of documentaion?
from vectorbt.
You can find some basic API reference under https://polakowo.io/vectorbt/docs/index.html
In few days I will release the version 0.6 and the complete API reference.
from vectorbt.
Hi @polakowo, any rough idea when the shorting feature could be released? That would be really great to have it!
from vectorbt.
Thank!!! It is a very good news!!!
from vectorbt.
Can you provide a brief example of long/short implementation from basic signal entries
from vectorbt.
@wyczolko see examples under Portfolio.from_signals. Feel free to ask questions on Gitter.
from vectorbt.
Related Issues (20)
- portfolio stats calculation for dca strategies. not appear all buy orders only first HOT 1
- Error specifying `benchmark_rets` arg in `Portfolio.plot_cum_returns()` HOT 2
- Doc Bug report HOT 1
- how to plot the trades of each symbol in portfolio HOT 1
- slippages are not applied to stop orders HOT 1
- How to import 3rd party data HOT 1
- Open short position right after closing long position with full capital HOT 3
- Installing vectorbt on Google Colab HOT 1
- plot with 1m granularity takes forever HOT 5
- portfolio.from_signals reporting HIGH variations with fees vs no fees
- set sl/tp to be triggered on exact values
- Portfolio.stats consumes large amount of memory. HOT 1
- Need to add requirement: nbformat>=4.2.0
- Vectorbt documentation code examples throws unsupported error. HOT 1
- Assertion Error with VectorBT Portfolio from MultiIndex DataFrame
- Reverse position with from_signals HOT 1
- tp_stop with accumulate gives wrong result
- Data mismatch
- Incorrect Position Size Allocation Across Multiple Assets HOT 3
- For the same precision data, there is an accuracy error in the results.
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 vectorbt.