protected object XtraCreateHistoryItem(XtraItemEventArgs e)
        {
            ArbitrageStatisticsItem item = new ArbitrageStatisticsItem();

            History.Add(item);
            return(item);
        }
Exemplo n.º 2
0
        void UpdateHistory(double prev)
        {
            if (MaxProfitUSD < 0 && prev < 0)
            {
                return;
            }
            if (Math.Abs(MaxProfitUSD - prev) < 0.0000001)
            {
                return;
            }
            ArbitrageStatisticsItem st = new ArbitrageStatisticsItem();

            st.Amount            = Amount;
            st.LowestAskHost     = LowestAskHost;
            st.LowestAskEnabled  = LowestAskEnabled;
            st.LowestAsk         = LowestAsk;
            st.HighestBidHost    = HighestBidHost;
            st.HighestBidEnabled = HighestBidEnabled;
            st.HighestBid        = HighestBid;
            st.Spread            = Spread;
            st.BaseCurrency      = LowestAskTicker.BaseCurrency;
            st.MarketCurrency    = LowestAskTicker.MarketCurrency;
            st.MaxProfit         = MaxProfit;
            st.MaxProfitUSD      = MaxProfitUSD;
            st.Time      = DateTime.UtcNow;
            st.RateInUSD = UsdTicker == null? 1: UsdTicker.Last;
            if (!Owner.Disabled)
            {
                lock (ArbitrageHistoryHelper.Default.History) {
                    ArbitrageHistoryHelper.Default.History.Add(st);
                    ArbitrageHistoryHelper.Default.CheckSave();
                }
            }
        }