mtcli 3.5.0.dev0__tar.gz → 4.0.0.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mtcli-4.0.0.dev0/LICENSE +17 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/PKG-INFO +8 -12
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/README.md +145 -145
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/commands/bars.py +153 -147
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/conf.py +96 -102
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/logger.py +46 -47
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/bar_model.py +105 -105
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/consecutive_bars_model.py +75 -77
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/unconsecutive_bar_model.py +67 -67
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/mt.py +1 -1
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/mt5_context.py +5 -1
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/media_movel/__init__.py +3 -3
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/media_movel/command.py +99 -99
- mtcli-4.0.0.dev0/mtcli/plugins/media_movel/conf.py +4 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/media_movel/models/__init__.py +1 -1
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/media_movel/tests/test_mm.py +13 -13
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/media_movel/tests/test_model_media_movel.py +9 -9
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/range_medio/command.py +33 -33
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/range_medio/models/average_range_model.py +29 -29
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/volume_medio/__init__.py +3 -3
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/volume_medio/command.py +42 -42
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/volume_medio/models/model_average_volume.py +31 -31
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/close_view.py +37 -37
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/full_view.py +69 -65
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/high_view.py +37 -37
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/low_view.py +37 -37
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/min_view.py +42 -42
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/open_view.py +37 -37
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/ranges_view.py +43 -41
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/rates_view.py +41 -41
- mtcli-4.0.0.dev0/mtcli/views/utils.py +37 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/volumes_view.py +55 -51
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/pyproject.toml +21 -43
- mtcli-3.5.0.dev0/LICENSE +0 -21
- mtcli-3.5.0.dev0/mtcli/database.py +0 -54
- mtcli-3.5.0.dev0/mtcli/domain/timeframe.py +0 -87
- mtcli-3.5.0.dev0/mtcli/marketdata/tick_cache.py +0 -24
- mtcli-3.5.0.dev0/mtcli/marketdata/tick_repository.py +0 -116
- mtcli-3.5.0.dev0/mtcli/plugins/media_movel/conf.py +0 -4
- mtcli-3.5.0.dev0/mtcli/plugins/range_medio/tests/__init__.py +0 -0
- mtcli-3.5.0.dev0/mtcli/plugins/volume_medio/tests/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/commands/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/commands/conf.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/commands/logs.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/conecta.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/data/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/data/base.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/data/csv.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/data/mt5.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/bars_model.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/chart_model.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/conf_model.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/rates_model.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/models/signals_model.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugin.py +0 -0
- {mtcli-3.5.0.dev0/mtcli/domain → mtcli-4.0.0.dev0/mtcli/plugins}/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/media_movel/models/model_media_movel.py +0 -0
- {mtcli-3.5.0.dev0/mtcli/marketdata → mtcli-4.0.0.dev0/mtcli/plugins/media_movel/tests}/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/range_medio/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/range_medio/conf.py +0 -0
- {mtcli-3.5.0.dev0/mtcli/plugins → mtcli-4.0.0.dev0/mtcli/plugins/range_medio/models}/__init__.py +0 -0
- {mtcli-3.5.0.dev0/mtcli/plugins/media_movel → mtcli-4.0.0.dev0/mtcli/plugins/range_medio}/tests/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/range_medio/tests/test_rm.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/volume_medio/conf.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/volume_medio/models/__init__.py +0 -0
- {mtcli-3.5.0.dev0/mtcli/plugins/range_medio/models → mtcli-4.0.0.dev0/mtcli/plugins/volume_medio/tests}/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/plugins/volume_medio/tests/test_vm.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/__init__.py +0 -0
- {mtcli-3.5.0.dev0 → mtcli-4.0.0.dev0}/mtcli/views/vars_view.py +0 -0
mtcli-4.0.0.dev0/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2025 Valmir França da Silva
|
|
5
|
+
|
|
6
|
+
This program is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
(at your option) any later version.
|
|
10
|
+
|
|
11
|
+
This program is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: mtcli
|
|
3
|
-
Version:
|
|
4
|
-
Summary: Aplicativo CLI para exibir gráficos do MetaTrader 5
|
|
5
|
-
License
|
|
6
|
-
|
|
7
|
-
Keywords: trading,candlestick,metatrader5,mt5,cli,price-action
|
|
3
|
+
Version: 4.0.0.dev0
|
|
4
|
+
Summary: Aplicativo CLI para exibir gráficos do MetaTrader 5 em texto acessível ao leitor de telas
|
|
5
|
+
License: GPL-3.0
|
|
6
|
+
Keywords: MetaTrader 5,trading,CLI
|
|
8
7
|
Author: Valmir França da Silva
|
|
9
8
|
Author-email: vfranca3@gmail.com
|
|
10
9
|
Requires-Python: >=3.10,<3.14.0
|
|
11
|
-
Classifier:
|
|
12
|
-
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
10
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
13
11
|
Classifier: Programming Language :: Python :: 3
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
-
Classifier: Operating System :: OS Independent
|
|
19
|
-
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
20
16
|
Requires-Dist: click (>=8.2.1,<9.0.0)
|
|
21
17
|
Requires-Dist: metatrader5 (>=5.0.5260,<6.0.0)
|
|
22
18
|
Project-URL: Documentation, https://mtcli.readthedocs.io/pt-br/latest
|
|
23
|
-
Project-URL: Homepage, https://
|
|
19
|
+
Project-URL: Homepage, https://pypi.org/project/mtcli
|
|
24
20
|
Project-URL: Repository, https://github.com/vfranca/mtcli
|
|
25
21
|
Project-URL: issues, https://github.com/vfranca/mtcli/issues
|
|
26
22
|
Description-Content-Type: text/markdown
|
|
@@ -169,5 +165,5 @@ GitHub: [@vfranca](https://github.com/vfranca)
|
|
|
169
165
|
|
|
170
166
|
## Licença
|
|
171
167
|
|
|
172
|
-
Distribuído sob a licença
|
|
168
|
+
Distribuído sob a licença GPL-3.0. Veja `LICENSE` para mais informações.
|
|
173
169
|
|
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
# mtcli
|
|
2
|
-
|
|
3
|
-
*mtcli* é um aplicativo de linha de comando (CLI) acessível para leitura e análise de gráficos do MetaTrader 5, desenvolvido com foco em acessibilidade para usuários com deficiência visual.
|
|
4
|
-
|
|
5
|
-
O projeto é modular e extensível por meio de plugins.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Instalação
|
|
10
|
-
|
|
11
|
-
Você pode instalar o `mtcli` diretamente via *pip*:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
pip install mtcli
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Ou diretamente a partir do código-fonte:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
git clone https://github.com/vfranca/mtcli.git
|
|
21
|
-
cd mtcli
|
|
22
|
-
pip install .
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Como usar
|
|
28
|
-
|
|
29
|
-
Após a instalação, o comando principal é:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
mt
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Você verá uma lista de comandos e plugins disponíveis.
|
|
36
|
-
|
|
37
|
-
Para executar um plugin específico, use:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
mt nome-do-plugin [opções]
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Exemplo com o plugin de média móvel:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
mt mm --symbol WIN$N --periodo 14
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Documentação
|
|
52
|
-
|
|
53
|
-
A documentação completa está disponível em:
|
|
54
|
-
|
|
55
|
-
*https://vfranca.github.io/mtcli*
|
|
56
|
-
|
|
57
|
-
Inclui guias de uso, instalação de plugins, exemplos e estrutura do projeto.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Como contribuir
|
|
62
|
-
|
|
63
|
-
Contribuições são bem-vindas!
|
|
64
|
-
|
|
65
|
-
Clonar o repositório
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
git clone https://github.com/vfranca/mtcli.git
|
|
69
|
-
cd mtcli
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Instalar dependências para desenvolvimento
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
pip install -e ".[dev]"
|
|
76
|
-
```
|
|
77
|
-
Rodar os testes
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
pymake test
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Estilo de código
|
|
84
|
-
|
|
85
|
-
- `black` para formatação
|
|
86
|
-
- `isort` para ordenação de imports
|
|
87
|
-
- `pydocstyle` para formatação de docstrings
|
|
88
|
-
- `ruff` e `mypy` para linting e verificação estática
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Criando plugins para o mtcli
|
|
93
|
-
|
|
94
|
-
Plugins permitem estender a funcionalidade do `mtcli`.
|
|
95
|
-
|
|
96
|
-
Estrutura básica de um plugin
|
|
97
|
-
|
|
98
|
-
```toml
|
|
99
|
-
pyproject.toml
|
|
100
|
-
[project.entry-points."mtcli.plugins"]
|
|
101
|
-
nome_do_plugin = "modulo.caminho:funcao_principal"
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Exemplo
|
|
105
|
-
|
|
106
|
-
```toml
|
|
107
|
-
[project.entry-points."mtcli.plugins"]
|
|
108
|
-
volume_medio = "mtcli.plugins.volume_medio:vm"
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
No código Python:
|
|
112
|
-
|
|
113
|
-
```python
|
|
114
|
-
|
|
115
|
-
def vm():
|
|
116
|
-
print("Plugin de volume médio executado.")
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Como empacotar
|
|
120
|
-
|
|
121
|
-
Crie um projeto separado com sua lógica e registre o plugin no `pyproject.toml` ou `setup.py` como acima.
|
|
122
|
-
|
|
123
|
-
Depois, instale com:
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
pip install .
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
O `mtcli` reconhecerá o plugin automaticamente.
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Contato
|
|
134
|
-
|
|
135
|
-
Autor: *Valmir França da Silva*
|
|
136
|
-
|
|
137
|
-
Email: vfranca3@gmail.com
|
|
138
|
-
|
|
139
|
-
GitHub: [@vfranca](https://github.com/vfranca)
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## Licença
|
|
144
|
-
|
|
145
|
-
Distribuído sob a licença
|
|
1
|
+
# mtcli
|
|
2
|
+
|
|
3
|
+
*mtcli* é um aplicativo de linha de comando (CLI) acessível para leitura e análise de gráficos do MetaTrader 5, desenvolvido com foco em acessibilidade para usuários com deficiência visual.
|
|
4
|
+
|
|
5
|
+
O projeto é modular e extensível por meio de plugins.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Instalação
|
|
10
|
+
|
|
11
|
+
Você pode instalar o `mtcli` diretamente via *pip*:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install mtcli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Ou diretamente a partir do código-fonte:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
git clone https://github.com/vfranca/mtcli.git
|
|
21
|
+
cd mtcli
|
|
22
|
+
pip install .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Como usar
|
|
28
|
+
|
|
29
|
+
Após a instalação, o comando principal é:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
mt
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Você verá uma lista de comandos e plugins disponíveis.
|
|
36
|
+
|
|
37
|
+
Para executar um plugin específico, use:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mt nome-do-plugin [opções]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Exemplo com o plugin de média móvel:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
mt mm --symbol WIN$N --periodo 14
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Documentação
|
|
52
|
+
|
|
53
|
+
A documentação completa está disponível em:
|
|
54
|
+
|
|
55
|
+
*https://vfranca.github.io/mtcli*
|
|
56
|
+
|
|
57
|
+
Inclui guias de uso, instalação de plugins, exemplos e estrutura do projeto.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Como contribuir
|
|
62
|
+
|
|
63
|
+
Contribuições são bem-vindas!
|
|
64
|
+
|
|
65
|
+
Clonar o repositório
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/vfranca/mtcli.git
|
|
69
|
+
cd mtcli
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Instalar dependências para desenvolvimento
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install -e ".[dev]"
|
|
76
|
+
```
|
|
77
|
+
Rodar os testes
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pymake test
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Estilo de código
|
|
84
|
+
|
|
85
|
+
- `black` para formatação
|
|
86
|
+
- `isort` para ordenação de imports
|
|
87
|
+
- `pydocstyle` para formatação de docstrings
|
|
88
|
+
- `ruff` e `mypy` para linting e verificação estática
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Criando plugins para o mtcli
|
|
93
|
+
|
|
94
|
+
Plugins permitem estender a funcionalidade do `mtcli`.
|
|
95
|
+
|
|
96
|
+
Estrutura básica de um plugin
|
|
97
|
+
|
|
98
|
+
```toml
|
|
99
|
+
pyproject.toml
|
|
100
|
+
[project.entry-points."mtcli.plugins"]
|
|
101
|
+
nome_do_plugin = "modulo.caminho:funcao_principal"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Exemplo
|
|
105
|
+
|
|
106
|
+
```toml
|
|
107
|
+
[project.entry-points."mtcli.plugins"]
|
|
108
|
+
volume_medio = "mtcli.plugins.volume_medio:vm"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
No código Python:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
|
|
115
|
+
def vm():
|
|
116
|
+
print("Plugin de volume médio executado.")
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Como empacotar
|
|
120
|
+
|
|
121
|
+
Crie um projeto separado com sua lógica e registre o plugin no `pyproject.toml` ou `setup.py` como acima.
|
|
122
|
+
|
|
123
|
+
Depois, instale com:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pip install .
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
O `mtcli` reconhecerá o plugin automaticamente.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Contato
|
|
134
|
+
|
|
135
|
+
Autor: *Valmir França da Silva*
|
|
136
|
+
|
|
137
|
+
Email: vfranca3@gmail.com
|
|
138
|
+
|
|
139
|
+
GitHub: [@vfranca](https://github.com/vfranca)
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Licença
|
|
144
|
+
|
|
145
|
+
Distribuído sob a licença GPL-3.0. Veja `LICENSE` para mais informações.
|
|
@@ -1,147 +1,153 @@
|
|
|
1
|
-
"""Exibe o gráfico de barras."""
|
|
2
|
-
|
|
3
|
-
import click
|
|
4
|
-
|
|
5
|
-
from mtcli.conf import (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
from mtcli.models.
|
|
15
|
-
from mtcli.
|
|
16
|
-
from mtcli.views.
|
|
17
|
-
from mtcli.views.
|
|
18
|
-
from mtcli.views.
|
|
19
|
-
from mtcli.views.
|
|
20
|
-
from mtcli.views.
|
|
21
|
-
from mtcli.views.
|
|
22
|
-
from mtcli.views.
|
|
23
|
-
from mtcli.views.
|
|
24
|
-
from mtcli.views.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
help="Mostra o gráfico de candles em texto para o ativo e período especificados.",
|
|
30
|
-
)
|
|
31
|
-
@click.
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
""
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
views =
|
|
127
|
-
elif view in ["
|
|
128
|
-
views =
|
|
129
|
-
elif view in ["
|
|
130
|
-
views =
|
|
131
|
-
elif view in ["
|
|
132
|
-
views =
|
|
133
|
-
elif view in ["
|
|
134
|
-
views =
|
|
135
|
-
elif view in ["
|
|
136
|
-
views =
|
|
137
|
-
|
|
138
|
-
).views()
|
|
139
|
-
|
|
140
|
-
views =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
1
|
+
"""Exibe o gráfico de barras."""
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
from mtcli.conf import (
|
|
6
|
+
DATE,
|
|
7
|
+
PERIOD,
|
|
8
|
+
PERIODOS,
|
|
9
|
+
SYMBOL,
|
|
10
|
+
TIMEFRAMES,
|
|
11
|
+
VIEW,
|
|
12
|
+
VOLUME,
|
|
13
|
+
)
|
|
14
|
+
from mtcli.models.bars_model import BarsModel
|
|
15
|
+
from mtcli.models.rates_model import RatesModel
|
|
16
|
+
from mtcli.views.close_view import CloseView
|
|
17
|
+
from mtcli.views.full_view import FullView
|
|
18
|
+
from mtcli.views.high_view import HighView
|
|
19
|
+
from mtcli.views.low_view import LowView
|
|
20
|
+
from mtcli.views.min_view import MinView
|
|
21
|
+
from mtcli.views.open_view import OpenView
|
|
22
|
+
from mtcli.views.ranges_view import RangesView
|
|
23
|
+
from mtcli.views.rates_view import RatesView
|
|
24
|
+
from mtcli.views.vars_view import VarsView
|
|
25
|
+
from mtcli.views.volumes_view import VolumesView
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@click.command(
|
|
29
|
+
help="Mostra o gráfico de candles em texto para o ativo e período especificados.",
|
|
30
|
+
)
|
|
31
|
+
@click.option(
|
|
32
|
+
"--symbol",
|
|
33
|
+
"-s",
|
|
34
|
+
default=SYMBOL,
|
|
35
|
+
show_default=True,
|
|
36
|
+
help="Codigo ou ticker do ativo.",
|
|
37
|
+
)
|
|
38
|
+
@click.option(
|
|
39
|
+
"--view",
|
|
40
|
+
"-v",
|
|
41
|
+
type=click.Choice(
|
|
42
|
+
[
|
|
43
|
+
"ch",
|
|
44
|
+
"m",
|
|
45
|
+
"hl",
|
|
46
|
+
"f",
|
|
47
|
+
"full",
|
|
48
|
+
"r",
|
|
49
|
+
"range",
|
|
50
|
+
"v",
|
|
51
|
+
"volume",
|
|
52
|
+
"va",
|
|
53
|
+
"percentual",
|
|
54
|
+
"oh",
|
|
55
|
+
"ohlc",
|
|
56
|
+
"o",
|
|
57
|
+
"open",
|
|
58
|
+
"h",
|
|
59
|
+
"high",
|
|
60
|
+
"l",
|
|
61
|
+
"low",
|
|
62
|
+
"c",
|
|
63
|
+
"close",
|
|
64
|
+
],
|
|
65
|
+
case_sensitive=False,
|
|
66
|
+
),
|
|
67
|
+
default=VIEW,
|
|
68
|
+
show_default=True,
|
|
69
|
+
help="Formato de exibicao. Opcoes: minima ou HL - minima; f - completa; r - ranges; v - volumes; va - variações percentuais; oh - OHLC; o - aberturas; h - maximas; l - minimas; c - fechamentos.",
|
|
70
|
+
)
|
|
71
|
+
@click.option(
|
|
72
|
+
"--period",
|
|
73
|
+
"-p",
|
|
74
|
+
type=click.Choice(TIMEFRAMES, case_sensitive=False),
|
|
75
|
+
default=PERIOD,
|
|
76
|
+
show_default=True,
|
|
77
|
+
help="Timeframe do grafico.",
|
|
78
|
+
)
|
|
79
|
+
@click.option(
|
|
80
|
+
"--count",
|
|
81
|
+
"-c",
|
|
82
|
+
type=int,
|
|
83
|
+
default=PERIODOS,
|
|
84
|
+
show_default=True,
|
|
85
|
+
help="Quantidade de periodos a serem exibidos.",
|
|
86
|
+
)
|
|
87
|
+
@click.option(
|
|
88
|
+
"--date",
|
|
89
|
+
"-d",
|
|
90
|
+
default=DATE,
|
|
91
|
+
show_default=True,
|
|
92
|
+
help="Data para intraday, formato AAAA-MM-DD.",
|
|
93
|
+
)
|
|
94
|
+
@click.option(
|
|
95
|
+
"--numerator",
|
|
96
|
+
"-n",
|
|
97
|
+
is_flag=True,
|
|
98
|
+
default=False,
|
|
99
|
+
show_default=True,
|
|
100
|
+
help="Ativa a numeracao das barras.",
|
|
101
|
+
)
|
|
102
|
+
@click.option(
|
|
103
|
+
"--show-date",
|
|
104
|
+
"-sd",
|
|
105
|
+
is_flag=True,
|
|
106
|
+
default=False,
|
|
107
|
+
show_default=True,
|
|
108
|
+
help="Ativa a datacao das barras.",
|
|
109
|
+
)
|
|
110
|
+
@click.option(
|
|
111
|
+
"--volume",
|
|
112
|
+
"-vo",
|
|
113
|
+
type=click.Choice(["tick", "real"], case_sensitive=False),
|
|
114
|
+
default=VOLUME,
|
|
115
|
+
show_default=True,
|
|
116
|
+
help="Tipo de volume.",
|
|
117
|
+
)
|
|
118
|
+
def bars(symbol, view, period, count, date, numerator, show_date, volume):
|
|
119
|
+
"""Exibe o grafico do MetaTrader 5."""
|
|
120
|
+
period = period.lower()
|
|
121
|
+
view = view.lower()
|
|
122
|
+
rates = RatesModel(symbol, period, count).get_data()
|
|
123
|
+
bars = BarsModel(rates, date).get_bars()
|
|
124
|
+
views = []
|
|
125
|
+
if view in ["m", "ch", "hl"]: # máximas e mínimas
|
|
126
|
+
views = MinView(bars, count, period, date, numerator, show_date).views()
|
|
127
|
+
elif view in ["r", "range"]: # ranges
|
|
128
|
+
views = RangesView(bars, count, period, date, numerator, show_date).views()
|
|
129
|
+
elif view in ["oh", "ohlc"]: # OHLC
|
|
130
|
+
views = RatesView(bars, count, period, date, numerator, show_date).views()
|
|
131
|
+
elif view in ["va", "percentual"]: # variações percentuais
|
|
132
|
+
views = VarsView(bars, count, period, date, numerator, show_date).views()
|
|
133
|
+
elif view in ["o", "open"]: # abertura
|
|
134
|
+
views = OpenView(bars, count, period, date, numerator, show_date).views()
|
|
135
|
+
elif view in ["h", "high"]: # máximas
|
|
136
|
+
views = HighView(bars, count, period, date, numerator, show_date).views()
|
|
137
|
+
elif view in ["l", "low"]: # mínimas
|
|
138
|
+
views = LowView(bars, count, period, date, numerator, show_date).views()
|
|
139
|
+
elif view in ["c", "close"]: # fechamentos
|
|
140
|
+
views = CloseView(bars, count, period, date, numerator, show_date).views()
|
|
141
|
+
elif view in ["v", "volume"]: # volumes
|
|
142
|
+
views = VolumesView(
|
|
143
|
+
bars, count, period, date, numerator, show_date, volume
|
|
144
|
+
).views()
|
|
145
|
+
else: # completo
|
|
146
|
+
views = FullView(bars, count, period, date, numerator, show_date).views()
|
|
147
|
+
if views:
|
|
148
|
+
for view in views:
|
|
149
|
+
click.echo(view)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
if __name__ == "__main__":
|
|
153
|
+
bars()
|