#ifndef __NewDayDetector_h_ #define __NewDayDetector_h_ // The data feed decides when to reset the daily high and low prices. We // maintain the high and low bid and ask values, and similar data, ourselves. // We want to reset these at the same time as the data feed resets the high // and low prices. // // This is mostly obsolete. Some of this was based on when we left things // running overnight. However, a few alerts still use it. // // This will signal its listeners when when we think the new trading day // has started. Currently this is implemented by looking for the first print // during market hours. This is based heavily on eSignal, which didn't reset // some of its data until the first print. We use the daily high field to tell // us when we see the first official print. #include "GenericTosData.h" class NewDay : public DataNode { private: enum LastState { lsUnknown, lsPreMarket, lsNotPreMarket } _lastState; GenericTosDataNode *_tosData; void onWakeup(int msgId); NewDay(DataNodeArgument const &args); friend class DataNode; public: static DataNodeLink *find(DataNodeListener *listener, int msgId, NewDay *&node, std::string const &symbol); static DataNodeLink *find(DataNodeListener *listener, int msgId, std::string const &symbol); }; #endif