HistoricalOrders.FindLast
method · HistoricalOrders · cAlgo.API Since 5.1
DesktopCLICloud
Finds last historical order by label.
Overloads
| Signature | Description |
|---|---|
FindLast(string label) | Finds last historical order by label. |
FindLast(string label, string symbolName) | Finds last historical order by label and symbol name. |
FindLast(string label, string symbolName, TradeType tradeType) | Finds last historical order by label, symbol name, and trade type. |
FindLast(string label)
Finds last historical order by label.
HistoricalOrder FindLast(string label)
api.HistoricalOrders.FindLast(label: str) -> HistoricalOrder | None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
label | string | str | Historical order label |
Returns HistoricalOrder — HistoricalOrder or null
Examples
var order = HistoricalOrders.FindLast("myLabel");
if (order != null)
Print("Last myLabel order {0} status: {1}", order.Id, order.Status);
order = api.HistoricalOrders.FindLast("myLabel")
if order is not None:
api.Print(f"Last myLabel order {order.Id} status: {order.Status}")
FindLast(string label, string symbolName)
Finds last historical order by label and symbol name.
HistoricalOrder FindLast(string label, string symbolName)
api.HistoricalOrders.FindLast(label: str, symbolName: str) -> HistoricalOrder | None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
label | string | str | Historical order label |
symbolName | string | str | Historical order symbol name |
Returns HistoricalOrder — HistoricalOrder or null
Examples
var order = HistoricalOrders.FindLast("myLabel", "EURUSD");
if (order != null)
Print("Last EURUSD order {0} submitted at {1}", order.Id, order.SubmittedTime);
order = api.HistoricalOrders.FindLast("myLabel", "EURUSD")
if order is not None:
api.Print(f"Last EURUSD order {order.Id} submitted at {order.SubmittedTime}")
FindLast(string label, string symbolName, TradeType tradeType)
Finds last historical order by label, symbol name, and trade type.
HistoricalOrder FindLast(string label, string symbolName, TradeType tradeType)
api.HistoricalOrders.FindLast(label: str, symbolName: str, tradeType: TradeType) -> HistoricalOrder | None
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
label | string | str | Historical order label |
symbolName | string | str | Historical order symbol name |
tradeType | TradeType | TradeType | Historical order trade type |
Returns HistoricalOrder — HistoricalOrder or null
Examples
var order = HistoricalOrders.FindLast("myLabel", "EURUSD", TradeType.Sell);
if (order != null)
Print("Last EURUSD sell order {0} type: {1}", order.Id, order.OrderType);
order = api.HistoricalOrders.FindLast("myLabel", "EURUSD", TradeType.Sell)
if order is not None:
api.Print(f"Last EURUSD sell order {order.Id} type: {order.OrderType}")