Syntax
Function GetFloatingStatus (ClientID As Long, Optional ByVal SymbolID As Integer = 0) As String
Description
The GetFloatingStatus operation is used to get the floating Status report for a specific given client number.
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
|
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>GetFloatingStatus</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 + "/GetFloatingStatus?ClientID=" + $("#txtClientID").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 ="" />
SymbolID : <input type="text" id="txtSymbolID" value="0"/>
<button id="btnAction"> GetFloatingStatus </button>
</td>
</tr>
</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
</body>
</html>
See Also
VertexFX Backoffice WCF Service Index
|