GetChatOrder
Posted by Angham Al-Banawien, Last modified by Laith Ghawi on 03 July 2019 11:54 AM

 Syntax

 Public Function GetChatOrder() As String

Description

The GetChatOrder operation is used get the new chat orders that received to the logged in dealer web session . 

Request Parameters

No requested parameter 


Response Elements

Name Description 
 Result

The operation returns list of type ChatOrder, otherwise an explicit error code is returned if ClientID  is less than 0 .

The Following are the ChatOrder data member:

    1– OrderID : new chat order number 

    2– ChatOrderType : can be one of the following

             1 : for marketOrderType
             2 : for LimitOrderType

             3 : for SLOrderType
             4 : for TPOrderType

   3- AccountID : Account number which chat order is belongs

  4- ClientID : client number which the chat order belongs to 

  5- SymbolID  : Trading symbol identifier. 

  6- BuySell : Chat order Type can be one of the
following:

            1 : for Buy or Buy Limit
           -1 : for sell or Sell Limit

  7- NewLiq : Close or open Type can be one of the following  :

             1 : for new Type
             2 : for close Type

  8- lot : chat amount of lot  

  9- price  : the requested price

  10- OpenPrice : open price when the newLiq was liquidate Type

  11- HitPrice : order hit price when the chat type is pending order (Limit order , SL/TP order)

  12- RefBidHitPrice : Reference symbol bid hit price when the chat type is pending order (Limit order , SL/TP order)

  13- Status : can be one of the following :

             10 : for request new buy
             11 : for request new Sell
             12 : for request liq buy
             13 : for request liq sell

  14- WhoID : the ID for whom made the transaction 

  15- IP : the IP address for whom made thetransaction

  16- OpenLot : the whole amount of lots

  17- OpenTicket : ticket number which the order that had been received to chat screen.

  18- Note : String that send with the order to mark it

 19 - DeliveryItem : requested delivery item .
 20- RefaskHitPrice : Reference symbol ask hit  price when the chat type is pending order (Limit order , SL/TP order)


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>GetChatOrder</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"); });
$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });



function onSuccessResultt(dataResult) {
var result = eval(dataResult);
var rst = ""
if (result[0].OrderID > 0) {
for (var i = 0; i < result.length; i++) {
rst += "OrderID : " + result[i].OrderID + "<br/>"
rst += "ChatOrderType : " + result[i].ChatOrderType + "<br/>"
rst += "AccountID : " + result[i].AccountID + "<br/>"
rst += "ClientID : " + result[i].ClientID + "<br/>"
rst += "SymbolID : " + result[i].SymbolID + "<br/>"
rst += "BuySell : " + result[i].BuySell + "<br/>"
rst += "Lot : " + result[i].lot + "<br/>"
rst += "Price : " + result[i].price + "<br/>"
rst += "OpenPrice : " + result[i].OpenPrice + "<br/>"
rst += "WhoID : " + result[i].WhoID + "<br/>"
rst += "--------------------------------------------------" + "<br/>"
$("#resultAction").html(rst)
}
}
else {
$("#resultAction").html("Error Code : " + result[0].OrderID + "<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 + "/GetChatOrder?" + "&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>
<button id="btnAction"> GetChatOrder </button>
</td>
</tr>
</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </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