PDA

View Full Version : NewTick Method not returning PipLocation



ufazal
02-18-2014, 04:04 PM
Hi,

The WCF method GetNewTick is not returing the piplocation and the high, low only return till 4 decimal places. So if I to create the graph from this data, the graph is pretty much a straight line.
How can i solve this problem ?

Also I am sending AfterDate in GetChartData, but it returns the default data i.e. from 1900 I believe (as written in the documentation). Is that a Problem in the WCF API ?

Please guide.

Thanks.

Hassan-HS
02-18-2014, 05:33 PM
Hi,
I will update you soon please standby

Ehab-hs
02-19-2014, 10:22 AM
Before calling GetNewTick web Method you should call GetAllSymbols which returns a list of symbols for the specific account (logged in Client ) with All data members (ID, Type , Name , Bid , Ask, High ,Low LastQuoteTime , PipLocation ..ect ) and update the buffered symbol with the corresponding tick . For more information visit this link:
http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1935

The next sample shows you how you can consume GetAllSymbols Web method:

<!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://74.54.46.178/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="support"/>

password: <input type="text" id="txtpassword" value="support"/>

<button id="btnLogin"> Login </button>

</td>

</tr>

<tr>

<td>AccountID: <input type="text" id="txtAccountID" value ="12347298" /> </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>



Regarding to the GetChartdata web method, we have fixed this case. Try to Send AfterDate parameter as dd/MM/yyyy format.

Let me know your feed back .