Syntax
GetAccountTransactions(AccountId As Long , FromDate As String, ToDate as String)
Description
The GetAccountTransactions operation returns a 2 Dimensional String array which holds a statement of the closed transactions data
Request Parameters
Name | Description | Required |
AccountId |
|
Yes |
FromDate |
|
No |
ToDate |
|
No |
Response Elements
Name | Description |
Result |
0- Ticket/ Order 1- Date/ Time 2- Transaction Type 3- SymbolID 4- Amount 5- Buy/Sell 6- Open DateTime 7- OpenPrice/ SL( Stop loss value ) 8- Close Price/ TP (Take Profit value) 9- Amount of (DP/ WD/ AJ/Ci/CO) 10- Commission 11- Interest 12- Profit / loss value 13- Symbol Name 14 – Method
|
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>GetAccountTransactions</title><script src="http://code.jquery.com/jquery-latest.js"></script></head><script>$(document).ready(function () {var urlStr = "https://webtrader.hybridsolutions.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][0] > 0) {for (var i = 0; i < result.length-1; i++) {rst += "Ticket : " + result[i][0] + "<br/>"rst += "Date/Time : " + result[i][1] + "<br/>"rst += "Type : " + result[i][2] + "<br/>"rst += "SymbolID : " + result[i][3] + "<br/>"rst += "Amount : " + result[i][4] + "<br/>"rst += "BuySell : " + result[i][5] + "<br/>"rst += "OpenTime : " + result[i][6] + "<br/>"rst += "OpenPrice/SL : " + result[i][7] + "<br/>"rst += "ClosePrice/TP : " + result[i][8] + "<br/>"rst += "Amount(DP/WD/AJ): : " + result[i][9] + "<br/>"rst += "Commission : " + result[i][10] + "<br/>"rst += "Interest : " + result[i][11] + "<br/>"rst += "PL : " + result[i][12] + "<br/>"rst += "SymbolName : " + result[i][13] + "<br/>"rst += "method : " + result[i][14] + "<br/>"rst += "------------------------------------------------------------" + "<br/>"$("#resultAction").html(rst)}}else {$("#resultAction").html("Error Code : " + result[0][0] + "<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 + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?" , onSuccessResult);});$("#btnAction").click(function () {$.getJSON(urlStr + "/GetAccountTransactions?AccountId=" + $("#txtClientID").val() + "&FromDate=" + $("#txtFromDate").val() + "&ToDate=" + $("#txtToDate").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>AccountId : <input type="text" id="txtClientID" value ="" />FromDate : <input type="text" id="txtFromDate" value=""/>ToDate : <input type="text" id="txtToDate" value="" /></td></tr><tr><td><button id="btnAction"> GetAccountTransactions </button></td></tr></tbody></table><div id="resultData"> </div><div id="resultAction"> </div></body></html>
See Also