|
ROOT_Application
2.0
C++ Core modules and GUIStock
|
Data type to describe Japanese candlesticks : open, high, low and close values. More...
#include <DataStock.h>


Public Member Functions | |
| DataCSV () | |
| Default constructor, set date and all values to 0. More... | |
| DataCSV (time_t d, type_value_data iopen, type_value_data ihigh, type_value_data ilow, type_value_data iclose) | |
| Constructor with all arguments explicit. More... | |
| DataCSV (unsigned int) | |
| Constructor with integer, no effect here but need for MultiData and ListDatStock template. More... | |
| DataCSV (const DataCSV &rhs) | |
| Copy constructor. More... | |
| DataCSV (DataCSV &&rhs) | |
| Move copy constructor. More... | |
| virtual | ~DataCSV () |
| Destructor. More... | |
Assignment operators | |
| DataCSV & | operator= (const DataCSV &rhs) |
| Normal assignment. More... | |
| DataCSV & | operator= (DataCSV &&rhs) |
| Move assignment. More... | |
Implementation of pure virtual functions for DataCSV | |
| virtual void | SetData (const time_t d, const std::vector< type_value_data > &vec) |
| Set a full Data : date + value(s) in a vector. More... | |
| virtual std::vector < type_value_data > | GetValues () const |
| Return the values in a vector, always 4 values: open, high, low, close. More... | |
| virtual void | SetValues (std::vector< type_value_data > &vec) |
| Set the values with the same order. More... | |
| virtual type_value_data | GetMaximum () const |
| Get the maximum value. More... | |
| virtual type_value_data | GetMinimum () const |
| Get the minimum value. More... | |
| virtual bool | HasChanged (const DataStock &data_to_check) const |
| Check if data are different. More... | |
| virtual void | ExtractCSVLine (std::vector< std::string > &linecsv) |
| Extract date and data from a split string. More... | |
| void | PrintData (const unsigned int verbose=0) const |
| User friendly output on screen. More... | |
Specific to DataCSV | |
Specific getters and setters for candlesticks | |
| type_value_data | GetOpen () const |
| type_value_data | GetHigh () const |
| type_value_data | GetLow () const |
| type_value_data | GetClose () const |
| void | SetOpen (type_value_data iopen) |
| void | SetClose (type_value_data iclose) |
| void | SetHigh (type_value_data ihigh) |
| void | SetLow (type_value_data ilow) |
| void | Reset () |
| Set high and low values respectively to the minimum and maximum possible values for the type. More... | |
| void | SetValues (const type_value_data iopen, const type_value_data ihigh, const type_value_data ilow, const type_value_data iclose) |
| Set all data with explicit arguments. More... | |
| void | SetData (const time_t d, const type_value_data iopen, const type_value_data ihigh, const type_value_data ilow, const type_value_data iclose) |
| Set date and all data with explicit arguments. More... | |
Update this candle with values of an other DataStock | |
| virtual void | AdditionData (const DataCSV &new_data) |
| With an other candlestick. More... | |
| virtual void | AdditionData (const SimpleData &new_data) |
| As previous, but only one value in new_data. More... | |
Public Member Functions inherited from DataStock | |
| DataStock () | |
| Default constructor set date to 0. More... | |
| DataStock (time_t d) | |
| Set the date, used in initialization of derived classes. More... | |
| DataStock (const DataStock &rhs) | |
| Copy constructor. More... | |
| DataStock (DataStock &&rhs) | |
| Move copy constructor. More... | |
| virtual | ~DataStock () |
| Destructor. More... | |
| DataStock & | operator= (const DataStock &rhs) |
| Normal assignment. More... | |
| DataStock & | operator= (DataStock &&rhs) |
| Move assignment. More... | |
| time_t | GetDate () const |
| Get the date data member. More... | |
| void | SetDate (const time_t d) |
| Modify the date. More... | |
| std::string | GetDateString (const bool bhours=true) const |
| Return the date in a string format: "YEAR-MOnth-DAy HH:MM:SS" (2014-11-10 13::25::00) More... | |
| struct tm | GetDateTm () const |
| Get a tm structure of the date. More... | |
Protected Member Functions | |
Specific to input/output of DataCSV | |
| virtual void | helper_operator_write (std::ostream &os) const |
| virtual void | helper_operator_read (std::iostream &ios) |
Protected Member Functions inherited from DataStock | |
| int | helper_operator_read_base (std::iostream &ios) |
| Helper function for operator<< for reading date from input streams. More... | |
| void | helper_operator_write_base (std::ostream &os) const |
| Helper function for operator>> for writing date to output. More... | |
Private Attributes | |
4 values to describe a candlestick | |
| type_value_data | open |
| type_value_data | high |
| type_value_data | low |
| type_value_data | close |
Friends | |
| bool | operator== (const DataCSV &lhs, const DataCSV &rhs) |
| Compare all fields, date and values. More... | |
Additional Inherited Members | |
Protected Attributes inherited from DataStock | |
| time_t | date |
| All data have a date associated. More... | |
Data type to describe Japanese candlesticks : open, high, low and close values.
Definition at line 502 of file DataStock.h.
| DataCSV::DataCSV | ( | ) |
Default constructor, set date and all values to 0.
Definition at line 626 of file DataStock.cpp.
| DataCSV::DataCSV | ( | time_t | d, |
| type_value_data | iopen, | ||
| type_value_data | ihigh, | ||
| type_value_data | ilow, | ||
| type_value_data | iclose | ||
| ) |
Constructor with all arguments explicit.
Definition at line 633 of file DataStock.cpp.
| DataCSV::DataCSV | ( | unsigned | int | ) |
Constructor with integer, no effect here but need for MultiData and ListDatStock template.
Definition at line 641 of file DataStock.cpp.
| DataCSV::DataCSV | ( | const DataCSV & | rhs | ) |
| DataCSV::DataCSV | ( | DataCSV && | rhs | ) |
|
inlinevirtual |
Destructor.
Definition at line 524 of file DataStock.h.
|
virtual |
With an other candlestick.
Update Low and High values according to the new_data
| new_data | update low/high values with these new values |
Definition at line 843 of file DataStock.cpp.
Referenced by ListDataStock_Utils::TransformTimeScale().

|
virtual |
As previous, but only one value in new_data.
Definition at line 853 of file DataStock.cpp.
References SimpleData::GetValue(), high, and low.

|
virtual |
Extract date and data from a split string.
| vec | vector of string containing the date and the value(s) |
Implements DataStock.
Definition at line 782 of file DataStock.cpp.
References SetData(), and Utils::StringToTime_t().

|
inline |
Definition at line 555 of file DataStock.h.
References close.
Referenced by HasChanged(), and helper_operator_write().

|
inline |
Definition at line 553 of file DataStock.h.
References high.
Referenced by GetMaximum(), and helper_operator_write().

|
inline |
Definition at line 554 of file DataStock.h.
References low.
Referenced by GetMinimum(), and helper_operator_write().

|
inlinevirtual |
Get the maximum value.
Implements DataStock.
Definition at line 541 of file DataStock.h.
References GetHigh().

|
inlinevirtual |
Get the minimum value.
Implements DataStock.
Definition at line 542 of file DataStock.h.
References GetLow().

|
inline |
Definition at line 552 of file DataStock.h.
References open.
Referenced by helper_operator_write(), and ListDataStock_Utils::TransformTimeScale().

|
virtual |
|
virtual |
Check if data are different.
To compare all fields use operator==
Exact implementation is different for each derived class:
Implements DataStock.
Definition at line 809 of file DataStock.cpp.
References GetClose(), DataStock::GetDate(), and DataStock::GetDateString().

Normal assignment.
Definition at line 677 of file DataStock.cpp.
References close, high, low, open, and DataStock::operator=().

Move assignment.
Definition at line 697 of file DataStock.cpp.
References close, high, low, open, and DataStock::operator=().

|
virtual |
User friendly output on screen.
verbose level:
1 : add a header before the line
| verbose | level of output |
Implements DataStock.
Definition at line 861 of file DataStock.cpp.
References FDS::WCOL.
| void DataCSV::Reset | ( | ) |
Set high and low values respectively to the minimum and maximum possible values for the type.
To use before adding data with DataCSV::AdditionData and insure than new data are correctly used
Definition at line 724 of file DataStock.cpp.
|
inline |
Definition at line 557 of file DataStock.h.
References close.
|
virtual |
Set a full Data : date + value(s) in a vector.
Implements DataStock.
Definition at line 754 of file DataStock.cpp.
References close, DataStock::date, high, low, and open.
Referenced by ExtractCSVLine(), GetListDataFromPyList(), and wrap_UpdateCSV().

| void DataCSV::SetData | ( | const time_t | d, |
| const type_value_data | iopen, | ||
| const type_value_data | ihigh, | ||
| const type_value_data | ilow, | ||
| const type_value_data | iclose | ||
| ) |
Set date and all data with explicit arguments.
Definition at line 744 of file DataStock.cpp.
References close, DataStock::date, high, low, and open.
|
inline |
Definition at line 558 of file DataStock.h.
References high.
|
inline |
Definition at line 559 of file DataStock.h.
References low.
|
inline |
Definition at line 556 of file DataStock.h.
References open.
|
virtual |
Set the values with the same order.
Implements DataStock.
Definition at line 763 of file DataStock.cpp.
References close, high, low, and open.
Referenced by helper_operator_read().

| void DataCSV::SetValues | ( | const type_value_data | iopen, |
| const type_value_data | ihigh, | ||
| const type_value_data | ilow, | ||
| const type_value_data | iclose | ||
| ) |
Compare all fields, date and values.
Definition at line 922 of file DataStock.cpp.
|
private |
Definition at line 507 of file DataStock.h.
Referenced by DataCSV(), GetClose(), GetValues(), operator=(), operator==(), SetClose(), SetData(), and SetValues().
|
private |
Definition at line 507 of file DataStock.h.
Referenced by AdditionData(), DataCSV(), GetHigh(), GetValues(), operator=(), operator==(), Reset(), SetData(), SetHigh(), and SetValues().
|
private |
Definition at line 507 of file DataStock.h.
Referenced by AdditionData(), DataCSV(), GetLow(), GetValues(), operator=(), operator==(), Reset(), SetData(), SetLow(), and SetValues().
|
private |
Definition at line 507 of file DataStock.h.
Referenced by DataCSV(), GetOpen(), GetValues(), operator=(), operator==(), SetData(), SetOpen(), and SetValues().
1.8.6