Created
May 15, 2019 14:20
-
-
Save qharlie/6c456a22e22d7fb84323700af8ca884c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import util.data as btu | |
from strategy import SMAStrategy | |
from joblib import Parallel, delayed | |
tickers = btu.get_nasdaq100() | |
def test_ticker(ticker): | |
cash = 100000 | |
c = btu.run_backtest(SMAStrategy, ticker, '2019-05-01', '2019-05-14',cash) | |
percent_gain = ((c.broker.getvalue() - cash) / cash) * 100 | |
print('Final Portfolio Value: {} for {} executing {} orders ( {}% )'.format(c.broker.getvalue(), ticker, len(c.broker.orders),percent_gain )) | |
Parallel(n_jobs=16)(delayed(test_ticker)(ticker) for ticker in tickers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment