query
Query WDS account and order information
Description
specifies additional options using one or more name-value pair arguments. For
example, d = query(c,q,Name,Value)'LogonID','1' returns information filtered by the login
identifier.
Examples
Using a WDS connection, log in to the WDS order management system and query for account information.
Create a WDS connection.
c = wind;
Log in to the WDS order management system using the WDS connection. Specify the broker, branch, user name, password, and account type.
broker = "0000"; branch = "0"; capitalaccount = "1234567891011"; password = "abcdefghi"; accttype = "SHSZ"; dlogin = tradelogin(c,broker,branch, ... capitalaccount,password,accttype)
d =
1×5 table
LogonID LogonAccount AccountType ErrorCode ErrorMsg
_______ _______________ ___________ _________ ________
1 '1234567891011' 'SZSHA' 0 '' d is a table with these variables:
Login identifier
Account number
Account type
Error code
Error message
If the error code is 0 and the message is an empty
character vector, then the login is successful.
Query for account information using the WDS connection and the
Account query term.
q = 'Account';
d = query(c,q)d =
4×10 table
ShareholderStatus MainShareholderFlag AccountType MarketType Shareholder AssetAccount Customer Seat ErrorCode ErrorMsg
_________________ ___________________ ___________ __________ ____________ _______________ _____________ _________ _________ ________
48 0 'SZSHA' 'SH' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
48 0 'SHB' 'SH' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
48 0 'SZSHA' 'SZ' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
48 0 'SZB' 'SZ' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
d is a table with these variables:
Shareholder status
Shareholder flag
Account type
Market type
Shareholder
Account number
Customer number
Seat
Error code
Error message
Log out from the WDS order management system using the login identifier
returned by the tradelogin function.
logonid = dlogin.LogonID; d = tradelogout(c,logonid)
d =
1×3 table
LogonID ErrorCode ErrorMsg
_______ _________ ________
'1' 0 'logout'd is a table with these variables:
Login identifier
Error code
Error message
Close the WDS connection.
close(c)
Using a WDS connection, log in to the WDS order management system and query for account information by using the login identifier.
Create a WDS connection.
c = wind;
Log in to the WDS order management system using the WDS connection. Specify the broker, branch, user name, password, and account type.
broker = "0000"; branch = "0"; capitalaccount = "1234567891011"; password = "abcdefghi"; accttype = "SHSZ"; d = tradelogin(c,broker,branch, ... capitalaccount,password,accttype)
d =
1×5 table
LogonID LogonAccount AccountType ErrorCode ErrorMsg
_______ _______________ ___________ _________ ________
1 '1234567891011' 'SZSHA' 0 '' d is a table with these variables:
Login identifier
Account number
Account type
Error code
Error message
If the error code is 0 and the message is an empty character vector, then the login is successful.
Query for account information using the WDS connection, Account query
term, and login identifier. Use the login identifier returned by the
tradelogin function with the 'LogonID' name-value
pair argument.
q = 'Account'; logonid = d.LogonID; d = query(c,q,'LogonID',logonid)
d =
4×10 table
ShareholderStatus MainShareholderFlag AccountType MarketType Shareholder AssetAccount Customer Seat ErrorCode ErrorMsg
_________________ ___________________ ___________ __________ ____________ _______________ _____________ _________ _________ ________
48 0 'SZSHA' 'SH' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
48 0 'SHB' 'SH' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
48 0 'SZSHA' 'SZ' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
48 0 'SZB' 'SZ' '0123456789' '1234567891011' '12345678910' '0001000' 0 ''
d is a table with these variables:
Shareholder status
Shareholder flag
Account type
Market type
Shareholder
Account number
Customer number
Seat
Error code
Error message
Log out from the WDS order management system using the login identifier.
d = tradelogout(c,logonid)
d =
1×3 table
LogonID ErrorCode ErrorMsg
_______ _________ ________
'1' 0 'logout'd is a table with these variables:
Login identifier
Error code
Error message
Close the WDS connection.
close(c)
Input Arguments
WDS connection, specified as a connection object created with the wind function.
Query term, specified as one of these values.
| Query Term Value | Description |
|---|---|
| WDS account information |
| Current account values |
| Credit status associated with the WDS account |
| Credit position |
| Debt status associated with the WDS account |
| User name information |
| Orders associated with the WDS account |
| Portfolio information from asset management system |
| Portfolio positions associated with the WDS account |
| Securities lending information |
| Trading information for the current day |
You can specify these values using character vectors or string scalars.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
Example: d = query(c,'Order','LogonID','1','OrderNumber','12')
returns order information, filtered by the login identifier, for orders that have
order number '12'.
Login identifier, specified as the comma-separated pair consisting of
'LogonID' and a character vector or string
scalar. Set the value of the 'LogonID' name-value
pair argument by using the LogonID variable in the
d output argument of the tradelogin function.
For example, d = query(c,'Order','LogonID','1')
returns order information only for the orders associated with the login
identifier '1'.
Example: '1'
Data Types: char | string
Request identifier, specified as the comma-separated pair consisting
of 'RequestID' and a character vector or string
scalar. Set the value of the 'RequestID' name-value
pair argument by using the RequestID variable in the
d output argument of the createorder function.
For example, d = query(c,'Order','RequestID','12')
returns order information only for the orders associated with the
request identifier '12'.
Example: "27"
Data Types: double
Order number, specified as the comma-separated pair consisting of
'OrderNumber' and a character vector or string
scalar. To find the value, set the q input argument
of the query function to
'Order'. Then, use the OrderNumber
variable in the d output argument of the
query function.
For example, d =
query(c,'Order','OrderNumber','10') returns order
information only for the orders associated with the order number
'10'.
Example: "6"
Data Types: double
Order type, specified as the comma-separated pair consisting of
'OrderType' and the value
'All' for all orders or
'Withdrawable' for orders that can be
withdrawn.
For example, d = query(c,'Order','OrderType','All')
returns all order types.
Portfolio number, specified as the comma-separated pair consisting of
'PortfolioNo' and a character vector or string
scalar.
For example, d =
query(c,'Portfolio','PortfolioNo','3') returns portfolio
information for the portfolio number '3'.
Example: '3'
Data Types: char | string
Output Arguments
Account information about the account, order, and portfolio, returned as a
table. The variables in the table depend on the specified query in the
q input argument.
For details about these variables, contact Wind Information Co., Ltd.
WDS error identifier, returned as a numeric scalar. The value 0 indicates a
successful execution of the query function. Otherwise, for
details about the error, contact Wind Information Co., Ltd.
Version History
Introduced in R2018a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)