Exemple #1
0
        public static void CreditOperation(this MT4Manager mt4, int login, double amount, int codePage, [Optional] string comment, [Optional] DateTime expiration)
        {
            var operation = new MT4CreditOperation()
            {
                Login      = login,
                Amount     = amount,
                Comment    = comment,
                Expiration = expiration == DateTime.MinValue ? mt4.ServerTime().AddMonths(50) : expiration
            };

            mt4.CreditOperation(operation, codePage);
        }
Exemple #2
0
 public static TradeTransInfo ToTradeTransInfo(this MT4CreditOperation operation, int codePage)
 {
     return(new TradeTransInfo(codePage)
     {
         OrderBy = operation.Login,
         Price = operation.Amount,
         Comment = operation.Comment,
         Type = TradeTransactionType.BROKER_BALANCE,
         Cmd = TradeCommand.CREDIT,
         Expiration = operation.Expiration
     });
 }
Exemple #3
0
        /// <summary>
        /// Добавляет кредитную операцию на счет
        /// </summary>
        /// <param name="mt4"></param>
        /// <param name="operation">Операцию, которую необходимо добавить</param>
        /// <param name="tocken"></param>
        /// <returns></returns>
        public static void CreditOperation(this MT4Manager mt4, MT4CreditOperation operation, int codePage)
        {
            var transeInfo = operation.ToTradeTransInfo(codePage);

            transeInfo = mt4.TradeTransaction(transeInfo);
        }