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 #include "IndicatorPlugin.h" 00023 00024 class BARS : public IndicatorPlugin 00025 { 00026 public: 00027 BARS (); 00028 virtual ~BARS (); 00029 Indicator * calculate (); 00030 PlotLine * calculateBar (); 00031 PlotLine * calculateCandle (); 00032 PlotLine * calculatePF (); 00033 int indicatorPrefDialog (QWidget *); 00034 void setDefaults(); 00035 PlotLine * calculateCustom (QString &, QPtrList<PlotLine> &); 00036 void getIndicatorSettings (Setting &); 00037 void setIndicatorSettings (Setting &); 00038 void calculateMA (Indicator *); 00039 void formatDialog (QStringList &vl, QString &rv, QString &rs); 00040 void getPFSettings (); 00041 00042 private: 00043 QColor barUpColor; 00044 QColor barDownColor; 00045 QColor barNeutralColor; 00046 QColor candleColor; 00047 PlotLine::LineType lineType; 00048 QString label; 00049 QString method; 00050 QStringList methodList; 00051 QString dbPath; 00052 00053 QColor maColor; 00054 QColor maColor2; 00055 QColor maColor3; 00056 PlotLine::LineType maLineType; 00057 PlotLine::LineType maLineType2; 00058 PlotLine::LineType maLineType3; 00059 QString maLabel; 00060 QString maLabel2; 00061 QString maLabel3; 00062 int maPeriod; 00063 int maPeriod2; 00064 int maPeriod3; 00065 int maType; 00066 int maType2; 00067 int maType3; 00068 BarData::InputType maInput; 00069 BarData::InputType maInput2; 00070 BarData::InputType maInput3; 00071 00072 int pfReversal; 00073 double pfBoxSize; 00074 QColor pfXColor; 00075 QColor pfOColor; 00076 QString pfMethod; 00077 00078 QString barUpColorLabel; 00079 QString barDownColorLabel; 00080 QString barNeutralColorLabel; 00081 QString candleColorLabel; 00082 QString labelLabel; 00083 QString methodLabel; 00084 QString lineTypeLabel; 00085 QString pluginLabel; 00086 00087 QString pfXColorLabel; 00088 QString pfOColorLabel; 00089 QString pfReversalLabel; 00090 QString pfMethodLabel; 00091 00092 QString maColorLabel; 00093 QString maLineTypeLabel; 00094 QString maPeriodLabel; 00095 QString maLabelLabel; 00096 QString maTypeLabel; 00097 QString maInputLabel; 00098 00099 QString maColor2Label; 00100 QString maLineType2Label; 00101 QString maPeriod2Label; 00102 QString maLabel2Label; 00103 QString maType2Label; 00104 QString maInput2Label; 00105 00106 QString maColor3Label; 00107 QString maLineType3Label; 00108 QString maPeriod3Label; 00109 QString maLabel3Label; 00110 QString maType3Label; 00111 QString maInput3Label; 00112 }; 00113