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

Appearance settings

Fix threading.Thread target misuse in Alpaca paper trading (Issue #1399)#1400

Open
skyliquid22 wants to merge 2 commits intoAI4Finance-Foundation:masterAI4Finance-Foundation/FinRL:masterfrom
skyliquid22:fix/thread-target-alpacaskyliquid22/FinRL:fix/thread-target-alpacaCopy head branch name to clipboard
Open

Fix threading.Thread target misuse in Alpaca paper trading (Issue #1399)#1400
skyliquid22 wants to merge 2 commits intoAI4Finance-Foundation:masterAI4Finance-Foundation/FinRL:masterfrom
skyliquid22:fix/thread-target-alpacaskyliquid22/FinRL:fix/thread-target-alpacaCopy head branch name to clipboard

Conversation

@skyliquid22
Copy link
Copy Markdown

This PR fixes incorrect usage of threading.Thread where the result of
submitOrder(...) was passed as the thread target, causing immediate execution
instead of deferred execution inside the thread.

Changes:

  • Corrected thread initialization to use target=self.submitOrder
  • Passed arguments via args=(...)
  • Applied fix to both buy and sell order blocks
  • Added an AST-based regression test to ensure submitOrder is not called during thread construction and args are provided when used as a target.

Closes #1399

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.

Fix thread target invocation in paper_trading/alpaca.py (submitOrder called immediately)

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.