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
Query Account Information
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)
Query Account Information Using Login Identifier
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
c
— WDS connection
connection object
WDS connection, specified as a connection object created with the wind
function.
q
— Query term
'Capital'
| 'Position'
| 'Order'
| ...
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'
.
LogonID
— Login identifier
character vector | string scalar
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
RequestID
— Request identifier
character vector | string scalar
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
OrderNumber
— Order number
character vector | string scalar
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
OrderType
— Order type
'All'
(default) | 'Withdrawable'
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.
PortfolioNo
— Portfolio number
character vector | string scalar
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
d
— Account information
table
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.
e
— WDS error identifier
numeric scalar
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 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)