the-james-burton / the-turbine

The turbine is a set of server-side components that perform automated technical analysis on stocks.
MIT License
15 stars 7 forks source link

ensure indicators and strategies are computed after the tick is received #22

Closed the-james-burton closed 7 years ago

the-james-burton commented 7 years ago

RabbitMQ multicasts the tick to four destinations in the turbine-condenser. At present, the processing order is not guaranteed for these, so the indicators and strategies may be computed on a Ta4J TimeSeries that does not have the tick in it. This should be fixed

the-james-burton commented 7 years ago

Done with a CountDownLatch mapped to tick timestamp to enable the indicators and strategies to wait for their tick to be received.

Also added a sneaky bit of synchonized for better concurrency when a new Ticker is being setup.

Just need to setup a cleanup for the map.

the-james-burton commented 7 years ago

Actually, change the map to a caffeine cache!

the-james-burton commented 7 years ago

Done and works nicely... closing.