Syntax
Public Function MarketOrdersHistoryReport(ClientID As Long, FromDate As String, ToDate As String, OrderID As Integer, TicketID As Integer, AccountID As Long, TransType As String, OrderType As Integer, Amount As Double, SymbolID As Integer, Price As Double, IP As String, Status As Integer, WhoID As Integer, Optional ByVal isPaging As Boolean = False) As String
Description
The MarketOrdersHistoryReport operation is used to get market order history report that shows the entire market orders done in your whole system or for certain given client account(s)/Office(s).
Request Parameters
Name |
Description |
Required |
ClientID |
- Client identifier to get market order history report for
- Type : Long
- Default : None
- Constraints : Must be valid client Id and accessible by logged in dealer
|
Yes
|
FromDate |
- Specify the duration
- Type : String
- Default : None
- Constraints : must be valid date format (“DD/MM/YYYY HH:NN:SS”)
- “” : means from beginning
|
Yes
|
ToDate |
- Specify the duration
- Type : String
- Default : None
- Constraints : must be valid date format (“DD/MM/YYYY HH:NN:SS”)
- “” : means till now
|
Yes
|
OrderID |
- The report will show the report for this order number
- Type : Integer
- Default : none
- 0 means for all order
|
Yes
|
TicketID |
- The report will show this position
- Type : integer
- Default : none
- 0 means for all position
|
Yes
|
AccountID |
- The report will show the market order for this account id
- Type: Long
- Default : none
- 0 means for all account numbers
|
Yes |
TransType |
- The type of the transaction
- Type : String
- Default : none
- Can be one of the following
“” : all “CP” for closed position “OP” for open position "DL" for Delivery order
|
Yes
|
OrderType |
- The report will show the market order for this type
- Type : Integer
- Default : none
- Can be one of the following
0: all -1: sell 1: Buy
|
Yes
|
Amount |
- The report will show the market order on this amount
- Type : double
- Default : none
- 0 means for all amounts
|
Yes
|
SymbolID |
- The report will show thethe market order this symbol ID
- Type : Integer
- Default : None
- 0 : means for all Symbol
|
Yes |
Price |
- The report will show the market order on this price
- Type : Integer
- Default : None
- 0 : means for all prices
|
Yes
|
IP |
- The report will show the market order of this IP
- Type : String
- Default : None
- “” : Means for all IPs
|
Yes
|
Status |
- The report will show the market orders of this status
0 : All 20 : New Accepted 21 : invalid price 44 : quoted then Timer expired 45 : eqauted then client reject
|
Yes |
WhoID |
- The Id of Dealer or Client
- Type : Integer
- Default : None
- 0 : means for all
|
Yes
|
isPaging |
- Boolean value which indicate that you are calling MarketOrdersHistoryReport to get remaining records
- This is useful if you are calling a large amount of data to split the returned data as 3000 rows for each response
- Type : Boolean
- Default : False
- Constraints : on first call must be false and next calls true
|
Conditional if the first ClientID in MarketOrdersHistoryReport List = -1200
|
Response Elements
Name |
Description |
Result |
The operation returns list of type MarketOrderHisReport, otherwise an explicit error code is returned if ClientID is less than 0 .
The Following are the MarketOrderHisReport data member
- ClientID : Client identifier
- AccountID : Account identifier
- OrderID : order number
- TicketID : market order ticket number
- Type : CP : means close position
OP : means open position DL : means Delivery Order
- Status : the action which was done on each market order
20 : accepted 21 : invalid price 44 : requoted then timer expired 45 : requoted then client reject
- BuySell : 1 means Buy
-1 means Sell
- Amount : market order amount
- SymbolID : market order symbol Id
- Price : market order accepted price
- OldPrice : requested price before re-quoting
- WhoID : the dealer id that handle market order
- RequestedTime : the date and time when market order was requested
- CatchTime : the date and time when was received to the chatting screen
- DealerTime : the date and time when was dealer handled the market
- ClientTime : date and time when each requoted market order was handled from client side
- IP : IP address for the dealer who handle the market order
- SymbolName: market order symbol name
- DeliveryItem : delivery item for delivery orders
|
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MarketOrdersHistoryReport</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script>
$(document).ready(function () {
var urlStr = "http://173.249.35.43/webtrader/webservice.svc";
jQuery.support.cors = true;
$("#progress").ajaxStart(function () { $(this).css("display", "block"); });
$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });
$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });
function onSuccessResultt(dataResult) {
var result = eval(dataResult);
var rst = ""
if (result[0].ClientID > 0) {
for (var i = 0; i < result.length; i++) {
rst += "OrderID : " + result[i].OrderID + "<br/>"
rst += "TicketID : " + result[i].TicketID + "<br/>"
rst += "AccountID : " + result[i].AccountID + "<br/>"
rst += "Type : " + result[i].Type + "<br/>"
rst += "Status : " + result[i].Status + "<br/>"
rst += "BuySell : " + result[i].BuySell + "<br/>"
rst += "SymbolID : " + result[i].SymbolID + "<br/>"
rst += "Price : " + result[i].Price + "<br/>"
rst += "OldPrice : " + result[i].OldPrice + "<br/>"
rst += "WhoID : " + result[i].WhoID + "<br/>"
rst += "--------------------------------------------------" + "<br/>"
$("#resultAction").html(rst)
}
}
else {
$("#resultAction").html("Error Code : " + result[0].ClientID + "<br/>" );
}
}
function onSuccessResult(response) {
response = eval('(' + response + ')')
if (response.UserId == -1 || response.UserId == -207) {
$("#resultData").html("Invalid username or password");
}
else if (response.UserId == -231) {
$("#resultData").html("You must have at least one account");
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);
}
}
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.getJSON(urlStr + "/BackofficeLogin?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?" , onSuccessResult);
});
$("#btnAction").click(function () {
$.getJSON(urlStr + "/MarketOrdersHistoryReport?ClientID="+ $("#txtClientID").val() + "&FormDate=" + $("#txtFromDate").val() + "&ToDate=" + $("#txtToDate").val() + "&OrderID=" + $("#txtOrderID").val() + "&TicketID=" + $("#txtTicketID").val() + "&AccountID=" + $("#txtAccountID").val() + "&TransType=" + $("#txtTransType").val() + "&OrderType=" + $("#txtOrderType").val() + "&Amount=" + $("#txtAmount").val() + "&SymbolID=" + $("#txtSymbolID").val( ) + "&Price=" + $("#txtPrice").val() + "&IP=" + $("#txtIP").val() + "&Status=" + $("#txtStatus").val() + "&WhoID=" + $("#txtWhoID").val() + "&isPaging=" + $("#txtIsPaging").val() + "&callback=?", onSuccessResultt);
});
});
</script>
<body>
<table border="1px">
<tbody>
<tr>
<td>
Username: <input type="text" id="txtusername" value=""/>
Password: <input type="text" id="txtpassword" value=""/>
<button id="btnLogin"> Login </button>
</td>
</tr>
<tr>
<td>
ClientID : <input type="text" id="txtClientID" value ="" />
FromDate : <input type="text" id="txtFromDate" value=""/>
ToDate : <input type="text" id="txtToDate" value="" />
</td>
</tr>
<tr>
<td>
OrderID : <input type="text" id="txtOrderID" value="0"/>
TicketID : <input type="text" id="txtTicketID" value="0"/>
AccountID : <input type="text" id="txtAccountID" value="0"/>
</td>
</tr>
<tr>
<td>
TransType : <input type="text" id="txtTransType" value=""/>
OrderType : <input type="text" id="txtOrderType" value="0"/>
Amount : <input type="text" id="txtAmount" value="0"/>
</td>
</tr>
<tr>
<td>
SymbolID : <input type="text" id="txtSymbolID" value="0"/>
Price : <input type="text" id="txtPrice" value="0"/>
IP : <input type="text" id="txtIP" value=""/>
</td>
</tr>
<tr>
<td>
Status : <input type="text" id="txtStatus" value="0"/>
WhoID : <input type="text" id="txtWhoID" value="0"/>
IsPaging : <input type="text" id="txtIsPaging" value="FALSE"/>
</td>
</tr>
<tr>
<td>
<button id="btnAction"> MarketOrdersHistoryReport </button>
</td>
</tr>
</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
</body>
</html>
See Also
VertexFX Backoffice WCF Service Index
|