deleteorder
Cancel WDS order
Description
specifies additional options using one or more name-value pair arguments. For
example, d
= deleteorder(c
,orderno
,Name,Value
)'TradePassword',"abcdefghi"
specifies the password for
the WDS order management system.
Examples
Delete Order
Using a WDS connection, log in to the order management system, create a buy order for a single security, and delete the order.
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);
Create a buy order of 100 shares of the 600000.SH
security using the WDS connection. Buy shares with the order price
12.0
, specified in the CNY currency.
s = '600000.SH'; direction = 'buy'; price = '12.0'; quantity = '100'; d = createorder(c,s,direction,price,quantity);
Query for the order number of the executed order and display the number.
d = query(c,'Order');
orderno = d.OrderNumber
orderno = '12'
This result assumes that the WDS order management system contains only one valid order execution.
Delete the order using the WDS connection and the order number.
d = deleteorder(c,orderno)
d = 1×3 table OrderNumber ErrorCode ErrorMsg ___________ _________ _____________ '12' 0 'Sending ...'
d
is a table that contains these variables:
Order number
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);
Close the WDS connection.
close(c)
Delete Order Using Password
Using a WDS connection, log in to the order management system, create a buy order of a single security, and delete the order by using the account password.
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);
Create a buy order of 100 shares of the 600000.SH
security using the WDS connection. Buy shares with the order price
12.0
, specified in the CNY currency.
s = '600000.SH'; direction = 'buy'; price = '12.0'; quantity = '100'; d = createorder(c,s,direction,price,quantity);
Query for the order number of the executed order and display the number.
d = query(c,'Order');
orderno = d.OrderNumber
orderno = '12'
This result assumes that the WDS order management system contains only one valid order execution.
Delete the order using the WDS connection and the order number. Specify
the account password using the 'TradePassword'
name-value
pair argument.
d = deleteorder(c,orderno,'TradePassword',password)
d = 1×3 table OrderNumber ErrorCode ErrorMsg ___________ _________ _____________ '12' 0 'Sending ...'
d
is a table that contains these variables:
Order number
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);
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.
orderno
— Order number
character vector | string scalar
Order number, specified as a character vector or string scalar. To find
the order number, use the query
function with the query term
'Order'
.
Example: '12'
Data Types: char
| string
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 =
deleteorder(c,'12','LogonID','1','TradePassword',"abcdefghi")
cancels
the order, identified by the order number '12'
, in the WDS order
management system using the login identifier '1'
and the account
password "abcdefghi"
.
MarketType
— Security market identifier
'SZ'
| 'SH'
| 'OC'
| ...
Security market identifier, specified as one of these values.
Value | Description |
---|---|
| Shenzhen Stock Exchange |
| Shanghai Stock Exchange |
| National Equities Exchange and Quotations |
| Hong Kong Stock Exchange |
| Zhengzhou Commodity Exchange |
| Shanghai Futures Exchange |
| Dalian Commodity Exchange |
| China Financial Futures Exchange |
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.
Example: '1'
Data Types: char
| string
TradePassword
— Account password
character vector | string scalar
Account password, specified as the comma-separated pair consisting of 'TradePassword'
and a character vector or string scalar. For credentials, contact Wind Information Co., Ltd.
Example: "abcdefghi"
Data Types: char
| string
OrderPrice
— Order price
character vector | string scalar
Order price, specified as a character vector or string scalar. Specify the order price in the CNY currency.
For HK
only, use the
'OrderPrice'
name-value pair argument to change
the price of an existing order. If the 'OrderPrice'
and 'OrderVolume'
name-value pair arguments are not
specified, then the Wind Financial Terminal cancels the order.
Example: '30'
Data Types: char
| string
OrderVolume
— Order volume
character vector | string scalar
Order volume, specified as a character vector or string scalar.
For HK
only, use the
'OrderVolume'
name-value pair argument to change
the volume of an existing order. If the 'OrderPrice'
and 'OrderVolume'
name-value pair arguments are not
specified, then the Wind Financial Terminal cancels the order.
Example: '100'
Data Types: char
| string
Output Arguments
d
— Deletion information
table
Deletion information, returned as a table with these variables:
Order number
Error code
Error message
e
— WDS error identifier
numeric scalar
WDS error identifier, returned as a numeric scalar. The value 0
indicates a
successful execution of the deleteorder
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.
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)