Evaluating our trades

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 are far above our other models. It appears we may be on to something with this new model, especially compared to the others we've seen.

At this point, to vet our model further, we should explore its robustness by examining other time periods for our matches. Does extending beyond the four days improve the model? Should we always exclude the patterns that generate a loss? There are an enormous number of questions to explore at this point, but I'll leave this as an exercise for the reader.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.232.11