January 2019
Intermediate to advanced
378 pages
8h 27m
English
Let's now construct a function to evaluate our trades. We'll buy similar curves unless they fail to return a positive result. If that happens, we'll eliminate them, as follows:
excluded = {}
return_list = []
def get_returns(r):
if excluded.get(r['A']) is None:
return_list.append(r['B Ret'])
if r['B Ret'] < 0:
excluded.update({r['A']:1})
winf.apply(get_returns, axis=1);
Now that we have all the returns from our trades stored in return_list, let's evaluate the results:
get_stats(pd.Series(return_list))
This generates the following output:

These results are by far the best we've seen. The win/loss ratio and the mean ...
Read now
Unlock full access