-
Notifications
You must be signed in to change notification settings - Fork 9
/
bollinger_overlay.h
41 lines (33 loc) · 982 Bytes
/
bollinger_overlay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef BOLLINGER_OVERLAY_H_INCLUDED
#define BOLLINGER_OVERLAY_H_INCLUDED
#include "graph_overlay.h"
#include "bollinger_calculator.h"
#include "axis_pair.h"
#include <QGraphicsItem>
class BollingerOverlay: public GraphOverlay {
Q_OBJECT
private:
OHLCProvider* projection;
int N, K;
AxisPair axisPair;
public slots:
virtual void timeAxisChanged(TimeAxis timeAxis);
virtual void numberAxisChanged(NumberAxis numberAxis);
virtual void projectionChanged(OHLCProvider* projection);
public:
BollingerOverlay(int N = 20, int K = 2);
virtual void insertIntoScene(QGraphicsScene* scene);
virtual ~BollingerOverlay() {}
private:
class Band: public QGraphicsItem {
private:
AxisPair axisPair;
public:
Band(AxisPair axisPair);
QList<QPair<QDateTime,BollingerEntry>> data;
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget);
};
};
#endif