GetSettledStatus
Posted by Angham Al-Banawien, Last modified by Laith Ghawi on 03 July 2019 11:01 AM

 Syntax

 Function GetSettledStatus(ClientID As Long, FromDate As String, ToDate As String, Optional ByVal LastXDays As Integer = 0, Optional ByVal SymbolID As Integer = 0) As String

Description

The GetSettledStatus operation is used to get the settled Status report for a specific given client number between a specific period.

Request Parameters

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

 

Yes

 FromDate
  • The starting date of settled status if lastXDays = 0
  • Type : String
  • Date in format “DD/MM/YYYY HH:mm:ss
  • “” : means from Beginning

 

 Yes

 ToDate
  • The ending date of settled status if lastXDays = 0
  • Type : String
  • Date in format “DD/MM/YYYY HH:mm:ss
  • “” : means till now

 

 Yes

 LastXDays
  • To Get settled status for the last certain days
  • Type : Integer.
  • Default : 0
  • Constraints : must be one of the following :
    0 : for custom period

    1 : For last day
    2 : For last two days
    4 : For last four days
    7 : For last week
    14 : For last two weeks
    30 : for last month
    60 : for last two months

 

 No

 SymbolID
  • Symbol identifier to get settled status for
  • Type : Integer
  • Default = 0
  • Constraints : Must be valid Symbol Id
  • 0 : Means For all Symbol

 

 No


Response Elements

Name Description 
 Result

The operation return list of FloatingSettled in case success , otherwise an explicit error code is returned

The Following are the FloatingSettled data member

  • Symbol : Symbol Name
  • SymbolID : Symbol Identifier
  • NormalBuyPrice : Average open Prices for all buy    position of the specific symbol for normal account.
  • NormalbuyClose : Average close Prices for all buy position of the specific Symbol for normal account.
  • NormalBuyLot : The total lots for all buy positions of the specific symbol for normal account .
  • NormalSellPrice : Average open price for all sell Positions of the specific Symbol for normal account .
  • NormalSellClose: average close Prices for all sell positions of the specific symbol for normal account.
  • NormalSelllot : the total lots for all sell positions of the specific symbolfor normal account.
  • NormalprofitLoss : The total profit/loss for all positions of the specific symbol for normal account.
  • NormalDeal : The total deals for all position of the specific symbol for normal account
  • CovBuyPrice : Average open prices for all buy positions of the specific symbol for a coverage account.
  • CovBuyCloseAverage close prices for all buy positions of the specific symbol for a coverage account.
  • CovBuyLot : the total lots for all buy positions of the specific symbol for a coverage account.
  • CovSellPrice: Average open price for all sell positions of the specific symbol for coverage account.
  • CovSellClose : Average close prices for all sell positions of the specific symbol for coverage account. 
  • CovSellLot :Total lots for all sell positions of the specific symbol for a coverage account.
  • CovProfitLoss: The total profit loss for all positions of the specific symbol for a coverage account.
  • CovDeal : the total deals for all positions of the specific symbol for the coverage account.
  • NormalBuyRefBidPrice : The average bid price for all buy position of the reference symbol for a normal account.
  • NormalBuyRefAskPrice : The average ASK price for all buy position  of the reference symbol for a normal account
  • CovBuyRefBidPrice : The average Bid price for all buy positions of the reference symbol for coverage account.
  • CovBuyRefAskPrice : The average Ask price for all buy positions of the reference symbol for coverage account.
  • CovSellRefBidPrice : The average Bid prices for all sell positions of the reference symbol for the coverage account.
  • CovSellRefAskPrice : The average Ask prices for all sell positions of the reference symbol for the coverage account.
  • NormalSellRefBidPrice : The average Bid prices for all sell positions of the reference symbol for the normal account.
  • NormalSellRefAskPrice : The average Ask prices for all sell positions of the reference symbol for the normal account
  • NetLot : The net not covered lot (NormalBuyLot – NormalSelllot) – (CovBuyLot – CovSellLot)
  • NetProfit : The net Profit/loss ,(CovProfitLoss + NormalprofitLoss)
  • TotalNormalDeal : The total number of deals of all normal accounts.
  • TotalCovDeal: The Total number of deals of all coverage accounts.
  • TotalNormalSellLot : The Total number of lots  of all sell positions for normal account.         
  • TotalCovSellLot : The total number of lots of all sell positions for coverage account.
  • TotalNormalBuyLot : The total number of lots of all buy positions for normal account.
  • TotalCovBuyLot :  The total number of lot of all buy positions for coverage account.
  • TotalNetLots : The Total  net lots amount.
  • TotalNormalProfitLoss  : The Total profit / loss for all normal account.
  • TotalCovProfitLoss : The Total profit/loss for all coverage account.
  • TotalNetProfit : The total net profit / loss.

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>GetSettledStatus</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script>
$(document).ready(function () {
var urlStr = "https://webtrader.hybrid-solutions.com/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].Symbol > "0") {
for (var i = 0; i < result.length; i++) {
rst += "Symbol : " + result[i].Symbol + "<br/>"
rst += "SymbolID : " + result[i].SymbolID + "<br/>"
rst += "NormalBuyPrice : " + result[i].NormalBuyPrice + "<br/>"
rst += "NormalbuyClose : " + result[i].NormalbuyClose + "<br/>"
rst += "NormalBuyLot : " + result[i].NormalBuyLot + "<br/>"
rst += "NormalSellPrice : " + result[i].NormalSellPrice + "<br/>"
rst += "NormalSellClose : " + result[i].NormalSellClose + "<br/>"
rst += "NormalSelllot : " + result[i].NormalSelllot + "<br/>"
rst += "NormalprofitLoss : " + result[i].NormalprofitLoss + "<br/>"
rst += "NormalDeal : " + result[i].NormalDeal + "<br/>"
rst += "CovBuyPrice : " + result[i].CovBuyPrice + "<br/>"
rst += "CovBuyClose : " + result[i].CovBuyClose + "<br/>"
rst += "CovBuyLot : " + result[i].CovBuyLot + "<br/>"
rst += "------------------------------------------------------------"
$("#resultAction").html(rst)
}
}
else {
$("#resultAction").html("Error Code : " + result[0].Symbol + "<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 + "/GetSettledStatus?ClientID=" + $("#txtClientID").val() + "&FromDate=" + $("#txtFromDate").val() + "&ToDate=" + $("#txtToDate").val() + "&LastXDays=" + $("#txtlastXdays").val() + "&SymbolID =" + $("#txtSymbolID").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>
lastXdays : <input type="text" id="txtlastXdays" value="0"/>
SymbolID : <input type="text" id="txtSymbolID" value="0"/>
<button id="btnAction"> GetSettledStatus </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