How to get all closed orders?
How to get all closed orders?
29 Aug 2013, 23:10
How can I get all closed orders?
I guess Positions will only give me open positions?
Is there some class that I can use?
Replies
stoko
30 Aug 2013, 11:31
RE: RE:
tradermatrix said:
stoko said:
How can I get all closed orders?
I guess Positions will only give me open positions?
Is there some class that I can use?
foreach (var openedPosition in Account.Positions)
{Trade.Close(openedPosition);
}
foreach (var pendingOrder in Account.PendingOrders)
{Trade.DeletePendingOrder(pendingOrder);
}
I do not want to close orders. I want to read/get all closed orders.
@stoko
atrader
30 Aug 2013, 15:53
You can have a robot that logs all the account open positions to a file and then continuously cross checks the positions in the file against the currently open positions under the account and the ones that do not correspond to the ones in the file have been closed.
Maybe you can log the closed ones to another file which can be accessed by other robots.
Or you will just have the one file which logs each time a position has been opened and then in your robots you just compare the open positions to the ones in the file.
@atrader
tradermatrix
30 Aug 2013, 10:51
RE:
stoko said:
foreach (var openedPosition in Account.Positions)
{
Trade.Close(openedPosition);
}
foreach (var pendingOrder in Account.PendingOrders)
{
Trade.DeletePendingOrder(pendingOrder);
}
@tradermatrix