-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Backtest on multiple stocks & aggregate results #468
-
Is there a way to test the same strategy on multiple stocks and show the aggregate of results from run()
? If not, the best way possible seems to be to use the stats returned from .run()
and aggregate them manually.
Beta Was this translation helpful? Give feedback.
All reactions
For me there is no big difference how you will interpret the results. The main method is to loop the run over several tickers, get the results and accumulate them in one pandas series object, like the index is the stock list, the columns are the stat result (all or selected one), and with pandas you can have all statistics over the result from one strategy for your list of stocks (averages, standard deviation, max/min, etc.). Repeat this for all you strategy and finally you can compare the result statistics from all series.
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
All reactions
-
For me there is no big difference how you will interpret the results. The main method is to loop the run over several tickers, get the results and accumulate them in one pandas series object, like the index is the stock list, the columns are the stat result (all or selected one), and with pandas you can have all statistics over the result from one strategy for your list of stocks (averages, standard deviation, max/min, etc.). Repeat this for all you strategy and finally you can compare the result statistics from all series.
Beta Was this translation helpful? Give feedback.