Syntax
GetRequotedOrders ()
Description
The GetReqoutedOrders operation is used to retrieve the orders which have been re-quoted by a dealer for the selected account.
Dependencies
You might use this operation based on the result of the GetAccountReflection operation. Check Reflection Flags.
Response Elements
Name | Description |
Result |
In case of success, this operation returns a list (of OrderAudit), OrderAudits members are:
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>Get Requoted Orders</title><script src="http://code.jquery.com/jquery-latest.js"></script></head><script >var urlStr = "http://webtrader.hybridsolutions.com/publicweb/webservice.svc";jQuery.support.cors = true;function onSuccessReflectionOrder(dataResult) {var rst = "";result = eval('(' + dataResult + ')');if (result.AccountRef.length > 1) {for (var i = 0; i < result.AccountRef.length; i++) {$("#resultAction").html($("#resultAction").html() + "<br/>" + rst);if (parseInt(result.AccountRef[i]) == 20) {rst = "when AccountRef property has value 20 then Price has been Changed . you should Get Requoted Orders and update the Open Positions , pending orders and Account Summary"GetRequotedOrders();}rst = rst.fontcolor("red");rst = rst.bold();}}$("#resultAction").html($("#resultAction").html() + "<br/>" + rst);GetClientReflection(result.ClientRef)setTimeout('GetReflection()', '2000');}function onSuccessResultOrder(dataResult) {var result = eval(dataResult);var rst = ""if (result[0] > 0) {//if result[6]=1 , then Open Position has been doneif (result[6] == 1) {rst += "Order has been done successfully! the following is the open position details : </br>"rst += "Ticket ID:" + result[0] + " Time :" + result[1] + " Amount :" + result[3] + " Symbol ID:" + result[4] + " Open Price:" + result[5]$("#resultAction").html(rst);}//if result[6]=2 , then pending order has been doneelse if (result[6] == 2) {rst += "Order has been done successfully! the following is the pending Order details : </br>"rst += "OrderID:" + result[0] + " Time :" + result[1] + " Amount :" + result[3] + "Symbol ID:" + result[4] + "Open Price:" + result[5]$("#resultAction").html(rst);}else {var rst = "https://doc.hybridsolutions.com/knowledgebase/common-errors-and-constants/"$("#resultAction").html("Error Code : " + rst + "<br/>" + " for more details see the following link: " + rst.link(rst));}}else {var rst = "www.hybridsolutions/support/index.php?/knowledgebase/Article/View/1964"$("#resultAction").html("Error Code : " + result[0] + "<br/>" + " for more details see the following link: " + rst.link(rst));}}function GetClientReflection(result) {var rst = ""for (var i = 0; i < result.length; i++) {if (parseInt(result[i]) == 30) {rst = "A new Mail has been received ,, you should Update the mails by get the New mail .Initially,call GetMails method "rst = rst.fontcolor("green");rst = rst.bold();$("#resultAction").html($("#resultAction").html() + "<br/>" + rst);}else if (parseInt(result[i]) == 29) {rst = "delete Mail reflection has been received ,, you should update your mails .Initially , call GetMails method "rst = rst.fontcolor("green");rst = rst.bold();$("#resultAction").html($("#resultAction").html() + "<br/>" + rst);}else if (parseInt(result[i]) < 0) {var errDetail = "https://doc.hybridsolutions.com/knowledgebase/common-errors-and-constants/"errDetail = errDetail.link(errDetail);errDetail = errDetail.fontcolor("green");errDetail = errDetail.bold();$("#resultAction").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail);}}}function GetRequotedOrders() {$.ajaxSetup({ "cash": false });$.getJSON(urlStr + "/GetRequotedOrders?callback=?", onSuccessResultAction);}function GetReflection() {$.getJSON(urlStr + "/GetReflection?AccID=" + $("#txtAccID").val() + "&callback=?" , onSuccessReflectionOrder);}function onSuccessResultAction(dataResult) {var result = eval(dataResult);var strResult = ""if (result.length == 0) {strResult = "No result ";}else {var note = "Call ClientAcceptOrder() or ClientRejectOrder() method to accept or reject the Requoted Order "for (var i = 0; i < result.length; i++) {strResult = strResult + "OrderID :" + result[i].OrderID + "</br>"if (parseInt(result[i].BuySell) == 1) {strResult = strResult + "BuySell Type :" + "Buy" + "</br>"}else {strResult = strResult + "BuySell Type :" + "Sell" + "</br>"}strResult = strResult + "Old Price :" + result[i].OldSell + "</br>"strResult = strResult + "New Price :" + result[i].NewSell + "</br>"strResult = strResult + note.bold() + "</br>" + "</br>" + "</br>"}}$("#resultAction").html($("#resultAction").html() + "<br/>" + strResult);//setTimeout('GetRequotedOrders()', '2000');}$(document).ready(function () {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 occurred'); });function onErrorResult(result) {alert('Service call failed : ' + result.status + ' ' + result.statusText);}$("#btnLogin").click(function () {$.getJSON(urlStr + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);});$("#btn_Action").click(function () {GetReflection();});$("#btnActionNewOrder").click(function () {$.getJSON(urlStr + "/NewOrder?AccountId=" + $("#txtAccID").val() + "&Symbol=" + $("#txtSymbol").val() + "&BuySell=" + $("#txtBuySell").val() + "&lots=" + $("#txtlots").val() + "&callback=?", onSuccessResultOrder);});$("#btnAction").click(function () {GetRequotedOrders();});});</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="txtAccID" value=""/><td>Symbol: <input type="text" id="txtSymbol" value ="" /> </td> </tr><tr><td>BuySell: <input type="text" id="txtBuySell" value ="" /></td><td>lots:<input type="text" id="txtlots" value ="" /></td><td><button id="btnActionNewOrder"> NewOrder </button></td><td><button id="btn_Action"> Start GetReflection </button></td></tr></td><td><button id="btnAction"> Start GetRequotedOrders </button></td></tr></tbody></table>Note: you should press at get reflection to get Requoted orders (in case the reflection result = 20)<div id="resultData"> </div><div id="resultAction"> </div><div style="display:none" id="progress">Loading ... </div></body></html>
See Also