Knowledgebase
GetRequotedOrders
Posted by Mohammad Rahhal on 03 May 2012 12:02 PM


Description

The GetReqoutedOrders operation is used to retrieve the orders that 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), OrderAudit’s members are:

  • Client
  • Account
  • OrderType
  • OrderID: Order ID
  • OrderStatus
  • OrLiId
  • OrCpIoId
  • Time : order time
  • NewBuy : new buy Price
  • NewSell : new sell price
  • Amount : amount of lots
  • Symbol: symbol name
  • OldBuy : old Buy price
  • OldSell : Old Sell Price
  • BuySell: the type of operation

If the value equals 1, then the type of operation is Buy else the operation type is Sell.

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

Type: List(of OrderAudit)


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>GetRequotedOrders</title>

<script src="http://code.jquery.com/jquery-latest.js"></script>

</head>

<script >

var urlStr = "http://74.54.46.178/vertexweb10/WebService.svc";

      function onSuccessResultOrder(dataResult) {

          var result = eval(dataResult.d);

          var rst = ""

          if (result[0] > 0) {

              //if result[6]=1 , then  Open Postion has been done

              if (result[6] == 1) {

                  rst += "Order has been done  successfully!  the following is the open position details : </br>"

                  rst += "OrderID:" + 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 done

              else 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 = "http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964"

                  $("#resultAction").html("Error Code : " + rst + "<br/>" + " for more details see the follwing link: " + rst.link(rst));

              }

          }

          else {

              var rst = "www.hybrid-solutions/support/index.php?/knowledgebase/Article/View/1964"

              $("#resultAction").html("Error Code : " + result[0] + "<br/>" + " for more details see the follwing link: " + rst.link(rst));

          }

      }

      function GetRequotedOrders() {

        $.ajaxSetup({ "cash": false });

        $.getJSON(urlStr + "/GetRequotedOrders", onSuccessResultAction);

    }

    function onSuccessResultAction(dataResult) {

        var result = eval(dataResult.d);

        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 () {

         $.support.cors = true;

        $("#progress").ajaxStart(function () { $(this).css("display", "block"); });

        $("#progress").ajaxComplete(function () { $(this).css("display", "none"); });

        $.ajaxSetup({ "cash": false });

        function onSuccessResult(response) {

            response = eval('(' + response.d + ')')

            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(), onSuccessResult);

        });

        $("#btnActionNewOrder").click(function () {

            $.getJSON(urlStr + "/NewOrder?AccountId=" + $("#txtAccountId").val() + "&Symbol=" + $("#txtSymbol").val() + "&BuySell=" + $("#txtBuySell").val() + "&lots=" + $("#txtlots").val(), onSuccessResultOrder);

        });

        $("#btnAction").click(function () {

            GetRequotedOrders();

        });

    });

</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>Symbol: <input type="text" id="txtSymbol"  value ="6" /> </td> 

  </tr>

  <tr>

      <td>BuySell: <input type="text" id="txtBuySell"  value ="1" /></td>

      <td>lots:<input type="text" id="txtlots"  value ="1.0" /></td>

      <td><button id="btnActionNewOrder"> NewOrder </button></td>

          <td><button id="btnAction"> Start GetRequotedOrders </button></td>

  </tr>

</tbody>

</table>

Note:  Press GetRequotedOrders button to start lis<!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>GetRequotedOrders</title>

<script src="http://code.jquery.com/jquery-latest.js"></script>

</head>

<script >

    var urlStr = "http://74.54.46.178/vertexweb10/WebService.svc";

    function onSuccessResultOrder(dataResult) {

        var result = eval(dataResult);

        var rst = ""

        if (result[0] > 0) {

            //if result[6]=1 , then  Open Postion has been done

            if (result[6] == 1) {

                rst += "Order has been done  successfully!  the following is the open position details : </br>"

                rst += "OrderID:" + 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 done

            else 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 = "http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1964"

                $("#resultAction").html("Error Code : " + rst + "<br/>" + " for more details see the follwing link: " + rst.link(rst));

            }

        }

        else {

            var rst = "www.hybrid-solutions/support/index.php?/knowledgebase/Article/View/1964"

            $("#resultAction").html("Error Code : " + result[0] + "<br/>" + " for more details see the follwing link: " + rst.link(rst));

        }

    }

    function GetRequotedOrders() {

        $.ajaxSetup({ "cash": false });

        $.getJSON(urlStr + "/GetRequotedOrders?callback=?", onSuccessResultAction);

    }

    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 () {

        $.support.cors = true;

        $("#progress").ajaxStart(function () { $(this).css("display", "block"); });

        $("#progress").ajaxComplete(function () { $(this).css("display", "none"); });

        $.ajaxSetup({ "cash": false });

        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);

        });

        $("#btnActionNewOrder").click(function () {

            $.getJSON(urlStr + "/NewOrder?AccountId=" + $("#txtAccountId").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="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>Symbol: <input type="text" id="txtSymbol"  value ="6" /> </td> 

  </tr>

  <tr>

      <td>BuySell: <input type="text" id="txtBuySell"  value ="1" /></td>

      <td>lots:<input type="text" id="txtlots"  value ="1.0" /></td>

      <td><button id="btnActionNewOrder"> NewOrder </button></td>

          <td><button id="btnAction"> Start GetRequotedOrders </button></td>

  </tr>

</tbody>

</table>

Note:  Press GetRequotedOrders button to start listnering, after take order and the dealer Requote it.

<div id="resultData"> </div>

<div id="resultAction"> </div>

<div style="display:none" id="progress">Loading ... </div>

</body>

</html>

nering, after take order and the dealer Requote it.

<div id="resultData"> </div>

<div id="resultAction"> </div>

<div style="display:none" id="progress">Loading ... </div>

</body>

</html>

 



See Also


VertexFX WCF Service Index

(0 votes)
This article was helpful
This article was 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. This is required to prevent automated registrations and form submissions.

Help Desk Software by Hybrid Solutions