Example #1
0
        private void btnSendStopOrder_Click(object sender, EventArgs e)
        {
            var msgFactory = new OpenApiMessagesFactory();
            var msg        = msgFactory.CreateStopOrderRequest(Convert.ToInt32(_accountID), _token, 1, ProtoOATradeSide.BUY, Convert.ToInt64(100000), 1.2);

            Transmit(msg);
        }
Example #2
0
        void SendStopOrderRequest(OpenApiMessagesFactory msgFactory, Queue writeQueue)
        {
            var _msg = msgFactory.CreateStopOrderRequest(AccountId, AccessToken, "EURUSD", OpenApiLib.ProtoTradeSide.BUY, 1000000, 0.2, clientMsgId);

            if (isDebugIsOn)
            {
                Console.WriteLine("SendStopOrderRequest() Message to be sent:\n{0}", OpenApiMessagesPresentation.ToString(_msg));
            }
            writeQueue.Enqueue(_msg.ToByteArray());
        }
        private void SendStopOrderRequest(long testAccountId)
        {
            var _msg = outgoingMsgFactory.CreateStopOrderRequest(testAccountId, authToken, "EURUSD", ProtoTradeSide.BUY, 1000000, 0.2, clientMsgId);

            if (isDebugIsOn)
            {
                Console.WriteLine("SendStopOrderRequest() Message to be send:\n{0}", OpenApiMessagesPresentation.ToString(_msg));
            }
            writeQueue.Enqueue(Utils.Serialize(_msg));
        }
Example #4
0
        protected void btnSendStopOrderRequest_Click(object sender, EventArgs e)
        {
            SendAuthorizationRequest();
            var accountID  = ddlTradingAccounts.SelectedValue;
            var token      = Session["Token"].ToString();
            var msgFactory = new OpenApiMessagesFactory();
            var msg        = msgFactory.CreateStopOrderRequest(Convert.ToInt32(accountID), token, "EURUSD", OpenApiLib.ProtoTradeSide.BUY, 1000000, 0.2);

            Transmit(msg);
            byte[] _message     = Listen(_apiSocket);
            var    protoMessage = msgFactory.GetMessage(_message);

            lblResponse.Text = OpenApiMessagesPresentation.ToString(protoMessage);
        }