Package com.quantcomponents.marketdata

Examples of com.quantcomponents.marketdata.IStockDatabase


    cacheById.put(id, cacheItem);
    cacheByStockDb.put(stockDatabase, cacheItem);
  }
 
  private IStockDatabase getOrCreate(StockDatabaseHeader hdr) throws SQLException {
    IStockDatabase stockDatabase;
    StockDbCacheInfo cacheItem = cacheById.get(hdr.id);
    if (cacheItem != null)  {
      stockDatabase = cacheItem.stockDatabase;
    } else {
      stockDatabase = new StockDatabase(hdr.contract, hdr.dataType, hdr.barSize, hdr.includeAfterHours, hdr.timeZone);
      IMutableOHLCTimeSeries ohlcTimeSeries = stockDatabase.getOHLCTimeSeries();
      for (IOHLCPoint ohlc : ohlcPointDao.find(hdr.id)) {
        ohlcTimeSeries.addLast(ohlc);
      }
      IMutableTickTimeSeries tickTimeSeries = stockDatabase.getTickTimeSeries();
      for (ITickPoint tick : tickPointDao.find(hdr.id)) {
        tickTimeSeries.addLast(tick);
      }
      addToCache(stockDatabase, hdr.id);
    }
View Full Code Here


      Map<String, ISeries<Date, Double, ISeriesPoint<Date, Double>>> inputSeries = tradingManager.getBindingInputSeries(bindingHandle);
      if (inputSeries != null) {
        for (Map.Entry<String, ISeries<Date, Double, ISeriesPoint<Date, Double>>> entry : inputSeries.entrySet()) {
          ISeries<Date, Double, ISeriesPoint<Date, Double>> input = entry.getValue();
          if (input != null) {
            IStockDatabase stockDatabase = marketDataManager.getStockDatabase(entry.getValue().getPersistentID());
            inputStockDatabases.put(entry.getKey(), stockDatabase);
          }
        }
      }
    }
View Full Code Here

  }

  @Override
  public ServiceHandle<IStockDatabaseHost> findStockDatabase(IContract contract, DataType dataType, BarSize barSize, Boolean includeAfterHours) {
    ServiceHandle<IStockDatabaseHost> serviceHandle = null;
    IStockDatabase stockDatabase = getMarketDataManager().findStockDatabase(contract, dataType, barSize, includeAfterHours);
    if (stockDatabase != null) {
      serviceHandle = publishStockDbHost(stockDatabase);
    }
    return serviceHandle;
  }
View Full Code Here

  }

  @Override
  public ServiceHandle<IStockDatabaseHost> getStockDatabase(String ID) throws ConnectException, RequestFailedException {
    ServiceHandle<IStockDatabaseHost> serviceHandle = null;
    IStockDatabase stockDatabase = getMarketDataManager().getStockDatabase(ID);
    if (stockDatabase != null) {
      serviceHandle = publishStockDbHost(stockDatabase);
    }
    return serviceHandle;
  }
View Full Code Here

    return serviceHandle;
  }

  @Override
  public ServiceHandle<IStockDatabaseHost> createStockDatabase(IContract contract, DataType dataType, BarSize barSize, boolean includeAfterHours, TimeZone timeZone) {
    IStockDatabase stockDb = getMarketDataManager().createStockDatabase(contract, dataType, barSize, includeAfterHours, timeZone);
    return publishStockDbHost(stockDb);
  }
View Full Code Here

  }

  @Override
  public IStockDatabase getStockDatabase(ServiceHandle<IStockDatabaseHost> handle) {
    StockDatabaseInfo info = retrieveStockDatabaseInfo(handle);
    IStockDatabase stockDb = null;
    if (info != null) {
      stockDb = info.stockDatabase;
    }
    return stockDb;
  }
View Full Code Here

    return (Collection<IStockDatabase>) (Collection<?>) getElements();
  }

  @Override
  public StockDatabasePresentationWrapper findStockDatabase(IContract contract, DataType dataType, BarSize barSize, Boolean includeAfterHours) {
    IStockDatabase stockDatabase = getMarketDataManager().findStockDatabase(contract, dataType, barSize, includeAfterHours);
    if (stockDatabase != null) {
      return getOrCreateWrapper(stockDatabase);
    } else {
      return null;
    }
View Full Code Here

    }
  }
 
  @Override
  public StockDatabasePresentationWrapper createStockDatabase(IContract contract, DataType dataType, BarSize barSize, boolean includeAfterHours, TimeZone timeZone) {
    IStockDatabase stockDatabase = getMarketDataManager().createStockDatabase(contract, dataType, barSize, includeAfterHours, timeZone);
    StockDatabasePresentationWrapper wrapper = getOrCreateWrapper(stockDatabase);
    for (IMonitorableContainerListener<StockDatabasePresentationWrapper> listener : listeners) {
      listener.onElementAdded(wrapper);
    }
    return wrapper;
View Full Code Here

        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
        gridData.widthHint = 400;
        inputValueEditors[row].setLayoutData(gridData);
        row++;
      } else {
        IStockDatabase selectedStockDb = inputStockDatabasesByName.get(inputName);
        String selectedStockDbName = nameByStockDatabases.get(selectedStockDb);
        if (selectedStockDbName != null) {
          Text text = new Text(container, SWT.READ_ONLY);
          text.setText(selectedStockDbName);
       
View Full Code Here

    }
    return stockDbHandle;
  }
 
  private IStockDatabase getOrCreateStockDbProxy(ServiceHandle<IStockDatabaseHost> stockDbHandle) {
    IStockDatabase proxy = stockDbProxiesByStockDbHandle.get(stockDbHandle);
    if (proxy == null) {
      proxy = stockDatabaseProxyFactory.createStockDatabaseProxy(stockDbHandle);
      stockDbHandlesByStockDb.put(proxy, stockDbHandle);
      stockDbProxiesByStockDbHandle.put(stockDbHandle, proxy);
    }
View Full Code Here

TOP

Related Classes of com.quantcomponents.marketdata.IStockDatabase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.