Пример #1
0
        public static ChartRangeCommand CreateChartRangeCommand(ChartRangeInfoRecord info, bool prettyPrint = false)
        {
            JSONObject args = new JSONObject();

            args.Add("info", info.toJSONObject());
            return(new ChartRangeCommand(args, prettyPrint));
        }
        public void Notowania(PERIOD_CODE pc, long Zakres)
        {
            tabelaWynikow = new double[10000];
            try
            {
                SyncAPIConnector connector     = new SyncAPIConnector(serverData);
                Credentials      credentials   = new Credentials(userId, password, "", "pixelNet");
                LoginResponse    loginResponse = APICommandFactory.ExecuteLoginCommand(connector, credentials, true);

                double ms   = DateTime.Now.Subtract(DateTime.MinValue.AddYears(1969)).TotalMilliseconds;
                long?  msd  = Convert.ToInt64(ms);
                long?  msd1 = msd - (Zakres * (60 * 1000));//17800 10000min
                ChartRangeInfoRecord zakres             = new ChartRangeInfoRecord(Nazwa, pc, msd1, msd, 0);
                ChartRangeResponse   chartRangeResponse = APICommandFactory.ExecuteChartRangeCommand(connector, zakres);

                int tabdl  = 0;
                int dlresp = chartRangeResponse.RateInfos.Count - 10000;

                double podz = dziesiatki + ulamek;
                podz = Math.Pow(10, podz);

                foreach (xAPI.Records.RateInfoRecord nota in chartRangeResponse.RateInfos)
                {
                    if (tabdl >= dlresp)
                    {
                        tabelaWynikow[tabdl - dlresp] = (double)nota.Open / podz;
                    }
                    tabdl++;
                }
                LogoutResponse logoutResponse = APICommandFactory.ExecuteLogoutCommand(connector);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Пример #3
0
 public static ChartRangeResponse ExecuteChartRangeCommand(SyncAPIConnector connector, ChartRangeInfoRecord info, bool prettyPrint = false)
 {
     return(new ChartRangeResponse(connector.ExecuteCommand(CreateChartRangeCommand(info, prettyPrint)).ToString()));
 }