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

 Syntax

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

Description

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

Request Parameters

Name Description  Required
 ClientID
  • Client identifier to get net open position 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 transaction 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 NetOpenPositionsReport 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 NetOpenPositionsReport List = -1200 

 


Response Elements

Name Description 
 Result

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

The Following are the NetPositionReport data member

  • ClientID : Client Identifier 
  • AccountID : Account Identifier 
  • BuySellBalance value  
  • Amount: 1 : means buy type
                  -1 : means Sell Type
  • SymbolIDnet open position Symbol Id
  • AvgPrice: average open price 
  • SymbolName : net 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>NetOpenPositionsReport</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script type="text/javascript" >
var NetOpenTable;
$(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 + "/NetOpenPositionsReport",
dataType: "jsonp",
data: { "ClientID ": $("#txtClientID ").val(), "AccountType": $("#txtAccountType").val(), "SymbolID": $("#txtSymbolID").val(), "PositionType": $("#txtPositionType").val() , "isPaging": $("#txtisPaging").val() },
success: function (NetOpen) {
NetOpen = eval('(' + NetOpen + ')');
var result;
if (NetOpen == undefined || NetOpen == null || NetOpen.length == 0) {
result = "No data found";
$("#resultAction").html(result);
}
else if (NetOpen[0].ClientID < 0 && NetOpen[0].ClientID > -1000) {
result = "No data found";
$("#resultAction").html(result);
}
else if (NetOpen[0].ClientID > 0 || NetOpen[0].ClientID == -1200 ) {
NetOpenTableHeader();
for (var i = 0; i < NetOpen.length; i++) {
fillNetOpenTable(NetOpen[i]);
}
NetOpenTable += "</tbody></table>";
}
$("#resultData").html(NetOpenTable);
},
error: onErrorResult
});
});
});

function NetOpenTableHeader() {
NetOpenTable = "";
NetOpenTable = "<table border='1px'><thead><tr>";
NetOpenTable += "<th> AccountID </th> <th>BuySell</th><th >Amount</th><th >SymbolID</th>";
NetOpenTable += "<th>SymbolName</th><th>AvgPrice</th><th>ClientID</th>";
NetOpenTable += "</thead><tbody>";
}

function fillNetOpenTable(NetOpen) {

NetOpenTable += "<tr><td>" + NetOpen.AccountID + "</td>";
NetOpenTable += "<td>" + NetOpen.BuySell + "</td>";
NetOpenTable += "<td>" + NetOpen.Amount + "</td>";
NetOpenTable += "<td>" + NetOpen.SymbolID + "</td>";
NetOpenTable += "<td>" + NetOpen.SymbolName + "</td>";
NetOpenTable += "<td>" + NetOpen.AvgPrice + "</td>";
NetOpenTable += "<td>" + NetOpen.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 ="" />
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="0"/>
<button id="btnAction"> NetOpenPositionsReport </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