ROOT_Application
2.0
C++ Core modules and GUIStock
|
"Clever" enumeration of the ListDataStock type : StockCSV, Volume, EMA, BOLL,... More...
#include <Indicator.h>
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 > ¶m) |
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... | |
"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.
|
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.
|
inline |
Constructors.
Constructor, e.g., Indicator indic(Indicator::StockCSV)
Definition at line 49 of file Indicator.h.
void Indicator::Change | ( | int | new_value | ) |
Definition at line 373 of file Indicator.cpp.
References anonymous_namespace{Indicator.cpp}::indicator_nb_output_, and v_.
|
private |
Definition at line 204 of file Indicator.cpp.
References anonymous_namespace{Indicator.cpp}::indicator_labels_.
Referenced by Set().
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().
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().
|
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().
|
static |
Get a list of all indicator's label.
Definition at line 57 of file Indicator.cpp.
References anonymous_namespace{Indicator.cpp}::indicator_labels_, and anonymous_namespace{Indicator.cpp}::nb_label.
Referenced by MainIndicatorTHStockFrame::CreateToolBar(), MainIndicatorTHStockFrame::ExtractInfoForValidation(), and MainIndicatorTHStockFrame::ResetEntries().
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().
|
inline |
const std::string Indicator::label | ( | ) | const |
Get the 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().
int Indicator::MakeColor | ( | const char | str_color | ) |
Definition at line 362 of file Indicator.cpp.
Referenced by ControllerIndicatorTHStock::AddData().
int Indicator::MakeEColor | ( | const char | str_color | ) |
Definition at line 351 of file Indicator.cpp.
Referenced by FactoryObjectStock::CreateObjectStock().
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().
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().
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().
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().
Definition at line 111 of file Indicator.h.
|
friend |
Output the label.
Definition at line 298 of file Indicator.cpp.
Definition at line 108 of file Indicator.h.
|
static |
Definition at line 44 of file Indicator.h.
Referenced by TAlibAPI::Compute(), Stock::ComputeTA(), and GetIndicator().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by TAlibAPI::Compute(), and GetIndicator().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by GetIndicator().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by TAlibAPI::Compute(), and GetIndicator().
|
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().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by TAlibAPI::Compute(), FactoryObjectStock::CreateObjectStock(), and GetIndicator().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by GetIndicator().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by TAlibAPI::Compute(), and GetIndicator().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by Stock::AddListDataToMap(), Stock::ComputeTA(), GetIndicator(), Stock::LoadCSVData(), Stock::Read_HeaderCSV(), Stock::Read_HeaderCSV_static(), Stock::ReadCSV(), Stock::SaveCSV(), Stock::Transform_TimeScale(), ListDataStock_Utils::TransformTimeScale(), Stock::UpdateCSV_Inst(), Stock::UpdateCSVFromFile(), Stock::UpdateCSVFromWeb(), TransDateBox::Valid(), MainControllerIndicatorTHStock::Validation(), and Stock::WriteCSV().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by Stock::AddListDataToMap(), Stock::ComputeTA(), GetIndicator(), Stock::LoadCSVData(), Stock::SaveCSV(), StockManager::SendDatadCSV(), Stock::Transform_TimeScale(), Stock::UpdateCSVFromFile(), TransDateBox::Valid(), MainControllerIndicatorTHStock::Validation(), and Stock::WriteCSV().
|
private |
Definition at line 36 of file Indicator.h.
Referenced by Change(), GetDefaultValues(), GetDescription(), HasDefaultValues(), integral(), label(), nb_input(), nb_output(), nb_param(), NeedToComputeTA(), and Set().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by Stock::AddListDataToMap(), Stock::ComputeTA(), GetIndicator(), Stock::LoadCSVData(), Stock::SaveCSV(), Stock::Transform_TimeScale(), ListDataStock_Utils::TransformTimeScale(), and Stock::WriteCSV().
|
static |
Definition at line 44 of file Indicator.h.
Referenced by GetIndicator().