mtcli 3.7.0.dev8__tar.gz → 3.7.0.dev9__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.
Files changed (72) hide show
  1. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/PKG-INFO +1 -1
  2. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/conf.py +85 -10
  3. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/pyproject.toml +1 -1
  4. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/LICENSE +0 -0
  5. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/README.md +0 -0
  6. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/__init__.py +0 -0
  7. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/cli.py +0 -0
  8. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/commands/__init__.py +0 -0
  9. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/commands/bars.py +0 -0
  10. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/commands/conf.py +0 -0
  11. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/commands/doctor.py +0 -0
  12. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/conecta.py +0 -0
  13. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/config_registre.py +0 -0
  14. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/data/__init__.py +0 -0
  15. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/data/base.py +0 -0
  16. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/data/csv.py +0 -0
  17. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/data/mt5.py +0 -0
  18. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/database.py +0 -0
  19. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/domain/__init__.py +0 -0
  20. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/domain/timeframe.py +0 -0
  21. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/logger.py +0 -0
  22. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/marketdata/__init__.py +0 -0
  23. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/marketdata/tick_cache.py +0 -0
  24. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/marketdata/tick_repository.py +0 -0
  25. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/__init__.py +0 -0
  26. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/bar_model.py +0 -0
  27. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/bars_model.py +0 -0
  28. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/chart_model.py +0 -0
  29. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/conf_model.py +0 -0
  30. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/consecutive_bars_model.py +0 -0
  31. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/rates_model.py +0 -0
  32. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/signals_model.py +0 -0
  33. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/models/unconsecutive_bar_model.py +0 -0
  34. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/mt5_context.py +0 -0
  35. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugin.py +0 -0
  36. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugin_loader.py +0 -0
  37. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugin_manager.py +0 -0
  38. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/__init__.py +0 -0
  39. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/exemplo.py-dist +0 -0
  40. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/__init__.py +0 -0
  41. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/cli.py +0 -0
  42. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/conf.py +0 -0
  43. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/models/__init__.py +0 -0
  44. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/models/model_media_movel.py +0 -0
  45. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/tests/__init__.py +0 -0
  46. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/tests/test_mm.py +0 -0
  47. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/media_movel/tests/test_model_media_movel.py +0 -0
  48. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/range_medio/__init__.py +0 -0
  49. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/range_medio/cli.py +0 -0
  50. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/range_medio/conf.py +0 -0
  51. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/range_medio/models/__init__.py +0 -0
  52. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/range_medio/models/average_range_model.py +0 -0
  53. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/range_medio/tests/__init__.py +0 -0
  54. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/range_medio/tests/test_rm.py +0 -0
  55. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/volume_medio/__init__.py +0 -0
  56. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/volume_medio/cli.py +0 -0
  57. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/volume_medio/conf.py +0 -0
  58. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/volume_medio/models/__init__.py +0 -0
  59. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/volume_medio/models/model_average_volume.py +0 -0
  60. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/volume_medio/tests/__init__.py +0 -0
  61. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/plugins/volume_medio/tests/test_vm.py +0 -0
  62. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/__init__.py +0 -0
  63. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/close_view.py +0 -0
  64. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/full_view.py +0 -0
  65. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/high_view.py +0 -0
  66. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/low_view.py +0 -0
  67. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/min_view.py +0 -0
  68. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/open_view.py +0 -0
  69. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/ranges_view.py +0 -0
  70. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/rates_view.py +0 -0
  71. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/vars_view.py +0 -0
  72. {mtcli-3.7.0.dev8 → mtcli-3.7.0.dev9}/mtcli/views/volumes_view.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mtcli
3
- Version: 3.7.0.dev8
3
+ Version: 3.7.0.dev9
4
4
  Summary: Aplicativo CLI para exibir gráficos do MetaTrader 5 screen reader friendly
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -12,7 +12,21 @@ Também oferece utilidades usadas por plugins como:
12
12
  - descoberta do diretório MQL5/Files
13
13
  - seleção da fonte de dados (CSV ou MT5)
14
14
 
15
- Plugins devem acessar a configuração através do objeto global `conf`.
15
+ Plugins novos devem acessar a configuração através do objeto global `conf`.
16
+
17
+ Compatibilidade retroativa:
18
+ ---------------------------
19
+ Plugins antigos utilizavam:
20
+
21
+ from mtcli.conf import config
22
+
23
+ onde `config` era um objeto `configparser.ConfigParser`.
24
+
25
+ Para manter compatibilidade com plugins já publicados,
26
+ o objeto `config` continua sendo exposto.
27
+
28
+ Essa API é considerada **deprecated** e poderá ser removida
29
+ em versões futuras do mtcli.
16
30
  """
17
31
 
18
32
  import os
@@ -26,6 +40,17 @@ from mtcli.mt5_context import mt5_conexao
26
40
  class Config:
27
41
  """
28
42
  Gerenciador central de configurações do mtcli.
43
+
44
+ Permite acessar valores a partir de:
45
+
46
+ - variáveis de ambiente
47
+ - arquivo mtcli.ini
48
+ - valores default
49
+
50
+ Plugins devem preferencialmente usar:
51
+
52
+ from mtcli.conf import conf
53
+ conf.get(...)
29
54
  """
30
55
 
31
56
  def __init__(self, filename="mtcli.ini"):
@@ -49,10 +74,17 @@ class Config:
49
74
  5. default
50
75
 
51
76
  Args:
52
- key (str)
53
- section (str)
54
- cast (type | None)
55
- default (Any)
77
+ key (str):
78
+ Nome da configuração.
79
+
80
+ section (str):
81
+ Seção do arquivo mtcli.ini.
82
+
83
+ cast (type | None):
84
+ Tipo para conversão do valor.
85
+
86
+ default (Any):
87
+ Valor padrão.
56
88
 
57
89
  Returns:
58
90
  Any
@@ -95,10 +127,14 @@ class Config:
95
127
  def section(self, section):
96
128
  """
97
129
  Retorna um helper para acessar uma seção específica.
130
+
131
+ Example:
132
+
133
+ renko = conf.section("renko")
134
+ brick = renko.get("brick", cast=int, default=10)
98
135
  """
99
136
 
100
137
  class Section:
101
-
102
138
  def __init__(self, parent, section):
103
139
  self.parent = parent
104
140
  self.section = section
@@ -114,7 +150,15 @@ class Config:
114
150
 
115
151
  def get_csv_path(self):
116
152
  """
117
- Retorna o caminho da pasta MQL5/Files.
153
+ Retorna o caminho da pasta MQL5/Files do MetaTrader 5.
154
+
155
+ A prioridade é:
156
+
157
+ 1. mtcli.ini -> mt5_pasta
158
+ 2. descoberta automática via MT5
159
+
160
+ Returns:
161
+ str: caminho normalizado da pasta Files.
118
162
  """
119
163
 
120
164
  path = self.get("mt5_pasta")
@@ -142,6 +186,13 @@ class Config:
142
186
  def get_data_source(self, source=None):
143
187
  """
144
188
  Retorna a fonte de dados configurada.
189
+
190
+ Args:
191
+ source (str | None):
192
+ Fonte explícita ("csv" ou "mt5").
193
+
194
+ Returns:
195
+ DataSource
145
196
  """
146
197
 
147
198
  from mtcli.data import CsvDataSource, MT5DataSource
@@ -157,9 +208,30 @@ class Config:
157
208
  raise ValueError(f"Fonte de dados desconhecida: {src}")
158
209
 
159
210
 
211
+ # ---------------------------------------------------------
160
212
  # instância global usada por todo o sistema
213
+ # ---------------------------------------------------------
214
+
161
215
  conf = Config()
162
216
 
217
+ # ---------------------------------------------------------
218
+ # compatibilidade com plugins antigos
219
+ # ---------------------------------------------------------
220
+ #
221
+ # Plugins antigos utilizam:
222
+ #
223
+ # from mtcli.conf import config
224
+ #
225
+ # onde `config` era um ConfigParser.
226
+ #
227
+ # Mantemos esse objeto apontando para o ConfigParser interno
228
+ # para evitar quebra de compatibilidade.
229
+ #
230
+ # API DEPRECATED – usar `conf.get()` em novos plugins.
231
+ #
232
+
233
+ config = conf.config
234
+
163
235
 
164
236
  # ---------------------------------------------------------
165
237
  # timeframes suportados
@@ -174,7 +246,6 @@ TIMEFRAMES = (
174
246
  + [f"m{i}" for i in _MINUTES]
175
247
  )
176
248
 
177
-
178
249
  # ---------------------------------------------------------
179
250
  # Configurações gerais
180
251
  # ---------------------------------------------------------
@@ -200,11 +271,15 @@ ROMPIMENTO_ALTA = conf.get("rompimento_alta", default="c")
200
271
  ROMPIMENTO_BAIXA = conf.get("rompimento_baixa", default="v")
201
272
 
202
273
  PERCENTUAL_ROMPIMENTO = conf.get(
203
- "percentual_rompimento", cast=int, default=50
274
+ "percentual_rompimento",
275
+ cast=int,
276
+ default=50,
204
277
  )
205
278
 
206
279
  PERCENTUAL_DOJI = conf.get(
207
- "percentual_doji", cast=int, default=10
280
+ "percentual_doji",
281
+ cast=int,
282
+ default=10,
208
283
  )
209
284
 
210
285
  # ---------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mtcli"
3
- version = "3.7.0.dev8"
3
+ version = "3.7.0.dev9"
4
4
  description = "Aplicativo CLI para exibir gráficos do MetaTrader 5 screen reader friendly"
5
5
  authors = [
6
6
  {name = "Valmir França da Silva",email = "vfranca3@gmail.com"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes