pyfolio icon indicating copy to clipboard operation
pyfolio copied to clipboard

Get returns for pairs trade strategy

Open cmp1 opened this issue 5 years ago • 0 comments

Problem Description

Hi,

I am completely new to Pyfolio and Backtrader.

I am using pyfolio to get the returns for a pairs trading strategy. Unfortunately when calling returns, positions, transactions, gross_lev = pyfoliozer.get_pf_items()

I get the returns of the portfolio, not the mark to market returns of each individual asset i.e. the buy leg of asset 1 and the sell leg of asset 2.

Is there any way I can get the individual daily mark to market returns of each asset traded so that I can pass these to pf.create_full_tear_sheet()

I cannot find how to perform this in any of the documentation. Many thanks.

[Paste code here]

Please provide the full traceback:

[Paste traceback here]

Please provide any additional information below:

Versions

  • Pyfolio version: 0.5.1
  • Python version: 3.6.12
  • Pandas version: 1.1.3
  • Matplotlib version: 3.3.4

cmp1 avatar Mar 17 '21 18:03 cmp1