Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

More clarity on trade pct calculation #1254

Open
Labels
docsThis needs documentation work.
@ironhak

Description

Hello.

The stats._trades has a column called ReturnPct. By reading the docs and the source code it's not clear if the return in percentage is calculated relative to the starting capital, the current equity, or the trade volume. By reading the code:

 @property
 def pl(self):
 """Trade profit (positive) or loss (negative) in cash units."""
 price = self.__exit_price or self.__broker.last_price
 return self.__size * (price - self.__entry_price)
 @property
 def pl_pct(self):
 """Trade profit (positive) or loss (negative) in percent."""
 price = self.__exit_price or self.__broker.last_price
 return copysign(1, self.__size) * (price / self.__entry_price - 1)

it's clear that the return Pct comes from the trade volume. So it would be useful to let the user know this in the docs:

"""Trade profit (positive) or loss (negative) in percent relative to trade size.""" 

Thank's :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsThis needs documentation work.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /