MCPcopy Create free account
hub / github.com/QuantFans/quantdigger / __init__

Method __init__

quantdigger/backup/pyqt_kline/CandleWidget.py:10–83  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8class KLineView(QWidget):
9
10 def __init__(self):
11 super(KLineView, self).__init__()
12 #
13 # TODO: size;
14 self.setMinimumWidth(800)
15 self.setMinimumHeight(480)
16 #
17 # [zh]
18 # ������������ص�ʵ��������
19 self._data = None
20 self._data_size = None
21 self._data_start_idx = 0
22 self._data_end_idx = 0
23 self._the_max = 0.0
24 self._the_min = 0.0
25 #
26 # [zh]
27 # �뵱ǰ������ʾ��������ص�ʵ��������
28 self._curr_data = None
29 self._curr_data_size = None
30 self._curr_span = 20
31 self._curr_from_idx = 0
32 self._curr_to_idx = 0
33 #
34 # [zh]
35 # ���Ƶ�ǰ����״̬��ʵ��������
36 self._is_data_loaded = False
37 self._is_average_line_shown = False
38 self._cached_pixmap = None
39 self._curr_x_step = 0
40 self._curr_rect_width = 0
41 self._curr_cursor_pos = QPointF()
42 self._click_status = 0
43 #
44 # [zh]
45 # Ԥ��Ļ�ͼ�ο�ֵ
46 self._CONST_SETTINGS = dict()
47 self._CONST_SETTINGS['max_width'] = 30000
48 self._CONST_SETTINGS['y_range'] = 4000
49 self._CONST_SETTINGS['margin_top'] = 10
50 self._CONST_SETTINGS['margin_bottom'] = 10
51 #
52 # TODO: new settings;
53 self._CONST_SETTINGS['price_pixmap_width'] = 160
54 self._CONST_SETTINGS['timestamp_pixmap_height'] = 80
55 #
56 #
57 self._CONST_SETTINGS['x_step'] = 30
58 self._CONST_SETTINGS['rect_width'] = 24
59 self._CONST_SETTINGS['max_height'] = \
60 self._CONST_SETTINGS['y_range'] \
61 + self._CONST_SETTINGS['margin_top'] \
62 + self._CONST_SETTINGS['margin_bottom']
63
64 # �ο�ֵ�����㹫ʽ��Ӣ����ʾ��
65 self._CONST_SETTINGS['max_k_line_size'] = 6000
66 self._CONST_SETTINGS['min_x_step'] = 5
67 self._CONST_SETTINGS['min_rect_width'] = 3

Callers

nothing calls this directly

Calls 2

_init_pixmapMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected