00001 /* 00002 * Qtstalker stock charter 00003 * 00004 * Copyright (C) 2001-2007 Stefan S. Stratigakos 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00019 * USA. 00020 */ 00021 00022 #ifndef TESTERSTOPPAGE_HPP 00023 #define TESTERSTOPPAGE_HPP 00024 00025 #include <qwidget.h> 00026 #include <qstring.h> 00027 #include <qcheckbox.h> 00028 #include <qspinbox.h> 00029 #include <qlineedit.h> 00030 #include <qvalidator.h> 00031 #include "PlotLine.h" 00032 #include "FormulaEdit.h" 00033 #include "BarData.h" 00034 00035 00036 class TesterStopPage : public QWidget 00037 { 00038 Q_OBJECT 00039 00040 public: 00041 TesterStopPage (QWidget *); 00042 ~TesterStopPage (); 00043 bool loadCustomLongStop (BarData *recordList); 00044 bool loadCustomShortStop (BarData *recordList); 00045 void saveCustomStopRule (QString &); 00046 void loadCustomStopRule (QString &); 00047 bool maximumLoss (bool flag, double enterPrice, double exitPrice); 00048 bool profit (bool flag, double enterPrice, double exitPrice); 00049 bool trailing (bool flag, double exitPrice); 00050 bool customStop (bool flag, int index); 00051 void setTrailingHigh (double); 00052 00053 bool getMaximumLossCheck (); 00054 void setMaximumLossCheck (bool); 00055 bool getMaximumLossLong (); 00056 void setMaximumLossLong (bool); 00057 bool getMaximumLossShort (); 00058 void setMaximumLossShort (bool); 00059 QString getMaximumLossEdit (); 00060 void setMaximumLossEdit (QString); 00061 00062 bool getProfitCheck (); 00063 void setProfitCheck (bool); 00064 bool getProfitLong (); 00065 void setProfitLong (bool); 00066 bool getProfitShort (); 00067 void setProfitShort (bool); 00068 QString getProfitEdit (); 00069 void setProfitEdit (QString); 00070 00071 bool getTrailingCheck (); 00072 void setTrailingCheck (bool); 00073 bool getTrailingLong (); 00074 void setTrailingLong (bool); 00075 bool getTrailingShort (); 00076 void setTrailingShort (bool); 00077 QString getTrailingEdit (); 00078 void setTrailingEdit (QString); 00079 00080 00081 public slots: 00082 void maximumLossToggled (bool); 00083 void profitToggled (bool); 00084 void trailingToggled (bool); 00085 void customLongStopToggled (bool); 00086 void customShortStopToggled (bool); 00087 00088 protected: 00089 QCheckBox *maximumLossCheck; 00090 QCheckBox *maximumLossLong; 00091 QCheckBox *maximumLossShort; 00092 QCheckBox *profitCheck; 00093 QCheckBox *profitLong; 00094 QCheckBox *profitShort; 00095 QCheckBox *trailingCheck; 00096 QCheckBox *trailingLong; 00097 QCheckBox *trailingShort; 00098 QCheckBox *customLongStopCheck; 00099 QCheckBox *customShortStopCheck; 00100 QLineEdit *maximumLossEdit; 00101 QLineEdit *profitEdit; 00102 QLineEdit *trailingEdit; 00103 QDoubleValidator *validator; 00104 FormulaEdit *customShortStopEdit; 00105 FormulaEdit *customLongStopEdit; 00106 double trailingHigh; 00107 double trailingLow; 00108 PlotLine *customShortStopLine; 00109 PlotLine *customLongStopLine; 00110 }; 00111 00112 #endif