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

 Syntax

 Public Function PendingOrdersReport (ClientID As Long, FromDate As String, ToDate As String, AccountID As Integer, OrderType As Integer, Lots As Double, SymbolID As Integer, Price As Double,Optional ByVal isPaging As Boolean = False) As String

Description

The PendingOrdersReport operation is used to get pending orders report that shows all current pending limit/stop orders and SL/TP orders in your
whole system or for the certain given client id. 

Request Parameters

Name Description  Required
ClientID
  • Client identifier to get pending orders 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 

AccountID
  • The report will show the pending orders for this account
  • Type: Long
  • Default : none
  • 0 means for all account numbers 


Yes  
OrderType
  • The report will show the current pending limit/stop order or SLTP order
  • Type : Integer
  • Default : none
  • Can be one of the following
         1: buy limit type
        -1: sell limit type
         2: Buy stop Type
        -2: sell stop type 

 

 

 

 Yes 

Lots
  • The report will show the current pending orders on this amount
  • Type  : double
  • Default : none
  • 0 means for all amounts 

 

Yes  

SymbolID  
  • The report will show the pending orders that takes on  this symbol ID
  • Type : Integer
  • Default : None
  • 0 : means for all Symbol
 

Yes 
Price
  • The report will show the pending orders that takes on this  price
  • Type : Integer
  • Default : None
  • 0 : means for all prices

 

Yes  

 isPaging
  • Boolean value which indicate that you are calling PendingOrdersReport  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 PendingOrdersReport  List = -1200 

 


Response Elements

Name Description 
 Result

The operation returns list of type PendingOrdersReport, otherwise an explicit error code is returned if ClientID  is less than 0 .

The Following are the PendingOrdersReport data member

  • ClientID : Client Identifier 
  • AccountID : Account Identifier 
  • OrderID: Order  Number 
  • Type : order Type 
               2 : limit/Stop
               3 : SLTP order
  • BuySell: 1 : means buy/buy limit
                 -1 : means sell/Sell Limit
                  2 : means buy stop            
                 -2 : means Sell stop
  • Amount : Amount of each pending order
  • SymbolIDpending  Symbol Id
  • Price: Pending order Price
  • SL : pending stop loss value
  • TP : take profit value
  • DateTime : placed pending order time
  • SymbolName : pending order symbol name


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>PendingOrdersReport</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script type="text/javascript" >
var PendingTable;
$(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 + "/PendingOrdersReport",
dataType: "jsonp",
data: { "ClientID ": $("#txtClientID ").val(), "FromDate": $("#txtFromDate").val(), "ToDate": $("#txtToDate").val(), "AccountID": $("#txtAccountID").val() , "OrderType": $("#txtOrderType").val() , "Lots": $("#txtLots").val(), "SymbolID": $("#txtSymbolID").val(), "Price": $("#txtPrice").val(), "isPaging": $("#txtisPaging").val()},
success: function (Pending) {
Pending = eval('(' + Pending + ')');
var result;
if (Pending == undefined || Pending == null || Pending.length == 0) {
result = "No data found";
$("#resultAction").html(result);
}
else if (Pending[0].ClientID < 0 && Pending[0].ClientID > -1000) {
result = "No data found error code " + Pending[0].ClientID ;
$("#resultAction").html(result);
}
else if (Pending[0].ClientID > 0 || Pending[0].ClientID == -1200) {
PendingTableHeader();
for (var i = 0; i < Pending.length; i++) {
fillPendingTable(Pending[i]);
}
PendingTable += "</tbody></table>";
}
$("#resultData").html(PendingTable);
},
error: onErrorResult
});
});
});

function PendingTableHeader() {
PendingTable = "";
PendingTable = "<table border='1px'><thead><tr>";
PendingTable += "<th> AccountID </th> <th>OrderID</th><th >Type</th><th >BuySell</th>";
PendingTable += "<th>Amount</th><th>SymbolID</th><th>SymbolName</th><th>Price</th>";
PendingTable += "<th>SL</th><th>TP</th><th>DateTime</th><th>ClientID</th>";
PendingTable += "</thead><tbody>";
}

function fillPendingTable(Pending) {

PendingTable += "<tr><td>" + Pending.AccountID + "</td>";
PendingTable += "<td>" + Pending.OrderID + "</td>";
PendingTable += "<td>" + Pending.Type + "</td>";
PendingTable += "<td>" + Pending.BuySell + "</td>";
PendingTable += "<td>" + Pending.Amount + "</td>";
PendingTable += "<td>" + Pending.SymbolID + "</td>";
PendingTable += "<td>" + Pending.SymbolName + "</td>";
PendingTable += "<td>" + Pending.Price + "</td>";
PendingTable += "<td>" + Pending.SL + "</td>";
PendingTable += "<td>" + Pending.TP + "</td>";
PendingTable += "<td>" + Pending.DateTime + "</td>";
PendingTable += "<td>" + Pending.ClientID + "</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>
AccountID : <input type="text" id="txtAccountID" value="0"/>
OrderType : <input type="text" id="txtOrderType" value="0"/>
Lots : <input type="text" id="txtLots" value="0"/>

</td>
</tr>
<tr>
<td>
SymbolID : <input type="text" id="txtSymbolID" value="0"/>
Price : <input type="text" id="txtPrice" value="0"/>
isPaging : <input type="text" id="txtisPaging" value="False"/>

</td>
</tr>
<tr>
<td>
<button id="btnAction"> PendingOrdersReport </button>

</td>
</tr>

</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
</body>
</html>

 


See Also


VertexFX Backoffice WCF Service Index

BuySell

(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