Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding the Position dataframe example #685

Open
Rajmehta123 opened this issue Oct 10, 2021 · 0 comments
Open

Understanding the Position dataframe example #685

Rajmehta123 opened this issue Oct 10, 2021 · 0 comments

Comments

@Rajmehta123
Copy link

Problem Description

Not any coding error but just trying to understand the position csv (test_pos.tar.gz/test_pos.csv).

The position is calculated by the present amount of assets in the portfolio by their corresponding price in transactions (test_txn.tar.gz/test_txn.csv). Then, how can the value be negative as the number of assets in a portfolio cannot be negative?

The tears.py describes the position as:

Parameters
----------
returns : pd.Series
    Daily returns of the strategy, noncumulative.
     - Time series with decimal returns.
     - Example:
        2015-07-16    -0.012143
        2015-07-17    0.045350
        2015-07-20    0.030957
        2015-07-21    0.004902
positions : pd.DataFrame, optional
    Daily net position values.
     - Time series of dollar amount invested in each position and cash.
     - Days where stocks are not held can be represented by 0 or NaN.
     - Non-working capital is labelled 'cash'
     - Example:
        index         'AAPL'         'MSFT'          cash
        2004-01-09    13939.3800     -14012.9930     711.5585
        2004-01-12    14492.6300     -14624.8700     27.1821
        2004-01-13    -13853.2800    13653.6400      -43.6375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant