Knowledgebase:
GetAllSymbols
Posted by Mohammad Rahhal, Last modified by Angham Al-Banawien on 18 July 2018 11:52 AM

Syntax 

GetAllSymbols (AccountID As LongOptional WithGroups As Boolean = False)

Description

The GetAllSymbols operation is used to return a List of symbols for the logged in client according to the given account id parameter.

Request Parameters

Name Description  Required
AccountID
  • The intended account identifier.
  • Type: Long.
  • Constraints: Must be a valid account ID, and accessible by logged in client.
   Yes
WithGroups  
  • True if group type's needed, False if not.
  • Type: Boolean.
 No

 

 

 

 

 

 

 

 

 

Response Elements

Name Description 
Symbols

This operation returns Symbols upon success as list (of type Symbol). The following are the Symbol's data members:

  • RefSymbol: Reference symbol.      
  • SymbolFactor: Contract size.
  • PriceCase: To indicates direct/indirect setting:
                     1: Price case is direct.
                    -1: Price case is indirect.
  • RefPriceCase: To indicate Ref symbol calculation. It can be one of the following:
                    -1: Which mean Division.
                     1: Which mean Multiplication.
  • Type: Indicates to symbol type as the below conditions:
             If the value type equals 1, then symbol type is symbol.
             If the value type equals 2, the symbol type is a group, which means it is a parent for the child symbols. 
  • Name : Symbol Name.
  • SpreadOffset: The spread offset value.
  • PriceOffset: Price offset value.
  • SpreadType: spread calculation type:
                      1: Spread type is from bid.
                      2: Spread type is from Average.
  • StopTradeIfNoPrices: Indicates if trading on symbol should stop when no price.
  • StopTradeAfterSeconds: Indicates after how many seconds trading on symbol should occur.
  • MaxAmountPerDeal: Maximum lots amount to deal.
  • MinAmountPerDeal: Minimum lots amount to deal.
  • AskWithSpread: Ask price with spread value.
  • BidWithSpread: Bid price with spread value.
  • Commission: Commission value.
  • LimitOffset: How much the limit order prices should be far from the market price.
  • StopOffset: How much the SLTP order prices should be far from the market price.
  • PipLocation: Indicates the pips value. i.e. Pips(-5) for EUR/USD is 0.0005.
  • Spread: To get the amount of pips between bid price and ask price.
  • IsUsed: Defined as Used in the backoffice symbol settings.
  • IsDisplay: Defined as a display in the BackOffice symbol settings.
  • HasPriv: detect if the logged in client has a privilege to trade on the symbol.
  • JustClose: If the returned value is true, trading type is just close, otherwise the trading type is full trade.
  • BuyOnly: If the returned value is true, start trade with only buy, otherwise the trading with buy and sell.
  • IsDelivery: If the returned value is true, the symbol accepts the physical trading.
  • ID: Symbol ID.
  • Bid: Bid price.
  • Ask: Ask price.
  • High: High price.
  • Low: Low price.
  • LastQuoteTime: Indicates the last quote time.
  • ParentID: Indicates Symbol's ParentID.
  • MainUnitFactor : to get the main unit factory of the symbol.
  • BinaryPayout : to get the binary payout parameter value of the symbol.
  • BinaryPeriod : to get the binary period parameter value of the symbol.
  • TickPip : detected the tick pip value of the symbol.
  • ExpDate : detected the expiry date for the symbol.
  • ParentID : detected the symbol parent id.

Otherwise, an explicit error code is returned. 

Type: JSON object as List (of Symbol).


Sample

Download sample as text file.

 

<!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>GetAllSymbols</title>
<script src="http://code.jquery.com/jquery-latest.js" ></script>
</head>
<script >
$(document).ready(function () {
var urlStr = "http://5.10.64.199/vertexweb10/WebService.svc";
jQuery.support.cors = true;
$("#progress").ajaxStart(function () { $(this).css("display", "block"); });
$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });
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);
}
}
$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.getJSON(urlStr + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);
});
$("#btnAction").click(function () {
$.getJSON(urlStr + "/GetAllSymbols?AccountID=" + $("#txtAccountID").val() + "&callback=?", onSuccessResult);
function onSuccessResult(dataResult) {
result = eval('(' + dataResult + ')');
if (result != null) {
var myTable = '<table border="1px"><thead>' +
'<tr><th>Symbol </th> <th>ID</th><th>Type (1 means Symbol , 2 means group of symbol) </th><th> Bid</th>' +
'<th >Ask</th><th>High</th><th>Low</th><th>Time</th>' +
'<th>MaxAmountPerDeal</th><th>MinAmountPerDeal</th>' +
'<th>Commission</th><th>LimitOffset</th><th>StopOffset</th>' +
'<th >PipLocation</th><th>Spread</th><th>IsUsed</th>' +
'<th>JustClose</th><th>BuyOnly</th><th>RefSymbol</th>' +
'<th >SymbolFactor</th><th>PriceCase(1 mean direct , -1 means indirect)</th><th>RefPriceCase(1 means Multiplication case , -1 means Division case)</th>' +
'</tr></thead><tbody>';

for (var i = 0; i <= result.length - 1; i++) {
myTable += "<tr>"
myTable += "<td>" + result[i].Name + "</td>"
myTable += "<td>" + result[i].ID + "</td>"
myTable += "<td>" + result[i].Type + "</td>"
myTable += "<td>" + result[i].Ask + "</td>"
myTable += "<td>" + result[i].Bid + "</td>"
myTable += "<td>" + result[i].High + "</td>"
myTable += "<td>" + result[i].Low + "</td>"
myTable += "<td>" + result[i].LastQuoteTime + "</td>"
myTable += "<td>" + result[i].MaxAmountPerDeal + "</td>"
myTable += "<td>" + result[i].MinAmountPerDeal + "</td>"
myTable += "<td>" + result[i].Commission + "</td>"
myTable += "<td>" + result[i].LimitOffset + "</td>"
myTable += "<td>" + result[i].StopOffset + "</td>"
myTable += "<td>" + result[i].PipLocation + "</td>"
myTable += "<td>" + result[i].Spread + "</td>"
myTable += "<td>" + result[i].IsUsed + "</td>"
myTable += "<td>" + result[i].JustClose + "</td>"
myTable += "<td>" + result[i].BuyOnly + "</td>"
myTable += "<td>" + result[i].RefSymbol + "</td>"
myTable += "<td>" + result[i].SymbolFactor + "</td>"
myTable += "<td>" + result[i].PriceCase + "</td>"
myTable += "<td>" + result[i].RefPriceCase + "</td>"
myTable += "</tr>"
}
myTable += '</tbody></table>';
}
$("#resultAction").html(myTable);
}
});
});
</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>AccountID: <input type="text" id="txtAccountID" value ="" /> </td>
<td><button id="btnAction"> GetAllSymbols </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 WCF Service Index

(3 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