Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
TSAComponent.h
1 /* ===================================================================
2 *
3 * T R A D I N G S Y S T E M A P I ™
4 * Copyright © 1999 - 2014 by Peter Ritter ( TradingSystemAPI.com )
5 * A L L R I G H T S R E S E R V E D
6 *
7 * Consult your license regarding permissions and restrictions.
8 * You may obtain a copy of the License at:
9 * http://www.TradingSystemAPI.com/licenses/LICENSE-TSAPI-3.0.html
10 *
11 * ====================================================================
12 */
13 
14 #ifndef TSA_COMPONENT__INCLUDED
15 #define TSA_COMPONENT__INCLUDED
16 
17 #include "TSAString.h"
18 
19 namespace tsa {
20  class strategy;
21 
25  /*
26  ** ====================================================
27  ** > > > class component < < <
28  ** ====================================================
29  */
30 
34  class dll_export component {//NOTE: Do not inherit from tsa::object
35  tsa_declare_testable;
36  private:
37  strategy* m_strategy_ptr;
38  std::string m_identifier;
39  bool m_is_registered_with_strategy;
40  static const std::string cl_name;
41  public:
43  component(void);
44 
46  virtual ~component(void);
47  public:
49  void set_identifier(const std::string&);
50 
52  const std::string& get_identifier(void) const;
53 
55  strategy* get_TLS_strategy_ptr(void);
56 
58  strategy* get_strategy_ptr(void) const;
59 
60  void set_strategy(strategy*);
61 
63  void register_with_strategy(strategy*);
64 
66  bool is_registered_with_strategy(void) const;
67  public:
69  virtual void cmp__evaluate_bar(const date_time&);
70 
72  virtual void cmp__post_evaluate_bar(const date_time&);
73 
74  //.
75  virtual void cmp__master_evaluate_bar(const date_time&);
76 
78  virtual void cmp__finalize(void);
79  };
81 } //tsa
82 #endif
Namespace for the &#39;Trading System API&#39; library.
Definition: original1.TSA3Core.cpp:20
Class strategy represents a trading or investment strategy.
Definition: TSAStrategy.h:108
Class representing a gregorian-date and time-of-day combination. The time component has microsecond r...
Definition: TSATime.h:428
Base class for components such as series_base adaptors.
Definition: TSAComponent.h:34