private void m_btnMarketRangeOrder_Click(object sender, EventArgs e)
        {
            var msgFactory = new OpenApiMessagesFactory();
            var msg        = msgFactory.CreateMarketRangeOrderRequest(Convert.ToInt32(_accountID), _token, 1, ProtoOATradeSide.BUY, Convert.ToInt64(100000), 1.2, 5);

            Transmit(msg);
        }
Beispiel #2
0
        void SendMarketRangeOrderRequest(OpenApiMessagesFactory msgFactory, Queue writeQueue)
        {
            var _msg = msgFactory.CreateMarketRangeOrderRequest(AccountId, AccessToken, "EURUSD", OpenApiLib.ProtoTradeSide.BUY, testVolume, 1.09, 10, clientMsgId);

            if (isDebugIsOn)
            {
                Console.WriteLine("SendMarketRangeOrderRequest() Message to be sent:\n{0}", OpenApiMessagesPresentation.ToString(_msg));
            }
            writeQueue.Enqueue(_msg.ToByteArray());
        }
Beispiel #3
0
        protected void btnSendMarketRangeOrderRequest_Click(object sender, EventArgs e)
        {
            SendAuthorizationRequest();
            var accountID  = ddlTradingAccounts.SelectedValue;
            var token      = Session["Token"].ToString();
            var msgFactory = new OpenApiMessagesFactory();
            var msg        = msgFactory.CreateMarketRangeOrderRequest(Convert.ToInt32(accountID), token, "EURUSD", OpenApiLib.ProtoTradeSide.BUY, 100000, 1.09, 10);

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

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