#include <Tester.h>
Public Slots | |
void | test () |
void | saveRule () |
void | exitDialog () |
void | loadRule () |
void | slotHelp () |
Signals | |
void | message (QString) |
Public Member Functions | |
Tester (QString, DBIndex *) | |
Tester () | |
~Tester () | |
int | getVolume (int, double) |
double | getPrice (int) |
QString | newTest () |
void | loadSignals () |
void | enterTrade (TradeItem::TradePosition) |
Protected Attributes | |
Config | config |
TesterReport * | reportPage |
TesterRulePage * | rulePage |
TesterTestPage * | testPage |
TesterStopPage * | stopPage |
TesterChartPage * | chartPage |
QString | ruleName |
QString | chartType |
QString | futuresType |
BarData * | recordList |
int | currentRecord |
double | equity |
double | volume |
QDict< Setting > | enterLongSignal |
QDict< Setting > | exitLongSignal |
QDict< Setting > | enterShortSignal |
QDict< Setting > | exitShortSignal |
QPtrList< TradeItem > | trades |
DBIndex * | index |
Definition at line 41 of file Tester.h.
Tester::Tester | ( | QString | n, | |
DBIndex * | i | |||
) |
Definition at line 38 of file Tester.cpp.
References chartPage, enterLongSignal, enterShortSignal, exitLongSignal, exitShortSignal, index, loadRule(), recordList, reportPage, ruleName, rulePage, saveRule(), slotHelp(), stopPage, test(), testPage, and trades.
Tester::Tester | ( | ) |
Tester::~Tester | ( | ) |
void Tester::message | ( | QString | ) | [signal] |
Referenced by test().
int Tester::getVolume | ( | int | i, | |
double | d | |||
) |
Definition at line 389 of file Tester.cpp.
References TesterTestPage::getMargin(), getPrice(), TesterTestPage::getVolumePercent(), testPage, and volume.
Referenced by enterTrade().
double Tester::getPrice | ( | int | i | ) |
Definition at line 406 of file Tester.cpp.
References BarData::getClose(), BarData::getHigh(), BarData::getLow(), BarData::getOpen(), TesterTestPage::getPriceField(), recordList, and testPage.
Referenced by enterTrade(), and getVolume().
QString Tester::newTest | ( | ) |
Definition at line 423 of file Tester.cpp.
References config, Config::getData(), and Config::TestPath.
Referenced by TestPage::newTest().
void Tester::loadSignals | ( | ) |
Definition at line 537 of file Tester.cpp.
References IndicatorPlugin::calculate(), Config::closePlugin(), config, BarData::count(), TesterRulePage::EnterLong, enterLongSignal, TesterRulePage::EnterShort, enterShortSignal, TesterRulePage::ExitLong, exitLongSignal, TesterRulePage::ExitShort, exitShortSignal, PlotLine::getData(), BarData::getDate(), TesterRulePage::getEditRule(), Config::getIndicatorPlugin(), Indicator::getLine(), PlotLine::getSize(), recordList, rulePage, IndicatorPlugin::setCustomFunction(), and IndicatorPlugin::setIndicatorInput().
Referenced by test().
void Tester::enterTrade | ( | TradeItem::TradePosition | flag | ) |
Definition at line 738 of file Tester.cpp.
References TradeItem::calculateProfit(), chartType, BarData::count(), currentRecord, TradeItem::CUSStop, TesterStopPage::customStop(), TradeItem::EndTest, TradeItem::EnterLong, TradeItem::EnterShort, TradeItem::ExitLong, exitLongSignal, TradeItem::ExitShort, exitShortSignal, futuresType, TesterTestPage::getAccount(), TradeItem::getBalance(), TesterTestPage::getCommissionType(), BarData::getDate(), TesterTestPage::getEntryCom(), TesterTestPage::getExitCom(), TradeItem::getExitSignal(), BarData::getHigh(), BarData::getLow(), TesterTestPage::getMargin(), getPrice(), TesterTestPage::getTradeDelay(), TradeItem::getVolume(), getVolume(), TradeItem::Long, TradeItem::MaximumLoss, TesterStopPage::maximumLoss(), TradeItem::None, TradeItem::Profit, TesterStopPage::profit(), recordList, TradeItem::setBalance(), TradeItem::setCommissionType(), TradeItem::setEnterDate(), TradeItem::setEnterPrice(), TradeItem::setEnterSignal(), TradeItem::setEntryCom(), TradeItem::setExitCom(), TradeItem::setExitDate(), TradeItem::setExitPrice(), TradeItem::setExitSignal(), TradeItem::setFuturesType(), TradeItem::setMargin(), TradeItem::setStockFlag(), TradeItem::setTradePosition(), TesterStopPage::setTrailingHigh(), TradeItem::setVolume(), stopPage, testPage, trades, TradeItem::Trailing, and TesterStopPage::trailing().
Referenced by test().
void Tester::test | ( | ) | [slot] |
Definition at line 636 of file Tester.cpp.
References chartPage, chartType, TesterReport::clear(), TesterChartPage::clear(), DBBase::close(), BarData::count(), TesterReport::createSummary(), currentRecord, enterLongSignal, enterShortSignal, enterTrade(), equity, futuresType, TesterTestPage::getAccount(), TesterTestPage::getBarLengthIndex(), TesterTestPage::getBars(), BarData::getDate(), DBIndexItem::getFuturesType(), DbPlugin::getHistory(), DBIndex::getIndexItem(), TesterTestPage::getSymbol(), TesterTestPage::getSymbolPath(), TesterTestPage::getTradeLong(), TesterTestPage::getTradeShort(), DBIndexItem::getType(), index, TesterStopPage::loadCustomLongStop(), TesterStopPage::loadCustomShortStop(), loadSignals(), TradeItem::Long, message(), DbPlugin::open(), recordList, reportPage, DbPlugin::setBarLength(), DbPlugin::setBarRange(), TradeItem::Short, stopPage, testPage, trades, and TesterChartPage::updateChart().
Referenced by Tester().
void Tester::saveRule | ( | ) | [slot] |
Definition at line 96 of file Tester.cpp.
References config, TesterRulePage::EnterLong, TesterRulePage::EnterShort, TesterRulePage::ExitLong, TesterRulePage::ExitShort, TesterTestPage::getAccount(), TesterTestPage::getBarLength(), TesterTestPage::getBars(), TesterTestPage::getCommissionType(), Config::getData(), TesterTestPage::getEntryCom(), TesterTestPage::getExitCom(), TesterTestPage::getMargin(), TesterStopPage::getMaximumLossCheck(), TesterStopPage::getMaximumLossEdit(), TesterStopPage::getMaximumLossLong(), TesterStopPage::getMaximumLossShort(), TesterTestPage::getPriceField(), TesterStopPage::getProfitCheck(), TesterStopPage::getProfitEdit(), TesterStopPage::getProfitLong(), TesterStopPage::getProfitShort(), TesterReport::getSummary(), TesterTestPage::getSymbolPath(), TesterTestPage::getTradeDelay(), TesterTestPage::getTradeLong(), TesterTestPage::getTradeShort(), TesterStopPage::getTrailingCheck(), TesterStopPage::getTrailingEdit(), TesterStopPage::getTrailingLong(), TesterStopPage::getTrailingShort(), TesterTestPage::getVolumePercent(), reportPage, ruleName, rulePage, TesterStopPage::saveCustomStopRule(), TesterRulePage::saveEditRule(), stopPage, testPage, and Config::TestPath.
Referenced by exitDialog(), and Tester().
void Tester::exitDialog | ( | ) | [slot] |
void Tester::loadRule | ( | ) | [slot] |
Definition at line 148 of file Tester.cpp.
References TesterReport::addTrade(), TradeItem::calculateProfit(), chartPage, chartType, TesterChartPage::clear(), TesterReport::clear(), DBBase::close(), config, TesterReport::createSummary(), TesterRulePage::EnterLong, TesterRulePage::EnterShort, TesterRulePage::ExitLong, TesterRulePage::ExitShort, futuresType, TesterTestPage::getAccount(), TradeItem::getBalance(), TesterTestPage::getCommissionType(), Config::getData(), TesterTestPage::getEntryCom(), TesterTestPage::getExitCom(), DBIndexItem::getFuturesType(), DBIndex::getIndexItem(), TesterTestPage::getSymbolPath(), DBIndexItem::getType(), index, TesterStopPage::loadCustomStopRule(), TesterRulePage::loadEditRule(), DbPlugin::open(), reportPage, ruleName, rulePage, TesterTestPage::setAccount(), TradeItem::setBalance(), TesterTestPage::setBarLength(), TesterTestPage::setBars(), TradeItem::setCommissionType(), TesterTestPage::setCommissionType(), TradeItem::setEntryCom(), TesterTestPage::setEntryCom(), TradeItem::setExitCom(), TesterTestPage::setExitCom(), TradeItem::setFuturesType(), TesterTestPage::setMargin(), TesterStopPage::setMaximumLossCheck(), TesterStopPage::setMaximumLossEdit(), TesterStopPage::setMaximumLossLong(), TesterStopPage::setMaximumLossShort(), TesterTestPage::setPriceField(), TesterStopPage::setProfitCheck(), TesterStopPage::setProfitEdit(), TesterStopPage::setProfitLong(), TesterStopPage::setProfitShort(), TradeItem::setStockFlag(), TesterTestPage::setSymbol(), TesterTestPage::setTradeDelay(), TesterTestPage::setTradeLong(), TesterTestPage::setTradeShort(), TesterStopPage::setTrailingCheck(), TesterStopPage::setTrailingEdit(), TesterStopPage::setTrailingLong(), TesterStopPage::setTrailingShort(), TesterTestPage::setVolumePercent(), stopPage, testPage, Config::TestPath, and trades.
Referenced by Tester().
void Tester::slotHelp | ( | ) | [slot] |
Config Tester::config [protected] |
Definition at line 66 of file Tester.h.
Referenced by loadRule(), loadSignals(), newTest(), and saveRule().
TesterReport* Tester::reportPage [protected] |
TesterRulePage* Tester::rulePage [protected] |
Definition at line 68 of file Tester.h.
Referenced by loadRule(), loadSignals(), saveRule(), and Tester().
TesterTestPage* Tester::testPage [protected] |
Definition at line 69 of file Tester.h.
Referenced by enterTrade(), getPrice(), getVolume(), loadRule(), saveRule(), test(), and Tester().
TesterStopPage* Tester::stopPage [protected] |
Definition at line 70 of file Tester.h.
Referenced by enterTrade(), loadRule(), saveRule(), test(), and Tester().
TesterChartPage* Tester::chartPage [protected] |
QString Tester::ruleName [protected] |
QString Tester::chartType [protected] |
QString Tester::futuresType [protected] |
BarData* Tester::recordList [protected] |
Definition at line 75 of file Tester.h.
Referenced by enterTrade(), getPrice(), loadSignals(), test(), Tester(), and ~Tester().
int Tester::currentRecord [protected] |
double Tester::equity [protected] |
double Tester::volume [protected] |
QDict<Setting> Tester::enterLongSignal [protected] |
QDict<Setting> Tester::exitLongSignal [protected] |
QDict<Setting> Tester::enterShortSignal [protected] |
QDict<Setting> Tester::exitShortSignal [protected] |
QPtrList<TradeItem> Tester::trades [protected] |
Definition at line 83 of file Tester.h.
Referenced by enterTrade(), loadRule(), test(), and Tester().
DBIndex* Tester::index [protected] |