Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
themeRDark
titleC# - GetTradeOrders
linenumberstrue
collapsetrue
//Use the GetTradeOrders method to get all trading related orders with a certain reference in the BFS instance and write
//the information in the console
var client = new BFSServiceReference.bfsapiSoapClient();

var credentials = new BFSServiceReference.Credentials()
{
    UserName = bfsusername, //Username of administrative user in your instance of BFS
    Password = bfspassword, //Password of the administrative user in your instance of BFS
};

var accounttypes = client.GetTradeOrders(new BFSServiceReference.GetTradeOrdersRequest()
{
    Credentials = credentials,

    identify = bfsidentifier, //Identifier is a unique token for your instance of BFS  

    Args = new GetTradeOrdersArgs()
    {
        ExternalReference = "MyTestOrder"

    },

    Fields = new BFSServiceReference.GetTradeOrderFields()
    {
        BrickId = true,
        TradeOrderType = true,
        Account = true,
        CashAmount = true,
        InstrumentAmount = true,
        TradeOrderDirectionKey = true,
        Instrument = true,
        Cash = true,
        Price = true,
        State = true,
        IsUnitOrder = true,
        OrderNo = true,
        LimitPrice = true,
        CashTradeDate = true,
        CashSettlementDate = true,
        InstrumentTradeDate = true,
        InstrumentSettlementDate = true,
        ExternalReference = true,
        OrderSettlementType = true,
        ExecutionInterfaceKey = true,
        AllocationOrder = true,
        AllocationInstance = true,
        CreatedDate = true,
        ExecutionInterface = true,
        IsPrePayed = true,
		ExternalFundBatchOrder = true,
    },
});

foreach (var c in accounttypes.Result)
{
    Console.WriteLine(c.BrickId + ","
        + c.TradeOrderType
        + ","
        + c.Account
        + ","
        + c.CashAmount
        + ","
        + c.InstrumentAmount
        + ","
        + c.TradeOrderDirectionKey
        + ","
        + c.Instrument
        + ","
        + c.Cash
        + ","
        + c.Price
        + ","
        + c.State
        + ","
        + c.IsUnitOrder
        + ","
        + c.OrderNo
        + ","
        + c.LimitPrice
        + ","
        + c.CashTradeDate
        + ","
        + c.CashSettlementDate
        + ","
        + c.InstrumentTradeDate
        + ","
        + c.InstrumentSettlementDate
        + ","
        + c.ExternalReference
        + ","
        + c.OrderSettlementType
        + ","
        + c.ExecutionInterfaceKey
        + ","
        + c.ExecutionInterface
        + ","
        + c.AllocationOrder
        + ","
        + c.AllocationInstance
        + ","
        + c.CreatedDate
        + ","
        + c.IsPrePayed
		+ ","
		+ c.ExternalFundBatchOrder

        );
}

 

Blog Posts
sortcreation
contenttitles
labelsCreateAccounts