GetTransactions
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 19 September 2019 09:45 AM

Syntax

Function GetTransactions (AfterID As Long)

Description

The GetTransactions operation is used to return the transactions log after the specific transaction log ID. before calling this operation you have to call
GetAccountTransaction to get the id's of the transactions 


Request Parameters

Name Description  Required
AfterID
  • The report will show the transactions that after this ID.
  • Type: Long
  • Default: 0

 

No


Response Elements

Name Description 
Result

In case of success the following are the Transaction Data member: 

  • AccountID As String: The account ID for each transaction.
  • Amount as String: The amount of the transaction.
  • BuySell As String: Define buy or sell (1 Buy Type, -1 Sell Type).
  • ClientID As String: The client ID for each transaction.
  • ClosePrice As String: The close price or the take profit price for each transaction (If the transaction belongs to a money transaction it will be empty).
  • Commission As String: The commission amount for each transaction (If the transaction belongs to a money transaction it will be empty).
  • DateTime As String: Shows date and time for each transaction.
  • Interest As String: The interest amount for each transaction (If the transaction belongs to a money transaction it will be empty).
  • IP As String: The IP address of the dealer/client who performed each transaction.
  • Method As String: How the action was handled, it can be one of:
    • Auto, Buy Limit
    • Buy Stop
    • Sell Limit, Sell Stop
    • Cancel
    • Cancelled-No Money
    • Done
    • Hedge
    • Liquidate
    • Manual
    • Order
    • Take Profit
    • Stop Loss
  • Price As String: The open price or the stop loss price for each transaction (If the transaction belongs to a money transaction it will be empty).
  • Profit As String: The profit amount for each transaction.

    (To calculate the full amount of profit/ loss --> Profit/loss = Profit - commission +/- interest)


  • RefPrice As String: The reference symbol price for each transaction.
  • SymbolID as String: The symbol ID for each transaction (If the transaction belongs to a money transaction it will be empty).
  • SymbolName As String: The symbol name for each transaction (If the transaction belongs to a money transaction it will be empty).
  • Ticket As String: Ticket/Order ID for each transaction.
  • Ticket2 As String: Open position ID if TransLogType equal 2 (Liquidate Position).
  • TransID As String: The ID of the transaction.
  • TransLogType As String: The type of the transaction, its value equal either of:
    • 1 means New Position
    • 2 Liquidate Position
    • 3 Money Transaction (depends on TransSubType value)
    • 4 Take Profit/Stop Loss Transaction
    • 5 Limit/Stop Transaction
    • 6 Delivery
  • TransLogSubType As String:
    If the TransLogType equal (3 Money Transaction), then its value equal:
    •  1 means "Deposit"
    • -1 "Withdrawal"
    •  2 "Adjusment"
    •  3 "Credit In"
    • -3 "Credit Out".

    If the TransLogType equal (5 Limit/Stop Transaction), then its value equal:

    •  1 means "Buy Limit Type"
    • -1 "Sell Limit Type"
    •  2 "Buy Stop Type"
    • -2 "Sell Stop Type"
  • TransType As String: The type of the transaction, its value equal either:
    • 1 means New
    • 2 means Update
    • 3 means Delete
  • WhoID As String: Dealer ID (If its value less than 0, this means by System)
  • WhoType As String: Its value either 1 means Dealer or 2 mean client.

In case of success, this operation returns the success code. Otherwise see Error codes.


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>Transaction Log</title>
<script src="http://code.jquery.com/jquery-latest.js" ></script>
</head>

<script >

$(document).ready(function () {

var urlStr = "http://173.249.35.43/webtrader/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 == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
$("#resultData").html("SuccessResult ... SessionID is :" + response.sessionid);
}
}
$("#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 + "/BackofficeLogin?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);
});

$("#btnAction").click(function () {
$.getJSON(urlStr + "/GetTransactions?AfterID=" + $("#AfterID").val() + "&callback=?", onSuccessResult);

function onSuccessResult(dataResult) {

result = eval('(' + dataResult + ')');
if (result != null) {

var myTable = '<table border="1px"><thead>' +
'<tr><th>AccountID</th> <th>Amount</th><th>BuySell</th><th>ClientID</th>' +
'<th >ClosePrice</th><th>Commission</th><th>DateTime</th><th>Interest</th>' +
'<th>IP</th><th>Method</th>' +
'<th>Price</th><th>Profit</th><th>RefPrice</th>' +
'<th >SymbolID</th><th>SymbolName</th><th>Ticket</th>' +
'<th>Ticket2</th><th>TransID</th><th>TransLogSubType</th>' +
'<th >TransLogType</th><th>TransType</th><th>WhoID</th><th>WhoType</th>' +
'</tr></thead><tbody>';

for (var i = 0; i <= result.length - 1; i++) {
myTable += "<tr>"
myTable += "<td>" + result[i].AccountID + "</td>"
myTable += "<td>" + result[i].Amount + "</td>"
myTable += "<td>" + result[i].BuySell + "</td>"
myTable += "<td>" + result[i].ClientID + "</td>"
myTable += "<td>" + result[i].ClosePrice + "</td>"
myTable += "<td>" + - result[i].Commission + "</td>"
myTable += "<td>" + result[i].DateTime + "</td>"
myTable += "<td>" + result[i].Interest + "</td>"
myTable += "<td>" + result[i].IP + "</td>"
myTable += "<td>" + result[i].Method + "</td>"
myTable += "<td>" + result[i].Price + "</td>"
myTable += "<td>" + result[i].Profit + "</td>"
myTable += "<td>" + result[i].RefPrice + "</td>"
myTable += "<td>" + result[i].SymbolID + "</td>"
myTable += "<td>" + result[i].SymbolName + "</td>"
myTable += "<td>" + result[i].Ticket + "</td>"
myTable += "<td>" + result[i].Ticket2 + "</td>"
myTable += "<td>" + result[i].TransID + "</td>"
myTable += "<td>" + result[i].TransLogSubType + "</td>"
myTable += "<td>" + result[i].TransLogType + "</td>"
myTable += "<td>" + result[i].TransType + "</td>"
myTable += "<td>" + result[i].WhoID + "</td>"
myTable += "<td>" + result[i].WhoType + "</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>After ID: <input type="text" id="AfterID" value ="0" /> </td>
<td><button id="btnAction"> Transaction Log </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

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