Hi all, new to the forum so if I make a mistake or post in the wrong place please let me know.
If I perform the following sequence of events it results in an error and failure to open the second entry.
The initial request to open a long position is as follows:
{
"symbol": "AAPL",
"qty": 10,
"side": "buy",
"type": "limit",
"limit_price": 184.0,
"time_in_force": "gtc",
"order_class": "bracket",
"client_order_id": "8/11/23_340",
"stop_loss": {
"stop_price": 150.0
},
"take_profit": {
"limit_price": 190.0
}
}
The response is successful 200 OK and the 3 orders are created on alpaca.
The entry order is filled soon after. While the two exits (sl and tp) remain open.
If I send another bracket order with the following parameters:
{
"symbol": "AAPL",
"qty": 10,
"side": "sell",
"type": "limit",
"limit_price": 180.0,
"time_in_force": "gtc",
"order_class": "bracket",
"client_order_id": "8/11/23_341",
"stop_loss": {
"stop_price": 190.0
},
"take_profit": {
"limit_price": 170.0
}
}
The response is unsuccessful:
{
"code": 42210000,
"message": "bracket orders must be entry orders"
}
Of course the intent is to do this in python but the requests were put here instead of code to be easier to reproduce.
Iām not sure if this is behaviour supported on other platforms or if it is my own lack of knowledge?
Any guidance would be greatly appreciated!