Login
Login

Reply To: news in AlgoQuant

#2968
Ryu
Member

Hi,

Here are some concepts you need to have. First, algoquant simulator is nothing but an elaborated for-loop. It continues to feed “data” into a strategy for simulation. This example shows that the “data” to feed in are in DepthCaches, which are the prices.
http://redmine.numericalmethod.com/projects/public/repository/svn-algoquant/entry/demo/src/main/java/com/numericalmethod/algoquant/model/signal/crossover/demo/DemoSMA2_010.java

Second, a strategy is nothing but a collection of event handlers. In this example, the strategy simply handles event from depth updates (namely price updates) from the simulator.
http://redmine.numericalmethod.com/projects/public/repository/svn-algoquant/entry/core/src/main/java/com/numericalmethod/algoquant/model/signal/technical/crossover/sma2/SMA2Crossover.java

To achieve what you want to do, you will therefore want to

1. create a new event type, e.g., MyNews
2. create a new event handler type, e.g., MyNewsHandler
3. feed the news into the simulator
4. write a strategy than implement the handler MyNewsHandler

The idea is exactly the same as what we have done for prices as in technical indicators. Now, I admit that there will be some programming and understanding of the code involved. That’s why we open up the source code so the users can modify in however they want, hence the maximal flexibility.

Hope this helps.