Beispiel #1
0
        private async void ExecuteOrderCheck(object obj)
        {
            var request = TradeRequest.GetMqlTradeRequest();
            MqlTradeCheckResult result = null;
            var retVal = await Execute(() =>
            {
                var ok = _mtApiClient.OrderCheck(request, out result);
                return(ok);
            });

            var message = retVal ? $"OrderCheck: success. {result}" : $"OrderCheck: fail. {result}";

            AddLog(message);
        }
Beispiel #2
0
        private async void ExecuteOrderSend(object o)
        {
            var request = TradeRequest.GetMqlTradeRequest();

            var retVal = await Execute(() =>
            {
                MqlTradeResult result;
                var ok = _mtApiClient.OrderSend(request, out result);
                return(ok ? result : null);
            });

            var message = retVal != null ? $"OrderSend successed. {MqlTradeResultToString(retVal)}" : "OrderSend failed.";

            AddLog(message);
        }
Beispiel #3
0
        private void ExecuteOrderSend(object o)
        {
            var request = TradeRequest.GetMqlTradeRequest();

            MqlTradeResult result;
            bool           retVal = mMtApiClient.OrderSend(request, out result);

            string historyItem;

            if (retVal == true)
            {
                historyItem = "OrderSend successed. " + MqlTradeResultToString(result);
            }
            else
            {
                historyItem = "OrderSend failed. " + MqlTradeResultToString(result);
            }

            History.Add(historyItem);
        }