public async void Create(LiveDayComparison comp_, RollGeneration generation_)
    {
      var con = await Task.Run(() => comp_.GetMinuteFrontBackOpenInterestValues(generation_));

      lineChartDataDisplay1.ClearSeries();

      if (con == null || con.Keys.Count == 0)
        return;

      {
        var frontPct = new double[con.Keys.Count];
        var backPct = new double[con.Keys.Count];

        for (int i = 0; i < con.Keys.Count; ++i)
        {
          var vals = con.GetValues(con.Keys[i]);

          frontPct[i] = vals[0]/(vals[0] + vals[1]);
          backPct[i] = vals[1] / (vals[0] + vals[1]);
        }

              var labels = con.Keys.Select(x => x.ToString()).ToArray();

        var chart = lineChartDataDisplay1.AddSeries(
          xAxisValues_: labels,
          values_: frontPct,
          desc_: "Front",
          yAxisExtent_: 40,
          yLabelFormat_: "##0.0%",
          color_:Color.White
          );

        chart.AxisX.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart;
        chart.AxisX.Extent = 60;
        chart.AxisX.TickmarkInterval = 10;
        chart.AxisX.TickmarkPercentage = 0.1;
        chart.AxisX.MajorGridLines.Visible = false;

        chart= lineChartDataDisplay1.AddSeries(
          xAxisValues_: labels,
          values_: backPct,
          desc_: "Back",
          yAxisExtent_: 40,
          yLabelFormat_: "##0.0%",
          color_: Color.Yellow
          );

        chart.AxisX.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart;
        chart.AxisX.Extent = 60;
        chart.AxisX.TickmarkInterval = 10;
        chart.AxisX.TickmarkPercentage = 0.1;
        chart.AxisX.MajorGridLines.Visible = false;
      }

    }
Пример #2
0
    public async void Initiate()
    {
      // already initiated?
      if (_dict.Any()) return;

      Singleton<DayCache>.Instance.SetFilterAfterMonthsAgo(4);

      var successfullyRefreshed = await Singleton<DayCache>.Instance.RefreshFromServer();

      if (!successfullyRefreshed)
      {
        Logger.Error("Refresh of DayCache from server was not successful", typeof (ModelCache));
        return;
      }

      // find all sets that have a live set
      foreach (var liveSet in Singleton<DayCache>.Instance.InnerList.Where(x=>x.RollDate>=DateTime.Today).Select(x=>x.Set).Distinct())
      {
        // find the live one and the prior one

        var firstTwoForset =
          Singleton<DayCache>.Instance.InnerList.Where(x => x.Set == liveSet)
            .OrderByDescending(x => x.RollDate)
            .Take(2)
            .ToArray();


        var current = firstTwoForset[0];
        var prior = firstTwoForset[1];

        var ldc = new LiveDayComparison(current, prior);

        await ldc.PopulateAsync();

        _dict.Add(liveSet, ldc);

        OnLiveDayComparisonReady(new LiveDayComparisonReadyEventArgs(ldc));
      }
    }
 public LiveDayComparisonReadyEventArgs(LiveDayComparison ldc_)
 {
   Item = ldc_;
 }
Пример #4
0
 public LDC_DispLine_Link(LiveDayComparison ldc_, DisplayLine line_ )
 {
 }