Esempio n. 1
0
        private void OnSend(string arg)
        {
            var candle = JsonConvert.DeserializeObject <Candle>(arg);
            var IsNew  = (candle.time != LastCandleEvent) ? true : false;

            if (IsNew)
            {
                if (!candlesHistory.ContainsKey(candle.figi))
                {
                    candlesHistory.Add(candle.figi, new List <Candle>());
                }

                candlesHistory[candle.figi].Add(candle);
            }
            else
            {
                if (!candlesHistory.ContainsKey(candle.figi))
                {
                    candlesHistory.Add(candle.figi, new List <Candle>());
                }

                var item = candlesHistory[candle.figi];
                item[item.Count - 1] = candle;
            }

            CandleEvent?.Invoke(candle, IsNew);


            LastCandleEvent = candle.time;
        }
Esempio n. 2
0
        protected override void OnItemHoverted(object userData)
        {
            base.OnItemHoverted(userData);
            CandleEventArgs args = userData as CandleEventArgs;

            if (CandleHovered != null)
            {
                CandleHovered.Invoke(args);
            }
        }
Esempio n. 3
0
 public static void OnCandleEvent(CandleEventArgs e)
 {
     CandleEvent?.Invoke(typeof(Events), e);
 }