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

Cost basis to positions #249

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Cost basis to positions #249

wants to merge 3 commits into from

Conversation

teeling
Copy link

@teeling teeling commented May 25, 2023

We'd need to confirm if these changes break anything if using other brokers than Alpaca. Especially the changes to the strategy_executor.py.

…egy name in orders.

Alpaca now saves the strategy name as part of the client_order_id, which makes it possible to
parse all orders that made up a position and decide if the position was opened by our strategy
or not. If it was we want to track it, if not we'll ignore it.
@@ -449,6 +449,29 @@ def process_pending_orders(self, strategy):
low = ohlc.df["low"][-1]
close = ohlc.df["close"][-1]
volume = ohlc.df["volume"][-1]

elif self._data_source.SOURCE == "REST":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a new data source here? I thought this was for Alpaca

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

Successfully merging this pull request may close these issues.

2 participants