GetClientParam
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 10 December 2018 03:44 PM

Syntax

Public Function GetClientParam(ClientID As Integer) As String

Description

This function is used to get the parameter for the given client ID which the logged in dealer has privilege on.

Parameters

Name Description  Required
ClientID
  • The client number to get his parameters
  • Type: Integer
  • Default: None
Yes

Response Elements

Name Description 
Result The operation returns JSON object of type ClientParameter in case successfully otherwise an explicit error code is returned if the SymbolID is less than 0.

 The following are the client parameter data member.

  • SymbolID : The symbol number that the parameters value belongs to , value of type long
  • Spread : the differences between ask and bid , value of type String , if it empty String that means the spread equal the source plus value
  • SpreadFlag : To detect if the spread is inherit or override , 2 means Override , otherwise it is inherit
  • LimitOffset : number of pips which should be away from current market price to place limit orders. Value of type Double
  • LimitOffsetFlag : To detect if the Limit Offset is inherit or override. , 2 means Override , otherwise it is inherit
  • StopOffest : number of pips which should be away from current market price to place the stop orders. Value of type Double
  • StopOffestFlag To detect if the Stop Offset is inherit or override.
    2 means Override  , otherwise it is inherit
  • InitMarginReq : Amount that the client should have in his effective margin to be able to buy 1 lot, Value of type String. If contains “%” that means the initial margin is a percentage initial margin type type.
  • InitMarginReqFlag : To detect if the initial Margin is inherit or override, 2 means Override  , otherwise it is inherit
  • MntnMarginReq : Effective margin amount. Value of type Double.
  • MntnMarginReqFlag : To detect if the Maintenance Margin  is inherit or override. 2 means Override  , otherwise it is inherit
  • Visible : To detect if the symbol is visible or not , Value of type Boolean.
  • VisibleFlag : To detect if the visible parameter is inherit or override. 2 means Override , otherwise it is inherit
  • Comm : Client Commission value. Value of type is Double.
  • CommFlag : To detect if the commission  parameter is inherit or override. 2 means Override  , otherwise it is inherit
  • MaxLot : Maximum amount for each deal to trade on. Value of type Double .
  • MaxLotFlag : To detect if the Max lot parameter is inherit or override. 2 means Override  , otherwise it is inherit
  • MinLot : Minimum amount for each deal to trade on. Value of type Double .
  • MinLotFlag : To detect if the Min lot parameter is inherit or override. 2 means Override  , otherwise it is inherit
  • AutoBroker : The market orders auto broker , value of type Double .  
    -1 : means auto broker on

    -2 : means auto broker off
  • AutoBrokerFlag To detect if the AutoBroker parameter is inherit or override. 2 means Override , otherwise it is inherit
  • SourcePlus : the feed prices value . Value of type Double
  • SourcePlusFlag : To detect if the SourcePlus parameter is inherit or override. 2 means Override , otherwise it is inherit
  • LOAutoBroker : the pending order auto broker , value of type double .
    -1 : means auto broker on
    -2 : means auto broker off
  • LOAutoBrokerFlag : To detect if the LOAutoBroker parameter is inherit or override. 2 means Override , otherwise it is inherit
  • BinaryPayout : the percentage of the profit to loss value for the binary
  • BinaryPayoutFlag : To detect if the BinaryPayout parameter is inherit or override. 2 means Override , otherwise it is inherit
  • BinaryPeriod : the period that the binary order will remains before goes to close
  • BinaryPeriodFlag : To detect if the BinaryPeriod parameter is inherit or override. 2 means Override , otherwise it is inherit

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>GetClientParam</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].SymbolID > 0) {
for (var i = 0; i < result.length; i++) {
rst += "SymbolID : " + result[i].SymbolID + "<br/>"
rst += "Spread : " + result[i].Spread + "<br/>"
rst += "SpreadFlag : " + result[i].SpreadFlag + "<br/>"
rst += "LimitOffest: " + result[i].LimitOffest + "<br/>"
rst += "LimitOffestFlag : " + result[i].LimitOffestFlag + "<br/>"
rst += "Visible : " + result[i].Visible + "<br/>"
rst += "Comm : " + result[i].Comm + "<br/>"
rst += "MinLot : " + result[i].MinLot + "<br/>"
rst += "Max : " + result[i].MaxLot + "<br/>"

rst += "------------------------------------------------------------" + "<br/>"
$("#resultAction").html(rst)
}
}
else {
$("#resultAction").html("Error Code : " + result[0].SymbolID + "<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 + "/GetClientParam?ClientID=" + $("#txtclientID").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 ="" />
<button id="btnAction"> Get Client Param </button></td>
</tr>

</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
<div style="display:none" id="progress">Loading ... </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