Comments (3)
I would expect --only_long option to do that, but it doesn't seem to have an effect.
from eiten.
From what I can tell:
- The
only_long
parameter doesn't affect the weight calculation at all (negative weights are always allowed) - When running back tests and future tests with
only_long
enabled, assets with negative weights are treated as if their weight is zero - The
only_long
parameter doesn't affect the monte carlo simulation at all (negative weights are always used)
It seems a bit weird to optimize the portfolio with negative weights and then discard the negative positions during testing.
@tradytics am I correct here?
from eiten.
@henryrossiter - yes, so this is how I've seen others do it too. The simulation should be done after converting the weights to zero so that's an issue. Other than that, people usually don't constrain the weights to be positive during the optimization process but then just convert them to zero during testing or when they actually invest money in the portfolio.
The conversion to zero part during optimization is definitely doable but the optimization problem becomes a bit hard I believe. However, one can always add that constraint in the genetic algorithm as it's quite easy to do that.
Hopefully this answers the OP's question. Closing.
from eiten.
Related Issues (20)
- Error when running portfolio_manager.py HOT 8
- Genetic Algorithm is actually Random HOT 2
- Comparison of Portfolio Weights and issue with "only_long" HOT 2
- Only a few stock are being taken into account HOT 2
- Ticker issue HOT 2
- The whole thing may not as good as it looks like HOT 2
- Stocks choice? HOT 2
- Random Matrix Theory seem to make correlation vanish
- --history_to_use doesn't work with integer values HOT 1
- IndexError: list index out of range when running with default settings HOT 2
- Errors Coming after Previous Successful Use
- Bug when is_test == 0
- Plots not showing; Saving yields a blank png file HOT 1
- (QUESTION) How would I have this save to a json?
- Exception in thread Thread-2 error ? HOT 1
- (Question) Portfolios without shorting?
- Does the portfolio backtesting backtest the current portfolios?
- Invest
- How do I backtest a portfolio's asset allocation? HOT 1
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 eiten.