Examples of IStockDatabase


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

Examples of com.quantcomponents.marketdata.IStockDatabase

      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

Examples of com.quantcomponents.marketdata.IStockDatabase

  }

  @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

Examples of com.quantcomponents.marketdata.IStockDatabase

  }

  @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

Examples of com.quantcomponents.marketdata.IStockDatabase

    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

Examples of com.quantcomponents.marketdata.IStockDatabase

  }

  @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

Examples of com.quantcomponents.marketdata.IStockDatabase

    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

Examples of com.quantcomponents.marketdata.IStockDatabase

    }
  }
 
  @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

Examples of com.quantcomponents.marketdata.IStockDatabase

        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

Examples of com.quantcomponents.marketdata.IStockDatabase

    }
    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
Copyright © 2018 www.massapi.com. 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.