ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes
Indicator Class Reference

"Clever" enumeration of the ListDataStock type : StockCSV, Volume, EMA, BOLL,... More...

#include <Indicator.h>

Collaboration diagram for Indicator:
Collaboration graph
[legend]

Public Member Functions

std::string const label () const
 Get the label. More...
 
int nb_param () const
 Nb of parameters necessary to be computed. More...
 
int nb_input () const
 Nb of ListDataStock input to be computed. More...
 
int nb_output () const
 Nb of ListDataStock output of TALib computation. More...
 
bool HasDefaultValues () const
 Test functions if default values are provided. More...
 
std::vector< int > GetDefaultValues () const
 Get the default values, return an empty vector if none are provided. More...
 
std::string GetDescription () const
 Graphical description. More...
 
std::vector< std::string > parse_description () const
 Utility function to parse the description. More...
 
bool NeedToComputeTA () const
 Test function if this indicator is computed with TALib interface. More...
 
void Set (std::string str_name, std::vector< int > &param)
 
int MakeEColor (const char str_color)
 
int MakeColor (const char str_color)
 
void Change (int new_value)
 
Value integral () const
 To use in the case of a switch. More...
 

Static Public Member Functions

static std::vector< std::string > GetListAllIndicator ()
 Get a list of all indicator's label. More...
 

Static Public Attributes

static Indicator const Null
 Predefined static instances of the class. More...
 
static Indicator const StockCSV
 
static Indicator const StockInst
 
static Indicator const Volume
 
static Indicator const SMA
 
static Indicator const EMA
 
static Indicator const WMA
 
static Indicator const MACD
 
static Indicator const BOLL
 
static Indicator const RSI
 
static Indicator const AD
 
static Indicator const STOCHF
 

Private Types

enum  Value {
  null_l, csv_l, inst_l, volume_l,
  sma_l, ema_l, wma_l, macd_l,
  boll_l, rsi_l, ad_l, stochf_l
}
 Internally define an enumeration. More...
 

Private Member Functions

Value FindValue (std::string) const
 

Private Attributes

Value v_
 

Friends

Comparison and Output overloaded operators
bool operator== (Indicator const &a, Indicator const &b)
 
bool operator!= (Indicator const &a, Indicator const &b)
 
std::ostream & operator<< (std::ostream &o, Indicator c)
 Output the label. More...
 
 Indicator (Value v)
 Constructors. More...
 
static Indicator GetIndicator (const std::string &str_name)
 Constructor with a string label. More...
 

Detailed Description

"Clever" enumeration of the ListDataStock type : StockCSV, Volume, EMA, BOLL,...

Class which defines static instances and group all data about a specific indicator:

Definition at line 29 of file Indicator.h.

Member Enumeration Documentation

enum Indicator::Value
private

Internally define an enumeration.

Enumerator
null_l 
csv_l 
inst_l 
volume_l 
sma_l 
ema_l 
wma_l 
macd_l 
boll_l 
rsi_l 
ad_l 
stochf_l 

Definition at line 34 of file Indicator.h.

Constructor & Destructor Documentation

Indicator::Indicator ( Value  v)
inline

Constructors.

Constructor, e.g., Indicator indic(Indicator::StockCSV)

Definition at line 49 of file Indicator.h.

Member Function Documentation

void Indicator::Change ( int  new_value)

Definition at line 373 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::indicator_nb_output_, and v_.

Indicator::Value Indicator::FindValue ( std::string  str_name) const
private

Definition at line 204 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::indicator_labels_.

Referenced by Set().

Here is the caller graph for this function:

std::vector< int > Indicator::GetDefaultValues ( ) const

Get the default values, return an empty vector if none are provided.

Definition at line 88 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::default_value_, nb_output(), and v_.

Referenced by MainIndicatorTHStockFrame::ResetEntries().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Indicator::GetDescription ( ) const

Graphical description.

Definition at line 102 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::descp_, and v_.

Referenced by FactoryObjectStock::CreateObjectStock(), and parse_description().

Here is the caller graph for this function:

Indicator Indicator::GetIndicator ( const std::string &  str_name)
static

Constructor with a string label.

use:

Return Indicator::Null if the string does not match a known label

Definition at line 234 of file Indicator.cpp.

References AD, BOLL, EMA, MACD, Null, RSI, SMA, Utils::splitline(), STOCHF, StockCSV, StockInst, Volume, and WMA.

Referenced by ControllerIndicatorTHStock::AddData(), THStock::AddPairToVector(), FullName::GetIndicator(), ShortName::GetIndicator(), and MainIndicatorTHStockFrame::ResetEntries().

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > Indicator::GetListAllIndicator ( )
static
bool Indicator::HasDefaultValues ( ) const

Test functions if default values are provided.

Definition at line 83 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::bool_default_, and v_.

Referenced by MainIndicatorTHStockFrame::ResetEntries().

Here is the caller graph for this function:

Value Indicator::integral ( ) const
inline

To use in the case of a switch.

Definition at line 104 of file Indicator.h.

References v_.

const std::string Indicator::label ( ) const

Get the label.

Returns
const string label

Definition at line 51 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::indicator_labels_, and v_.

Referenced by Stock::ComputeTA(), FactoryObjectStock::CreateObjectStock(), Stock::DeleteListData(), GetString(), operator<<(), and TALibException::TALibException().

Here is the caller graph for this function:

int Indicator::MakeColor ( const char  str_color)

Definition at line 362 of file Indicator.cpp.

Referenced by ControllerIndicatorTHStock::AddData().

Here is the caller graph for this function:

int Indicator::MakeEColor ( const char  str_color)

Definition at line 351 of file Indicator.cpp.

Referenced by FactoryObjectStock::CreateObjectStock().

Here is the caller graph for this function:

int Indicator::nb_input ( ) const

Nb of ListDataStock input to be computed.

Definition at line 73 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::indicator_nb_input_, and v_.

int Indicator::nb_output ( ) const

Nb of ListDataStock output of TALib computation.

Definition at line 78 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::indicator_nb_output_, and v_.

Referenced by Stock::ComputeTA(), and GetDefaultValues().

Here is the caller graph for this function:

int Indicator::nb_param ( ) const

Nb of parameters necessary to be computed.

Definition at line 68 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::indicator_nb_param_, and v_.

Referenced by Stock::ComputeTA(), and MainIndicatorTHStockFrame::ResetEntries().

Here is the caller graph for this function:

bool Indicator::NeedToComputeTA ( ) const

Test function if this indicator is computed with TALib interface.

Definition at line 192 of file Indicator.cpp.

References anonymous_namespace{Indicator.cpp}::indicator_labels_, anonymous_namespace{Indicator.cpp}::indicator_nb_param_, and v_.

std::vector< std::string > Indicator::parse_description ( ) const

Utility function to parse the description.

Definition at line 112 of file Indicator.cpp.

References GetDescription().

Referenced by ControllerIndicatorTHStock::AddData(), and FactoryObjectStock::CreateObjectStock().

Here is the call graph for this function:

Here is the caller graph for this function:

void Indicator::Set ( std::string  str_name,
std::vector< int > &  param 
)

Definition at line 304 of file Indicator.cpp.

References FindValue(), and v_.

Referenced by Stock::ComputeTA(), and Stock::UpdateAllTimeScale().

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

bool operator!= ( Indicator const &  a,
Indicator const &  b 
)
friend

Definition at line 111 of file Indicator.h.

std::ostream& operator<< ( std::ostream &  o,
Indicator  c 
)
friend

Output the label.

Definition at line 298 of file Indicator.cpp.

bool operator== ( Indicator const &  a,
Indicator const &  b 
)
friend

Definition at line 108 of file Indicator.h.

Field Documentation

Indicator const Indicator::AD
static

Definition at line 44 of file Indicator.h.

Referenced by TAlibAPI::Compute(), Stock::ComputeTA(), and GetIndicator().

Indicator const Indicator::BOLL
static

Definition at line 44 of file Indicator.h.

Referenced by TAlibAPI::Compute(), and GetIndicator().

Indicator const Indicator::EMA
static

Definition at line 44 of file Indicator.h.

Referenced by GetIndicator().

Indicator const Indicator::MACD
static

Definition at line 44 of file Indicator.h.

Referenced by TAlibAPI::Compute(), and GetIndicator().

Indicator const Indicator::Null
static

Predefined static instances of the class.

Definition at line 44 of file Indicator.h.

Referenced by Stock::ComputeTA(), GetIndicator(), Stock::LoadListData(), Stock::UpdateAllTimeScale(), and Stock::UpdateCSVFromFile().

Indicator const Indicator::RSI
static
Indicator const Indicator::SMA
static

Definition at line 44 of file Indicator.h.

Referenced by GetIndicator().

Indicator const Indicator::STOCHF
static

Definition at line 44 of file Indicator.h.

Referenced by TAlibAPI::Compute(), and GetIndicator().

Indicator const Indicator::StockCSV
static
Indicator const Indicator::StockInst
static
Value Indicator::v_
private
Indicator const Indicator::Volume
static
Indicator const Indicator::WMA
static

Definition at line 44 of file Indicator.h.

Referenced by GetIndicator().


The documentation for this class was generated from the following files: