- Conlan Scientific [conlanscientific.com]
chrisconlan / algorithmic-trading-with-python Goto Github PK
View Code? Open in Web Editor NEWSource code for Algorithmic Trading with Python (2020) by Chris Conlan
License: Other
Source code for Algorithmic Trading with Python (2020) by Chris Conlan
License: Other
Is it possible to have wrapping code for these two examples, reading in an example series and relevant plots?
I just wanted to say I looked to buy your book but I'm not interested a paperback version. Please consider other options (it's 2020!)
Hello,
Would @chrisconlan, or the community please confirm that the charts in chapter 5 no longer match the images in the book please?
I get these when running on windows in jupyter notebook in vscode:
excess_cagr (this one is good)
bollinger_n does not match what's in the book:
and the 3d bollinger_n/sharpe_n chart does not render at all:
Is there a bug in the book or code or did python evolve and expects different code?
Thank you.
trying to unpack this. pd.Series.index returns integers when I pass a log return series to this function and thus (end_date - start_date) evaluates to a single element tuple
def get_years_past(series: pd.Series) -> float:
"""
Calculate the years past according to the index of the series for use with
functions that require annualization
"""
start_date = series.index[0]
end_date = series.index[-1]
return (end_date - start_date).days / 365.25
```
Hello,
I'm trying to run the simulator example usage in listing 4.7 but I get a "Value error: Lenghts must match"
When I print the lengths of the variables c_series
and p_series
in _compute_equity_series
(within the PortfolioHistory class
) I indeed find out that they are different (1280 vs 2495).
I think I have all set up correctly, my example usage of PortfolioHistory runs correctly.
Do you have any advice?
Thank you.
The book is great.
I've started following the code examples, especially the simulator experiments in Chapter 4.3, and found that pypm is installed as:
pip install pypm2
https://pypi.org/project/pypm2/
Error after pypm installation:
ImportError Traceback (most recent call last)
in
1 ### pypm/simulate_portfolio.py
----> 2 from pypm import metrics, signals, data_io, simulation
3 import pandas as pd
4
5 def simulate_portfolio():
ImportError: cannot import name 'metrics' from 'pypm' (.\anaconda3\envs\algotrading\lib\site-packages\pypm_init_.py)
Recently saw this Amazon review that highlighted some confusion about where the pypm
package is located: https://www.amazon.com/review/R1MBCECGQGIXL7/ref=cm_cr_srp_d_rdp_perm?ie=UTF8&ASIN=B086Y6H6YG
The pypm
package is local to the GitHub repository, as can be seen here: https://github.com/chrisconlan/algorithmic-trading-with-python/tree/master/src/pypm, and has nothing to do with this proprietary package listed on PyPI by the same name: https://pypi.org/project/PyPM/
If you clone the GitHub repo and run the scripts from their location within the repo, you should be fine.
Hello Chris
I bought your book sometime last year.
You didn't give us you example on how to use the triple barrier based on the codes you provided. I can see there are two functions if you can just explain what they are for.
I know the "calculate_labels" requires the " compute_triple_barrier_labels" but the output from the two look alike when I ran them one by one.
I have read de Prado's works and compared to his codes yours were simpler to run and test.
Thanks
When trying to run fit_alternative_data_model.py and simulate_alternative_data_portfolio.py getting the error as, No such file or directory in ml_model.joblib
I bought the book.
trying to reproduce all the simulator results.
everything looked good with position class & portfolio class, until I encountered the below assertion error, when running the simple_simulator_usage.py.
using all of the csv files you provided. can't continue with this error. I have not even tried my own portfolio simulation yet.
Is this a known issue? thanks in advance,
in _compute_equity_series(self)
64 c_series = self.cash_series
65 p_series = self.portfolio_value_series
---> 66 assert all(c_series.index == p_series.index), 'portfolio_series has dates not in cash_series'
67 self._equity_series = c_series + p_series
ValueError: Lengths must match.,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.