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

 Syntax

 Public Function DetailedOpenPositionsReport(ClientID As Long, AccountType As Integer, SymbolID As Integer, PositionType As Integer, Optional ByVal isPaging As Boolean = False) As String

Description

The DetailedOpenPositionsReport operation is used to get detailed open positions report that shows the open position details for all accounts
under the given client number. 

Request Parameters

Name Description  Required
 ClientID
  • Client identifier to get  detailed open positions report for
  • Type : Long
  • Default : None
  • Constraints : Must be valid client Id and accessible by logged in dealer

 

Yes

AccountType  
  • Type of account that want to get account status report for
  • Type : Integer
  • Default : none
  • Can be one of the following :
          1 : Normal Account
          2 : Coverage Account


Yes  
SymbolID  
  • The report will show the open position detailed  for this symbol ID
  • Type : Integer
  • Default : None
  • 0 : means for all Symbol
 

Yes 
PositionType
  • The report will shows the net open position details for this type
  • Type : Integer
  • Default : None
  • Can be one of the following
          0 : all
          1 : Buy type
         -1 : sell type 

 



Yes  

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

 


Response Elements

Name Description 
 Result

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

The Following are the DetailedPositionReport data member

  • ClientID : Client Identifier 
  • AccountID : Account Identifier 
  • TicketIDTicket Number 
  • Time : open Time 
  • BuySell: 1 : means buy type
                 -1 : means Sell Type
  • Amount : open position Amount
  • SymbolIDopen position Symbol Id
  • Price: position price 
  • Commission : commission value
  • SymbolName : open position 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>DetailedOpenPositionsReport</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script type="text/javascript" >
var DetailedTable;
$(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 + "/DetailedOpenPositionsReport",
dataType: "jsonp",
data: { "ClientID ": $("#txtClientID ").val(), "AccountType": $("#txtAccountType").val(), "SymbolID": $("#txtSymbolID").val(), "PositionType": $("#txtPositionType").val() , "isPaging": $("#txtisPaging").val() },
success: function (Detailed) {
Detailed = eval('(' + Detailed + ')');
var result;
if (Detailed == undefined || Detailed == null || Detailed.length == 0) {
result = "No data found";
$("#resultAction").html(result);
}
else if (Detailed[0].ClientID < 0 && Detailed[0].ClientID > -1000) {
result = "No data found error code " + Detailed[0].ClientID ;
$("#resultAction").html(result);
}
else if (Detailed[0].ClientID > 0) {
DetailedTableHeader();
for (var i = 0; i < Detailed.length; i++) {
fillDetailedTable(Detailed[i]);
}
DetailedTable += "</tbody></table>";
}
$("#resultData").html(DetailedTable);
},
error: onErrorResult
});
});
});

function DetailedTableHeader() {
DetailedTable = "";
DetailedTable = "<table border='1px'><thead><tr>";
DetailedTable += "<th> AccountId </th> <th>TicketID</th><th >Time</th><th >BuySell</th>";
DetailedTable += "<th>Amount</th><th>SymbolID</th><th>SymbolName</th>";
DetailedTable += "<th>Price</th><th>ClientID</th><th>Commission</th>";
DetailedTable += "</thead><tbody>";
}

function fillDetailedTable(Detailed) {

DetailedTable += "<tr><td>" + Detailed.AccountId + "</td>";
DetailedTable += "<td>" + Detailed.TicketID + "</td>";
DetailedTable += "<td>" + Detailed.Time + "</td>";
DetailedTable += "<td>" + Detailed.BuySell + "</td>";
DetailedTable += "<td>" + Detailed.Amount + "</td>";
DetailedTable += "<td>" + Detailed.SymbolID + "</td>";
DetailedTable += "<td>" + Detailed.SymbolName + "</td>";
DetailedTable += "<td>" + Detailed.Price + "</td>";
DetailedTable += "<td>" + Detailed.ClientID + "</td>";
DetailedTable += "<td>" + Detailed.Commission + "</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 ="" />
AccountType : <input type="text" id="txtAccountType" value=""/>
SymbolID : <input type="text" id="txtSymbolID" value="" />
</td>
</tr>
<tr>
<td>
PositionType : <input type="text" id="txtPositionType" value="0"/>
isPaging : <input type="text" id="txtisPaging" value="False"/>
<button id="btnAction"> DetailedOpenPositionsReport </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