Skip to content

HistoricalOrders

Summary

Provides access to methods of the Historical Orders collection

Signature

1
public abstract interface HistoricalOrders

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 using cAlgo.API;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None)]
 public class TestExample : Robot
 {
     protected override void OnStart()
     {
         Print($"HistoricalOrders Count: {HistoricalOrders.Count}");
         foreach (var historicalOrder in HistoricalOrders)
         {
             Print($"Id: {historicalOrder.Id} | OrderType: {historicalOrder.OrderType} | TradeType: {historicalOrder.TradeType} | Time: {historicalOrder.SubmittedTime}");
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 import clr
 clr.AddReference("cAlgo.API")
 # Import cAlgo API types
 from cAlgo.API import *
 # Import trading wrapper functions
 from robot_wrapper import *
 class Test():
     def on_start(self):
         print(f"HistoricalOrders Count: {api.HistoricalOrders.Count}")
         for historicalOrder in api.HistoricalOrders:
             print(f"Id: {historicalOrder.Id} | OrderType: {historicalOrder.OrderType} | TradeType: {historicalOrder.TradeType} | Time: {historicalOrder.SubmittedTime}")

See Also

Methods

FindById

Summary

Finds a historical order by Id.

Signature

1
public abstract HistoricalOrder FindById(int id)

Parameters

Name Type Description
id int Historical order Id

Return Value

HistoricalOrder

FindLast (3)

FindLast (1 of 3)

Summary

Finds last historical order by label.

Signature

1
public abstract HistoricalOrder FindLast(string label)

Parameters

Name Type Description
label string Historical order label

Return Value

HistoricalOrder

FindLast (2 of 3)

Summary

Finds last historical order by label and symbol name.

Signature

1
public abstract HistoricalOrder FindLast(string label, string symbolName)

Parameters

Name Type Description
label string Historical order label
symbolName string Historical order symbol name

Return Value

HistoricalOrder

FindLast (3 of 3)

Summary

Finds last historical order by label, symbol name, and trade type.

Signature

1
public abstract HistoricalOrder FindLast(string label, string symbolName, TradeType tradeType)

Parameters

Name Type Description
label string Historical order label
symbolName string Historical order symbol name
tradeType TradeType Historical order trade type

Return Value

HistoricalOrder

FindAll (3)

FindAll (1 of 3)

Summary

Finds historical orders by label.

Signature

1
public abstract HistoricalOrder[] FindAll(string label)

Parameters

Name Type Description
label string Historical order label

Return Value

HistoricalOrder[]

FindAll (2 of 3)

Summary

Finds historical orders by label and symbol name.

Signature

1
public abstract HistoricalOrder[] FindAll(string label, string symbolName)

Parameters

Name Type Description
label string Historical order label
symbolName string Historical order symbol name

Return Value

HistoricalOrder[]

FindAll (3 of 3)

Summary

Finds historical orders by label, symbol name, and trade type.

Signature

1
public abstract HistoricalOrder[] FindAll(string label, string symbolName, TradeType tradeType)

Parameters

Name Type Description
label string Historical order label
symbolName string Historical order symbol name
tradeType TradeType Historical order trade type

Return Value

HistoricalOrder[]

Properties

Item

Signature

1
public abstract HistoricalOrder Item {get;}

Return Value

HistoricalOrder

Count

Summary

Returns count of historical orders.

Signature

1
public abstract int Count {get;}

Return Value

int