stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
12.87k stars 4.11k forks source link

Chapter 08 :- 02_vestorized_backtest.ipynb #257

Closed Quantuary closed 1 year ago

Quantuary commented 2 years ago

Line 11

long_signals = ((predictions
                .where(predictions > 0)
                .rank(axis=1, ascending=False) > N_LONG)
                .astype(int))
short_signals = ((predictions
                  .where(predictions < 0)
                  .rank(axis=1) > N_SHORT)
                 .astype(int))
stefan-jansen commented 1 year ago

That's correct.