ROOT_Application
2.0
C++ Core modules and GUIStock
|
Group all functions and methods using the Python C++ API. More...
Update the List(s) | |
int | Stock::UpdateCSVFromWeb (const std::string &source, Utils::firstlast_dates opt_dates=Utils::get_fldate_default()) throw (StockException) |
Update data from the Python parser (and save into the filesystem). More... | |
Python embedded functions, access ServerPortfolio classes and methods | |
int | Stock::LoadDictionary (std::string dict="") |
Load the dictionary of Stock, see ServerPortfolio. More... | |
int | Stock::TestwrapPython (std::string source) |
int | Stock::TestwrapPython2 (std::string source) |
Group all functions and methods using the Python C++ API.
Can add more infos in details
int Stock::LoadDictionary | ( | std::string | dict = "" | ) |
Load the dictionary of Stock, see ServerPortfolio.
int Stock::UpdateStocks() { std::cout << "Entry Parser UpdateStocks in StockwrapParser.cpp" << std::endl; Py_Initialize(); PyRun_SimpleString("from ParserStocks import ParserStocks\n" "import DictStocks_Parser\n" "parserstocks = ParserStocks( 'CAC40', 'Yahoo_CSV' )\n" "parserstocks.myparser._SetCodeYahoo('^FCHI')\n" "dict_stocks=DictStocks_Parser.Init()\n" "retour = parserstocks.UpdateCSV()\n"); Py_Finalize(); std::cout << "Exit Parser UpdateStocks" << std::endl; return 0; }
Load module DictionaryStocks and call its constructor
To call after PyInitialze() ( to check, seems logic ) name of the txt file, now use default only
dict | name of the dictionary |
Definition at line 51 of file StockwrapPyParser.cpp.
int Stock::TestwrapPython | ( | std::string | source | ) |
Definition at line 468 of file StockwrapPyParser.cpp.
int Stock::TestwrapPython2 | ( | std::string | source | ) |
Definition at line 524 of file StockwrapPyParser.cpp.
int Stock::UpdateCSVFromWeb | ( | const std::string & | source, |
Utils::firstlast_dates | opt_dates = Utils::get_fldate_default() |
||
) | |||
throw | ( | StockException | |
) |
Update data from the Python parser (and save into the filesystem).
Normal use case : Get missing daily data, call Yahoo and then save to file.
source | which website to use "Yahoo" (or "Boursorama" other function can combine later?) |
opt_dates | optional, limit the range of the data to retrieve, default [last data(header or memory)+1, today] |
StockPythonException | in case of problem in loading modules |
Definition at line 114 of file StockwrapPyParser.cpp.
References DAY, Utils::firstlast_dates::first, Utils::get_fldate_default(), GetListDataFromPyList(), ListDataStock< T, PolicyChronologic >::GetSize(), Utils::firstlast_dates::last, NO_CHRONO, ListDataStock< T, PolicyChronologic >::Order(), ListDataStock< T, PolicyChronologic >::SetDates(), Indicator::StockCSV, and Utils::Time_tToString().
Referenced by Stock::UpdateAllTimeScale(), and TransDateBox::Valid().