GeminiAgentsToolkit / investor-agent

1 stars 1 forks source link

half-working get_open_orders() #34

Closed seralekseenko closed 3 months ago

seralekseenko commented 3 months ago

It shows only limit leg and ignore Stop Loss leg.

зображення

Now, I should remember the order of Stop-Loss's leg

зображення

I think the root of problem seats in the HELD status.

b0noI commented 3 months ago

from the documentation:

"When executing a ‘bracket order’, the first order is immediately submitted to the market which will enter a position (either long or short). While that order is being filled, the other two legs of the bracket order will be ‘held’. Neither will be submitted until the first order is completely filled. Once the first order is filled, the take-profit order, which is a limit order, is submitted to the market. It becomes a ‘new’ order."

so I think it is ok NOT to show HELD orders in open orders, since they are not open yet, they are held, I can create: show me held orders function as well

b0noI commented 3 months ago

hmmm, actaully API does not support HELD orders :( any suggestions?

seralekseenko commented 3 months ago

Well, maybe we will create our own mini backend that stores active orders in the mini database. And in general, it keeps a history of operations — this will allow you to count the results of operations right here, instead of asking the Alpaca server. But this is an idea for the distant future... Now it is important to work out the basic functions.

b0noI commented 3 months ago

this is possible, but this would required separate feature request (create DB) with own design, going to close this one and let's create separate feature request when time is right