Child pages
  • Creating a New Data Provider

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Before your adapter can return events, it needs to call AbstractMarketDataProvider.addSymbolMapping. This method maps the symbol in an atom to a subclass of {{of org.marketcetera.trade.Instrument}}, as in:

    Code Block
    languagejava
    linenumberstrue
    addSymbolMapping("IBM",new Equity("IBM"));

    This allows the parent class to associate the atom to a particular instrument.

  2. To return events, call AbstractMarketDataProvider.publishEvents using the org.marketcetera.event.Content from the atom that generated the request and the org.marketcetera.trade.Instrument you associated the atom with above.

...

The easiest way to add your provider to the application context is to add a bean to strategyagentstrategyengine.xml like this:

Code Block
languagexml
linenumberstrue
<bean id="myFeed" class="com.marketcetera.marketdata.myfeed.MyFeed">
  <property name="providerRegistry" ref="marketDataManager"/>
</bean>

...