Live Chat Software by Hybrid Solutions
MarketOrdersHistoryReport
Posted by Angham Banawien on 06 November 2017 03:59 PM

 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 IntegerOptional 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 

 

 

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
  • 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 type="text/javascript" >
var MarketHTable;
$(document).ready(function () {
var urlStr = "http://5.10.64.199/vertexweb10/WebService.svc";
$.support.cors = true;
$.ajaxSetup({ cash: false });
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 () {
$.ajax({
type: 'GET',
url: urlStr + "/BackofficeLogin",
dataType: "jsonp",
data: { "username": $("#txtusername").val(), "password": $("#txtpassword").val() },
ProcessData: false,
success: onSuccessResult,
error: onErrorResult
});
});

$("#btnAction").click(function () {
$.ajax({
type: 'GET',
url: urlStr + "/MarketOrdersHistoryReport",
dataType: "jsonp",
data: { "ClientID ": $("#txtClientID ").val(), "FromDate": $("#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()}
success: function (MarketH) {
MarketH = eval('(' + MarketH + ')');
var result;
if (MarketH == undefined || MarketH == null || MarketH.length == 0) {
result = "No data found";
$("#resultAction").html(result);
}
else if (MarketH[0].ClientID < 0 && MarketH[0].ClientID > -1000) {
result = "No data found";
$("#resultAction").html(result);
}
else if (MarketH[0].ClientID > 0 || MarketH[0].ClientID == -1200) {
MarketHTableHeader();
for (var i = 0; i < MarketH.length; i++) {
fillMarketHTable(MarketH[i]);
}
MarketHTable += "</tbody></table>";
}
$("#resultData").html(MarketHTable);
},
error: onErrorResult
});
});
});

function MarketHTableHeader() {
MarketHTable = "";
MarketHTable = "<table border='1px'><thead><tr>";
MarketHTable += "<th> OrderID </th> <th>TicketID</th><th >Type</th><th >Status</th>";
MarketHTable += "<th>BuySell</th><th>Amount</th><th>SymbolID</th><th>Price</th>";
MarketHTable += "<th>OldPrice</th><th>WhoID</th><th>RequestedTime</th><th>CatchTime</th><th>DealerTime</th><th>ClientTime</th><th>IP</th><th>SymbolName</th><th>ClientID</th><th>DeliveryItem</th>";
MarketHTable += "</thead><tbody>";
}

function fillMarketHTable(MarketH) {

MarketHTable += "<tr><td>" + MarketH.OrderID + "</td>";
MarketHTable += "<td>" + MarketH.TicketID + "</td>";
MarketHTable += "<td>" + MarketH.AccountID + "</td>";
MarketHTable += "<td>" + MarketH.Type + "</td>";
MarketHTable += "<td>" + MarketH.Status + "</td>";
MarketHTable += "<td>" + MarketH.BuySell + "</td>";
MarketHTable += "<td>" + MarketH.Amount + "</td>";
MarketHTable += "<td>" + MarketH.SymbolID + "</td>";
MarketHTable += "<td>" + MarketH.Price + "</td>";
MarketHTable += "<td>" + MarketH.OldPrice + "</td>";
MarketHTable += "<td>" + MarketH.WhoID + "</td>";
MarketHTable += "<td>" + MarketH.RequestedTime + "</td>";
MarketHTable += "<td>" + MarketH.CatchTime + "</td>";
MarketHTable += "<td>" + MarketH.DealerTime + "</td>";
MarketHTable += "<td>" + MarketH.ClientTime + "</td>";
MarketHTable += "<td>" + MarketH.IP + "</td>";
MarketHTable += "<td>" + MarketH.SymbolName + "</td>";
MarketHTable += "<td>" + MarketH.DeliveryItem + "</td> </tr>";

}

</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

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions