alpaca-trade-api-python icon indicating copy to clipboard operation
alpaca-trade-api-python copied to clipboard

[Bug]: OTO take profit bypass the PDT Protection

Open sshcli opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

The OTO take profit is bypassing the PDT Protection

For example: if your daytrade_count = 3, but you already have some sell orders that were previously placed by an OTO order a few minutes ago.

Expected Behavior

The sell orders submitted by OTO should not be filled if there are possible PDT violation by doing so. Only fill it if no violation will occur

SDK Version I encountered this issue in

alpaca-trade-api version: 2.3.0

Steps To Reproduce

Tested in Paper Trading
Try to bypass the PDT protection by placing OTO orders

Filled out the Steps to Reproduce section?

  • [X] I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.

Anything else?

No response

sshcli avatar Jul 21 '22 18:07 sshcli