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

Broker Cash, Strange Metric #493

Open
Open
Labels
enhancementNew feature or request
@shaunpatterson

Description

Expected Behavior

Start with 1000ドル
Buy 100ドル of stock
self._broker._cash should be 900ドル.
Sell 150ドル of stock
self._broker._cash should be 1050ドル

Actual Behavior

Start with 1000ドル
Buy 100ドル of stock
self._broker._cash doesn't change
Sell 150ドル of stock
self._broker._cash is now 1050ドル (cash += closed_trade.pl)

I don't understand this behavior. The variable is named cash, but it's not really the current cash value.

If you want to make trades based on your actual available cash, self._broker.margin_available seems to be what you want... but that seems strange.

Am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

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