#include <DbPlugin.h>
Public Types | |
enum | DbType { Stock1, Futures1, Spread1, Index1, CC1 } |
Public Member Functions | |
DbPlugin () | |
virtual | ~DbPlugin () |
void | setBarLength (BarData::BarLength) |
void | setBarRange (int) |
void | getHelpFile (QString &) |
void | getLastBar (Bar &) |
void | getFirstBar (Bar &) |
void | getAllBars (BarData *) |
void | setBar (Bar &) |
void | getBar (DBBar &, QString &, Bar &) |
DbPlugin::DbType | getType (QString &) |
void | getPrevBar (QDateTime &, Bar &) |
void | getNextBar (QDateTime &, Bar &) |
void | getSearchBar (QDateTime &, Bar &) |
void | dump (QString &d, bool f) |
void | setType (DbPlugin::DbType) |
bool | open (QString &, DBIndex *) |
void | getHistory (BarData *, QDateTime &) |
int | dbPrefDialog () |
bool | createNewStock () |
bool | createNewFutures () |
bool | createNewIndex (DBIndex *) |
bool | createNewSpread (DBIndex *) |
bool | createNewCC (DBIndex *) |
int | stockPref () |
int | futuresPref () |
int | indexPref () |
int | spreadPref () |
int | ccPref () |
void | getIndexHistory (BarData *, QDateTime &) |
void | loadIndexData (QString &, QDict< Bar > &, QDateTime &, float, int, BarData::BarLength) |
void | getSpreadHistory (BarData *, QDateTime &) |
void | getCCHistory (BarData *, QDateTime &) |
Protected Attributes | |
int | barRange |
BarData::BarLength | barLength |
QString | helpFile |
DbPlugin::DbType | type |
DBIndex * | chartIndex |
Classes | |
struct | DBBar |
Definition at line 33 of file DbPlugin.h.
enum DbPlugin::DbType |
DbPlugin::DbPlugin | ( | ) |
Definition at line 41 of file DbPlugin.cpp.
References barLength, barRange, BarData::DailyBar, Stock1, and type.
DbPlugin::~DbPlugin | ( | ) | [virtual] |
void DbPlugin::setBarLength | ( | BarData::BarLength | d | ) |
Definition at line 76 of file DbPlugin.cpp.
References barLength.
Referenced by getCCHistory(), CC::getHistory(), SYMBOL::getSYMBOL(), QtstalkerApp::loadChart(), IndicatorSummary::run(), Scanner::scan(), and Tester::test().
void DbPlugin::setBarRange | ( | int | d | ) |
Definition at line 81 of file DbPlugin.cpp.
References barRange.
Referenced by getCCHistory(), Spread::getHistory(), CC::getHistory(), getSpreadHistory(), SYMBOL::getSYMBOL(), QtstalkerApp::loadChart(), Index::loadIndexData(), loadIndexData(), IndicatorSummary::run(), Scanner::scan(), and Tester::test().
void DbPlugin::getHelpFile | ( | QString & | d | ) |
void DbPlugin::getLastBar | ( | Bar & | bar | ) |
Definition at line 160 of file DbPlugin.cpp.
References DBBase::db, and getBar().
Referenced by Yahoo::createAutoHistoryUrls(), StocksDialog::createDetailsPage(), FuturesDialog::createDetailsPage(), StocksDialog::createSplitPage(), StocksDialog::slotLastRecord(), FuturesDialog::slotLastRecord(), StocksDialog::split(), and PortfolioDialog::updatePortfolioItems().
void DbPlugin::getFirstBar | ( | Bar & | bar | ) |
Definition at line 140 of file DbPlugin.cpp.
References DBBase::db, and getBar().
Referenced by StocksDialog::createDetailsPage(), FuturesDialog::createDetailsPage(), StocksDialog::slotFirstRecord(), FuturesDialog::slotFirstRecord(), and StocksDialog::split().
void DbPlugin::getAllBars | ( | BarData * | bars | ) |
Definition at line 324 of file DbPlugin.cpp.
References DBBase::db, getBar(), BarData::getBarType(), BarData::prependRaw(), and Bar::setTickFlag().
Referenced by StocksDialog::split().
void DbPlugin::setBar | ( | Bar & | bar | ) |
Definition at line 405 of file DbPlugin.cpp.
References DbPlugin::DBBar::close, DBBase::db, Bar::getClose(), Bar::getDateTimeString(), Bar::getHigh(), Bar::getLow(), Bar::getOI(), Bar::getOpen(), Bar::getVolume(), DbPlugin::DBBar::high, DbPlugin::DBBar::low, DbPlugin::DBBar::oi, DbPlugin::DBBar::open, and DbPlugin::DBBar::volume.
Referenced by UpgradeMessage::createChart(), NYBOT::parse(), CSV::parse(), CME::parse(), Yahoo::parseHistory(), Yahoo::parseQuote(), StocksDialog::saveRecord(), FuturesDialog::saveRecord(), and StocksDialog::split().
Definition at line 393 of file DbPlugin.cpp.
References DbPlugin::DBBar::close, DbPlugin::DBBar::high, DbPlugin::DBBar::low, DbPlugin::DBBar::oi, DbPlugin::DBBar::open, Bar::setClose(), Bar::setDate(), Bar::setHigh(), Bar::setLow(), Bar::setOI(), Bar::setOpen(), Bar::setVolume(), and DbPlugin::DBBar::volume.
Referenced by getAllBars(), getFirstBar(), getHistory(), getLastBar(), getNextBar(), getPrevBar(), and getSearchBar().
DbPlugin::DbType DbPlugin::getType | ( | QString & | d | ) |
void DbPlugin::getPrevBar | ( | QDateTime & | startDate, | |
Bar & | bar | |||
) |
Definition at line 180 of file DbPlugin.cpp.
References DBBase::db, and getBar().
Referenced by StocksDialog::slotPrevRecord(), and FuturesDialog::slotPrevRecord().
void DbPlugin::getNextBar | ( | QDateTime & | startDate, | |
Bar & | bar | |||
) |
Definition at line 212 of file DbPlugin.cpp.
References DBBase::db, and getBar().
Referenced by StocksDialog::slotNextRecord(), and FuturesDialog::slotNextRecord().
void DbPlugin::getSearchBar | ( | QDateTime & | startDate, | |
Bar & | bar | |||
) |
Definition at line 244 of file DbPlugin.cpp.
References DBBase::db, and getBar().
Referenced by StocksDialog::slotDateSearch(), and FuturesDialog::slotDateSearch().
void DbPlugin::dump | ( | QString & | d, | |
bool | f | |||
) |
Definition at line 96 of file DbPlugin.cpp.
References DbPlugin::DBBar::close, DBBase::db, DbPlugin::DBBar::high, DbPlugin::DBBar::low, DbPlugin::DBBar::oi, DbPlugin::DBBar::open, DBBase::symbol, and DbPlugin::DBBar::volume.
Referenced by ChartPage::exportChart().
void DbPlugin::setType | ( | DbPlugin::DbType | d | ) |
bool DbPlugin::open | ( | QString & | d, | |
DBIndex * | i | |||
) |
Definition at line 53 of file DbPlugin.cpp.
References chartIndex, DBIndex::getIndexItem(), DBIndexItem::getPath(), getType(), DBIndexItem::getType(), DBBase::indexKey, DBBase::open(), DBIndex::setIndexItem(), DBIndexItem::setPath(), and type.
Referenced by Yahoo::createAutoHistoryUrls(), UpgradeMessage::createChart(), createNewCC(), createNewIndex(), createNewSpread(), ChartPage::editChart(), ChartPage::exportChart(), getCCHistory(), getSpreadHistory(), SYMBOL::getSYMBOL(), QtstalkerApp::loadChart(), loadIndexData(), Tester::loadRule(), Yahoo::newStock(), CSV::openDb(), NYBOT::parse(), CME::parse(), Yahoo::parseFundamental(), Yahoo::parseHistory(), Yahoo::parseQuote(), IndicatorSummary::run(), Scanner::scan(), Tester::test(), and PortfolioDialog::updatePortfolioItems().
void DbPlugin::getHistory | ( | BarData * | barData, | |
QDateTime & | startDate | |||
) |
Definition at line 268 of file DbPlugin.cpp.
References barRange, CC1, BarData::count(), BarData::createDateList(), DBBase::db, getBar(), BarData::getBarType(), getCCHistory(), getIndexHistory(), getSpreadHistory(), Index1, BarData::prepend(), Bar::setTickFlag(), Spread1, and type.
Referenced by getCCHistory(), Spread::getHistory(), CC::getHistory(), getSpreadHistory(), SYMBOL::getSYMBOL(), QtstalkerApp::loadChart(), Index::loadIndexData(), loadIndexData(), IndicatorSummary::run(), Scanner::scan(), and Tester::test().
int DbPlugin::dbPrefDialog | ( | ) |
Definition at line 698 of file DbPlugin.cpp.
References CC1, ccPref(), Futures1, futuresPref(), Index1, indexPref(), Spread1, spreadPref(), stockPref(), and type.
Referenced by ChartPage::editChart().
bool DbPlugin::createNewStock | ( | ) |
Definition at line 430 of file DbPlugin.cpp.
References chartIndex, DBIndex::getIndexItem(), DBIndexItem::getSymbol(), DBBase::indexKey, DBIndex::setIndexItem(), DBIndexItem::setSymbol(), DBIndexItem::setTitle(), DBIndexItem::setType(), Stock1, and type.
Referenced by Yahoo::newStock(), CSV::openDb(), Yahoo::parseFundamental(), Yahoo::parseHistory(), and Yahoo::parseQuote().
bool DbPlugin::createNewFutures | ( | ) |
Definition at line 451 of file DbPlugin.cpp.
References chartIndex, Futures1, DBIndex::getIndexItem(), FuturesData::getName(), FuturesData::getSymbol(), DBIndexItem::getSymbol(), DBBase::indexKey, DBIndexItem::setFuturesMonth(), DBIndexItem::setFuturesType(), DBIndex::setIndexItem(), DBIndexItem::setSymbol(), FuturesData::setSymbolPath(), DBIndexItem::setTitle(), DBIndexItem::setType(), DBBase::symbol, and type.
Referenced by CSV::openDb(), NYBOT::parse(), and CME::parse().
bool DbPlugin::createNewIndex | ( | DBIndex * | i | ) |
Definition at line 487 of file DbPlugin.cpp.
References chartIndex, Config::DataPath, Config::getData(), DBIndex::getIndexItem(), DBIndexItem::getSymbol(), Index1, DBBase::indexKey, indexPref(), open(), DBIndex::setIndexItem(), DBIndexItem::setSymbol(), DBIndexItem::setTitle(), DBIndexItem::setType(), and type.
Referenced by ChartPage::newChart().
bool DbPlugin::createNewSpread | ( | DBIndex * | i | ) |
Definition at line 553 of file DbPlugin.cpp.
References chartIndex, Config::DataPath, Config::getData(), DBIndex::getIndexItem(), DBIndexItem::getSymbol(), DBBase::indexKey, open(), DBIndex::setIndexItem(), DBIndexItem::setSymbol(), DBIndexItem::setTitle(), DBIndexItem::setType(), Spread1, spreadPref(), and type.
Referenced by ChartPage::newChart().
bool DbPlugin::createNewCC | ( | DBIndex * | i | ) |
Definition at line 616 of file DbPlugin.cpp.
References PrefDialog::addCheckItem(), PrefDialog::addComboItem(), CC1, chartIndex, PrefDialog::createPage(), Config::DataPath, PrefDialog::getCheck(), PrefDialog::getCombo(), Config::getData(), DBIndex::getIndexItem(), DBIndexItem::getSymbol(), FuturesData::getSymbolList(), helpFile, DBBase::indexKey, open(), DBBase::setData(), PrefDialog::setHelpFile(), DBIndex::setIndexItem(), DBIndexItem::setSymbol(), DBIndexItem::setTitle(), DBIndexItem::setType(), and type.
Referenced by ChartPage::newChart().
int DbPlugin::stockPref | ( | ) |
Definition at line 724 of file DbPlugin.cpp.
References chartIndex, DBBase::flush(), StocksDialog::getReloadFlag(), and helpFile.
Referenced by dbPrefDialog().
int DbPlugin::futuresPref | ( | ) |
Definition at line 738 of file DbPlugin.cpp.
References chartIndex, DBBase::flush(), FuturesDialog::getReloadFlag(), and helpFile.
Referenced by dbPrefDialog().
int DbPlugin::indexPref | ( | ) |
Definition at line 749 of file DbPlugin.cpp.
References chartIndex, DBBase::getData(), DBIndex::getIndexItem(), IndexDialog::getList(), IndexDialog::getName(), DBIndexItem::getTitle(), DBBase::indexKey, DBBase::setData(), DBIndex::setIndexItem(), and DBIndexItem::setTitle().
Referenced by createNewIndex(), and dbPrefDialog().
int DbPlugin::spreadPref | ( | ) |
Definition at line 775 of file DbPlugin.cpp.
References PrefDialog::addSymbolItem(), PrefDialog::createPage(), Config::DataPath, DBBase::getData(), Config::getData(), PrefDialog::getSymbol(), helpFile, DBBase::setData(), and PrefDialog::setHelpFile().
Referenced by createNewSpread(), and dbPrefDialog().
int DbPlugin::ccPref | ( | ) |
Definition at line 815 of file DbPlugin.cpp.
References PrefDialog::addCheckItem(), PrefDialog::createPage(), PrefDialog::getCheck(), DBBase::getData(), helpFile, DBBase::setData(), and PrefDialog::setHelpFile().
Referenced by dbPrefDialog().
void DbPlugin::getIndexHistory | ( | BarData * | barData, | |
QDateTime & | startDate | |||
) |
Definition at line 842 of file DbPlugin.cpp.
References barLength, barRange, Bar::getClose(), DBBase::getData(), Bar::getDate(), Bar::getDateTimeString(), Bar::getHigh(), Bar::getLow(), Bar::getOI(), Bar::getOpen(), loadIndexData(), BarData::prepend(), Bar::setClose(), Bar::setDate(), Bar::setHigh(), Bar::setLow(), and Bar::setOpen().
Referenced by getHistory().
void DbPlugin::loadIndexData | ( | QString & | symbol, | |
QDict< Bar > & | lookup, | |||
QDateTime & | startDate, | |||
float | weight, | |||
int | barRange, | |||
BarData::BarLength | barLength | |||
) |
Definition at line 913 of file DbPlugin.cpp.
References chartIndex, DBBase::close(), BarData::count(), DBBase::db, Bar::getClose(), BarData::getClose(), BarData::getDate(), Bar::getDateTimeString(), Bar::getHigh(), BarData::getHigh(), getHistory(), Bar::getLow(), BarData::getLow(), Bar::getOI(), Bar::getOpen(), BarData::getOpen(), open(), BarData::setBarLength(), setBarRange(), Bar::setClose(), Bar::setDate(), Bar::setHigh(), Bar::setLow(), Bar::setOI(), and Bar::setOpen().
Referenced by getIndexHistory().
void DbPlugin::getSpreadHistory | ( | BarData * | barData, | |
QDateTime & | startDate | |||
) |
Definition at line 964 of file DbPlugin.cpp.
References barLength, barRange, chartIndex, DBBase::close(), BarData::count(), DBBase::db, Bar::getClose(), BarData::getClose(), DBBase::getData(), BarData::getDate(), Bar::getDateTimeString(), getHistory(), open(), BarData::prepend(), BarData::setBarLength(), setBarRange(), Bar::setClose(), Bar::setDate(), Bar::setHigh(), Bar::setLow(), and Bar::setOpen().
Referenced by getHistory().
void DbPlugin::getCCHistory | ( | BarData * | barData, | |
QDateTime & | startDate | |||
) |
Definition at line 1047 of file DbPlugin.cpp.
References BarData::appendRaw(), barLength, barRange, chartIndex, DBBase::close(), BarData::count(), Config::DataPath, BarData::getBar(), Bar::getClose(), BarData::getClose(), FuturesData::getCurrentContract(), DBBase::getData(), Config::getData(), BarData::getDate(), Bar::getEmptyFlag(), FuturesData::getExchange(), Bar::getHigh(), getHistory(), Bar::getLow(), Bar::getOpen(), FuturesData::getSymbol(), DBBase::indexKey, open(), setBarLength(), setBarRange(), Bar::setClose(), Bar::setEmptyFlag(), Bar::setHigh(), Bar::setLow(), Bar::setOpen(), and FuturesData::setSymbol().
Referenced by getHistory().
int DbPlugin::barRange [protected] |
Definition at line 91 of file DbPlugin.h.
Referenced by DbPlugin(), getCCHistory(), getHistory(), getIndexHistory(), getSpreadHistory(), and setBarRange().
BarData::BarLength DbPlugin::barLength [protected] |
Definition at line 92 of file DbPlugin.h.
Referenced by DbPlugin(), getCCHistory(), getIndexHistory(), getSpreadHistory(), and setBarLength().
QString DbPlugin::helpFile [protected] |
Definition at line 93 of file DbPlugin.h.
Referenced by ccPref(), createNewCC(), futuresPref(), getHelpFile(), spreadPref(), and stockPref().
DbPlugin::DbType DbPlugin::type [protected] |
Definition at line 94 of file DbPlugin.h.
Referenced by createNewCC(), createNewFutures(), createNewIndex(), createNewSpread(), createNewStock(), DbPlugin(), dbPrefDialog(), getHistory(), open(), and setType().
DBIndex* DbPlugin::chartIndex [protected] |
Definition at line 95 of file DbPlugin.h.
Referenced by createNewCC(), createNewFutures(), createNewIndex(), createNewSpread(), createNewStock(), futuresPref(), getCCHistory(), getSpreadHistory(), indexPref(), loadIndexData(), open(), and stockPref().