mhallsmoore / qstrader

QuantStart.com - QSTrader backtesting simulation engine.
https://www.quantstart.com/qstrader/
MIT License
2.93k stars 855 forks source link

Basket Trade Reporting #176

Closed AttilaTheCoder closed 8 months ago

AttilaTheCoder commented 7 years ago

Reference article for pairs: https://www.quantstart.com/articles/kalman-filter-based-pairs-trading-strategy-in-qstrader

Question - Is it fair to say that if you were looking at the results of the pairs strategy from the synthetic spread vantage point, that the trade statistics as far as win/loss % on trades, doesn't represent the actual pair result as a whole but the individual long and the individual short?

I think it would be very powerful to have the option to report statistics based on the synthetic trade (or basket) as one trade. I have an algo that trades multiple baskets and I would like convert it over to use this platform.

One way to implement might be to add an optional basket key attribute to a buy/sell order that would mark it as belonging to a particular basket. The stat module could then look for other closing trades for the same attribute and create statistics based on the basket.