Exemple #1
0
        /// <summary>
        /// Updates the journal data from the StatsBuffer.
        /// </summary>
        private void UpdateJournalData()
        {
            if (!Data.IsResult)
            {
                return;
            }

            _journalData = new string[_orders, _columns];
            _orderIcons  = new Image[_orders];
            int[] ordNumbers = ArrangeOrderNumbers();

            for (int ord = _firstOrd; ord < _firstOrd + _shownOrd; ord++)
            {
                int   row   = ord - _firstOrd;
                Order order = StatsBuffer.OrdFromNumb(ordNumbers[ord]);

                _journalData[row, 0] = (order.OrdNumb + 1).ToString(CultureInfo.InvariantCulture);
                _journalData[row, 1] = Language.T(order.OrdDir.ToString());
                _journalData[row, 2] = Language.T(order.OrdType.ToString());
                _journalData[row, 3] = Configs.AccountInMoney
                                           ? (order.OrdDir == OrderDirection.Sell ? "-" : "") +
                                       (order.OrdLots * Data.InstrProperties.LotSize)
                                           : order.OrdLots.ToString(CultureInfo.InvariantCulture);
                _journalData[row, 4] = order.OrdPrice.ToString(Data.FF);
                _journalData[row, 5] = (order.OrdPrice2 > 0 ? order.OrdPrice2.ToString(Data.FF) : "-");
                _journalData[row, 6] = Language.T(order.OrdStatus.ToString());
                _journalData[row, 7] = order.OrdNote;

                // Icons
                _orderIcons[row] = Order.OrderIconImage(order.OrderIcon);
            }
        }