bullishpy 0.5.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
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.
Potentially problematic release.
This version of bullishpy might be problematic. Click here for more details.
- bullish/analysis/analysis.py +112 -251
- bullish/analysis/filter.py +83 -41
- bullish/analysis/functions.py +344 -0
- bullish/analysis/indicators.py +450 -0
- bullish/analysis/predefined_filters.py +87 -0
- bullish/app/app.py +149 -67
- bullish/database/alembic/versions/08ac1116e055_.py +592 -0
- bullish/database/alembic/versions/49c83f9eb5ac_.py +103 -0
- bullish/database/alembic/versions/ee5baabb35f8_.py +51 -0
- bullish/database/crud.py +5 -0
- bullish/database/schemas.py +13 -0
- bullish/figures/figures.py +52 -12
- bullish/interface/interface.py +3 -0
- bullish/jobs/tasks.py +10 -0
- bullish/utils/__init__.py +0 -0
- bullish/utils/checks.py +64 -0
- {bullishpy-0.5.0.dist-info → bullishpy-0.7.0.dist-info}/METADATA +3 -4
- {bullishpy-0.5.0.dist-info → bullishpy-0.7.0.dist-info}/RECORD +20 -12
- {bullishpy-0.5.0.dist-info → bullishpy-0.7.0.dist-info}/WHEEL +0 -0
- {bullishpy-0.5.0.dist-info → bullishpy-0.7.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
"""
|
|
2
|
+
|
|
3
|
+
Revision ID: 08ac1116e055
|
|
4
|
+
Revises: 11d35a452b40
|
|
5
|
+
Create Date: 2025-06-27 21:22:44.798799
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Sequence, Union
|
|
10
|
+
|
|
11
|
+
from alembic import op
|
|
12
|
+
import sqlalchemy as sa
|
|
13
|
+
|
|
14
|
+
# revision identifiers, used by Alembic.
|
|
15
|
+
revision: str = "08ac1116e055"
|
|
16
|
+
down_revision: Union[str, None] = "11d35a452b40"
|
|
17
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
18
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def upgrade() -> None:
|
|
22
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
23
|
+
with op.batch_alter_table("analysis", schema=None) as batch_op:
|
|
24
|
+
batch_op.add_column(sa.Column("cdlmorningstar", sa.Date(), nullable=True))
|
|
25
|
+
batch_op.add_column(sa.Column("cdl3linestrike", sa.Date(), nullable=True))
|
|
26
|
+
batch_op.add_column(sa.Column("cdl3whitesoldiers", sa.Date(), nullable=True))
|
|
27
|
+
batch_op.add_column(sa.Column("cdlabandonedbaby", sa.Date(), nullable=True))
|
|
28
|
+
batch_op.add_column(sa.Column("cdltasukigap", sa.Date(), nullable=True))
|
|
29
|
+
batch_op.add_column(sa.Column("cdlpiercing", sa.Date(), nullable=True))
|
|
30
|
+
batch_op.add_column(sa.Column("cdlengulfing", sa.Date(), nullable=True))
|
|
31
|
+
batch_op.add_column(sa.Column("rate_of_change_1", sa.Float(), nullable=True))
|
|
32
|
+
batch_op.add_column(sa.Column("rate_of_change_7_4", sa.Float(), nullable=True))
|
|
33
|
+
batch_op.add_column(sa.Column("rate_of_change_7_12", sa.Float(), nullable=True))
|
|
34
|
+
batch_op.add_column(sa.Column("rate_of_change_30", sa.Float(), nullable=True))
|
|
35
|
+
batch_op.add_column(sa.Column("golden_cross", sa.Date(), nullable=True))
|
|
36
|
+
batch_op.add_column(sa.Column("death_cross", sa.Date(), nullable=True))
|
|
37
|
+
batch_op.add_column(sa.Column("mfi_oversold", sa.Date(), nullable=True))
|
|
38
|
+
batch_op.add_column(sa.Column("mfi_overbought", sa.Date(), nullable=True))
|
|
39
|
+
batch_op.add_column(sa.Column("stoch_oversold", sa.Date(), nullable=True))
|
|
40
|
+
batch_op.add_column(sa.Column("stoch_overbought", sa.Date(), nullable=True))
|
|
41
|
+
batch_op.add_column(
|
|
42
|
+
sa.Column("rsi_bullish_crossover", sa.Date(), nullable=True)
|
|
43
|
+
)
|
|
44
|
+
batch_op.add_column(
|
|
45
|
+
sa.Column("rsi_bearish_crossover", sa.Date(), nullable=True)
|
|
46
|
+
)
|
|
47
|
+
batch_op.add_column(sa.Column("rsi_oversold", sa.Date(), nullable=True))
|
|
48
|
+
batch_op.add_column(sa.Column("rsi_overbought", sa.Date(), nullable=True))
|
|
49
|
+
batch_op.add_column(
|
|
50
|
+
sa.Column("macd_12_26_9_bullish_crossover", sa.Date(), nullable=True)
|
|
51
|
+
)
|
|
52
|
+
batch_op.add_column(
|
|
53
|
+
sa.Column("macd_12_26_9_bearish_crossover", sa.Date(), nullable=True)
|
|
54
|
+
)
|
|
55
|
+
batch_op.add_column(
|
|
56
|
+
sa.Column("macd_12_26_9_zero_line_cross_up", sa.Date(), nullable=True)
|
|
57
|
+
)
|
|
58
|
+
batch_op.add_column(
|
|
59
|
+
sa.Column("macd_12_26_9_zero_line_cross_down", sa.Date(), nullable=True)
|
|
60
|
+
)
|
|
61
|
+
batch_op.add_column(sa.Column("adx_14_long", sa.Date(), nullable=True))
|
|
62
|
+
batch_op.add_column(sa.Column("adx_14_short", sa.Date(), nullable=True))
|
|
63
|
+
batch_op.create_index("ix_analysis_adx_14_long", ["adx_14_long"], unique=False)
|
|
64
|
+
batch_op.create_index(
|
|
65
|
+
"ix_analysis_adx_14_short", ["adx_14_short"], unique=False
|
|
66
|
+
)
|
|
67
|
+
batch_op.create_index("ix_analysis_base_symbol", ["base_symbol"], unique=False)
|
|
68
|
+
batch_op.create_index("ix_analysis_book_value", ["book_value"], unique=False)
|
|
69
|
+
batch_op.create_index(
|
|
70
|
+
"ix_analysis_cdl3linestrike", ["cdl3linestrike"], unique=False
|
|
71
|
+
)
|
|
72
|
+
batch_op.create_index(
|
|
73
|
+
"ix_analysis_cdl3whitesoldiers", ["cdl3whitesoldiers"], unique=False
|
|
74
|
+
)
|
|
75
|
+
batch_op.create_index(
|
|
76
|
+
"ix_analysis_cdlabandonedbaby", ["cdlabandonedbaby"], unique=False
|
|
77
|
+
)
|
|
78
|
+
batch_op.create_index(
|
|
79
|
+
"ix_analysis_cdlengulfing", ["cdlengulfing"], unique=False
|
|
80
|
+
)
|
|
81
|
+
batch_op.create_index(
|
|
82
|
+
"ix_analysis_cdlmorningstar", ["cdlmorningstar"], unique=False
|
|
83
|
+
)
|
|
84
|
+
batch_op.create_index("ix_analysis_cdlpiercing", ["cdlpiercing"], unique=False)
|
|
85
|
+
batch_op.create_index(
|
|
86
|
+
"ix_analysis_cdltasukigap", ["cdltasukigap"], unique=False
|
|
87
|
+
)
|
|
88
|
+
batch_op.create_index("ix_analysis_country", ["country"], unique=False)
|
|
89
|
+
batch_op.create_index("ix_analysis_created_at", ["created_at"], unique=False)
|
|
90
|
+
batch_op.create_index("ix_analysis_currency", ["currency"], unique=False)
|
|
91
|
+
batch_op.create_index("ix_analysis_date", ["date"], unique=False)
|
|
92
|
+
batch_op.create_index("ix_analysis_death_cross", ["death_cross"], unique=False)
|
|
93
|
+
batch_op.create_index(
|
|
94
|
+
"ix_analysis_dividend_rate", ["dividend_rate"], unique=False
|
|
95
|
+
)
|
|
96
|
+
batch_op.create_index(
|
|
97
|
+
"ix_analysis_dividend_yield", ["dividend_yield"], unique=False
|
|
98
|
+
)
|
|
99
|
+
batch_op.create_index(
|
|
100
|
+
"ix_analysis_earning_per_share", ["earning_per_share"], unique=False
|
|
101
|
+
)
|
|
102
|
+
batch_op.create_index("ix_analysis_exchange", ["exchange"], unique=False)
|
|
103
|
+
batch_op.create_index(
|
|
104
|
+
"ix_analysis_forward_earnings_per_share",
|
|
105
|
+
["forward_earnings_per_share"],
|
|
106
|
+
unique=False,
|
|
107
|
+
)
|
|
108
|
+
batch_op.create_index(
|
|
109
|
+
"ix_analysis_golden_cross", ["golden_cross"], unique=False
|
|
110
|
+
)
|
|
111
|
+
batch_op.create_index(
|
|
112
|
+
"ix_analysis_gross_margins", ["gross_margins"], unique=False
|
|
113
|
+
)
|
|
114
|
+
batch_op.create_index(
|
|
115
|
+
"ix_analysis_growing_basic_eps", ["growing_basic_eps"], unique=False
|
|
116
|
+
)
|
|
117
|
+
batch_op.create_index(
|
|
118
|
+
"ix_analysis_growing_diluted_eps", ["growing_diluted_eps"], unique=False
|
|
119
|
+
)
|
|
120
|
+
batch_op.create_index(
|
|
121
|
+
"ix_analysis_growing_net_income", ["growing_net_income"], unique=False
|
|
122
|
+
)
|
|
123
|
+
batch_op.create_index(
|
|
124
|
+
"ix_analysis_growing_operating_cash_flow",
|
|
125
|
+
["growing_operating_cash_flow"],
|
|
126
|
+
unique=False,
|
|
127
|
+
)
|
|
128
|
+
batch_op.create_index(
|
|
129
|
+
"ix_analysis_growing_operating_income",
|
|
130
|
+
["growing_operating_income"],
|
|
131
|
+
unique=False,
|
|
132
|
+
)
|
|
133
|
+
batch_op.create_index("ix_analysis_industry", ["industry"], unique=False)
|
|
134
|
+
batch_op.create_index(
|
|
135
|
+
"ix_analysis_industry_group", ["industry_group"], unique=False
|
|
136
|
+
)
|
|
137
|
+
batch_op.create_index("ix_analysis_isin", ["isin"], unique=False)
|
|
138
|
+
batch_op.create_index("ix_analysis_last_price", ["last_price"], unique=False)
|
|
139
|
+
batch_op.create_index(
|
|
140
|
+
"ix_analysis_macd_12_26_9_bearish_crossover",
|
|
141
|
+
["macd_12_26_9_bearish_crossover"],
|
|
142
|
+
unique=False,
|
|
143
|
+
)
|
|
144
|
+
batch_op.create_index(
|
|
145
|
+
"ix_analysis_macd_12_26_9_bullish_crossover",
|
|
146
|
+
["macd_12_26_9_bullish_crossover"],
|
|
147
|
+
unique=False,
|
|
148
|
+
)
|
|
149
|
+
batch_op.create_index(
|
|
150
|
+
"ix_analysis_macd_12_26_9_zero_line_cross_down",
|
|
151
|
+
["macd_12_26_9_zero_line_cross_down"],
|
|
152
|
+
unique=False,
|
|
153
|
+
)
|
|
154
|
+
batch_op.create_index(
|
|
155
|
+
"ix_analysis_macd_12_26_9_zero_line_cross_up",
|
|
156
|
+
["macd_12_26_9_zero_line_cross_up"],
|
|
157
|
+
unique=False,
|
|
158
|
+
)
|
|
159
|
+
batch_op.create_index("ix_analysis_market", ["market"], unique=False)
|
|
160
|
+
batch_op.create_index(
|
|
161
|
+
"ix_analysis_market_capitalization", ["market_capitalization"], unique=False
|
|
162
|
+
)
|
|
163
|
+
batch_op.create_index(
|
|
164
|
+
"ix_analysis_max_capex_ratio", ["max_capex_ratio"], unique=False
|
|
165
|
+
)
|
|
166
|
+
batch_op.create_index(
|
|
167
|
+
"ix_analysis_max_dividend_payout_ratio",
|
|
168
|
+
["max_dividend_payout_ratio"],
|
|
169
|
+
unique=False,
|
|
170
|
+
)
|
|
171
|
+
batch_op.create_index(
|
|
172
|
+
"ix_analysis_mean_capex_ratio", ["mean_capex_ratio"], unique=False
|
|
173
|
+
)
|
|
174
|
+
batch_op.create_index(
|
|
175
|
+
"ix_analysis_mean_dividend_payout_ratio",
|
|
176
|
+
["mean_dividend_payout_ratio"],
|
|
177
|
+
unique=False,
|
|
178
|
+
)
|
|
179
|
+
batch_op.create_index(
|
|
180
|
+
"ix_analysis_mfi_overbought", ["mfi_overbought"], unique=False
|
|
181
|
+
)
|
|
182
|
+
batch_op.create_index(
|
|
183
|
+
"ix_analysis_mfi_oversold", ["mfi_oversold"], unique=False
|
|
184
|
+
)
|
|
185
|
+
batch_op.create_index(
|
|
186
|
+
"ix_analysis_min_capex_ratio", ["min_capex_ratio"], unique=False
|
|
187
|
+
)
|
|
188
|
+
batch_op.create_index(
|
|
189
|
+
"ix_analysis_min_dividend_payout_ratio",
|
|
190
|
+
["min_dividend_payout_ratio"],
|
|
191
|
+
unique=False,
|
|
192
|
+
)
|
|
193
|
+
batch_op.create_index("ix_analysis_modifier", ["modifier"], unique=False)
|
|
194
|
+
batch_op.create_index("ix_analysis_name", ["name"], unique=False)
|
|
195
|
+
batch_op.create_index(
|
|
196
|
+
"ix_analysis_operating_cash_flow_is_higher_than_net_income",
|
|
197
|
+
["operating_cash_flow_is_higher_than_net_income"],
|
|
198
|
+
unique=False,
|
|
199
|
+
)
|
|
200
|
+
batch_op.create_index(
|
|
201
|
+
"ix_analysis_operating_margins", ["operating_margins"], unique=False
|
|
202
|
+
)
|
|
203
|
+
batch_op.create_index(
|
|
204
|
+
"ix_analysis_positive_basic_eps", ["positive_basic_eps"], unique=False
|
|
205
|
+
)
|
|
206
|
+
batch_op.create_index(
|
|
207
|
+
"ix_analysis_positive_debt_to_equity",
|
|
208
|
+
["positive_debt_to_equity"],
|
|
209
|
+
unique=False,
|
|
210
|
+
)
|
|
211
|
+
batch_op.create_index(
|
|
212
|
+
"ix_analysis_positive_diluted_eps", ["positive_diluted_eps"], unique=False
|
|
213
|
+
)
|
|
214
|
+
batch_op.create_index(
|
|
215
|
+
"ix_analysis_positive_free_cash_flow",
|
|
216
|
+
["positive_free_cash_flow"],
|
|
217
|
+
unique=False,
|
|
218
|
+
)
|
|
219
|
+
batch_op.create_index(
|
|
220
|
+
"ix_analysis_positive_net_income", ["positive_net_income"], unique=False
|
|
221
|
+
)
|
|
222
|
+
batch_op.create_index(
|
|
223
|
+
"ix_analysis_positive_operating_income",
|
|
224
|
+
["positive_operating_income"],
|
|
225
|
+
unique=False,
|
|
226
|
+
)
|
|
227
|
+
batch_op.create_index(
|
|
228
|
+
"ix_analysis_positive_return_on_assets",
|
|
229
|
+
["positive_return_on_assets"],
|
|
230
|
+
unique=False,
|
|
231
|
+
)
|
|
232
|
+
batch_op.create_index(
|
|
233
|
+
"ix_analysis_positive_return_on_equity",
|
|
234
|
+
["positive_return_on_equity"],
|
|
235
|
+
unique=False,
|
|
236
|
+
)
|
|
237
|
+
batch_op.create_index(
|
|
238
|
+
"ix_analysis_price_per_earning_ratio",
|
|
239
|
+
["price_per_earning_ratio"],
|
|
240
|
+
unique=False,
|
|
241
|
+
)
|
|
242
|
+
batch_op.create_index(
|
|
243
|
+
"ix_analysis_price_to_book", ["price_to_book"], unique=False
|
|
244
|
+
)
|
|
245
|
+
batch_op.create_index(
|
|
246
|
+
"ix_analysis_quarterly_earning_per_share",
|
|
247
|
+
["quarterly_earning_per_share"],
|
|
248
|
+
unique=False,
|
|
249
|
+
)
|
|
250
|
+
batch_op.create_index(
|
|
251
|
+
"ix_analysis_quarterly_growing_basic_eps",
|
|
252
|
+
["quarterly_growing_basic_eps"],
|
|
253
|
+
unique=False,
|
|
254
|
+
)
|
|
255
|
+
batch_op.create_index(
|
|
256
|
+
"ix_analysis_quarterly_growing_diluted_eps",
|
|
257
|
+
["quarterly_growing_diluted_eps"],
|
|
258
|
+
unique=False,
|
|
259
|
+
)
|
|
260
|
+
batch_op.create_index(
|
|
261
|
+
"ix_analysis_quarterly_growing_net_income",
|
|
262
|
+
["quarterly_growing_net_income"],
|
|
263
|
+
unique=False,
|
|
264
|
+
)
|
|
265
|
+
batch_op.create_index(
|
|
266
|
+
"ix_analysis_quarterly_growing_operating_cash_flow",
|
|
267
|
+
["quarterly_growing_operating_cash_flow"],
|
|
268
|
+
unique=False,
|
|
269
|
+
)
|
|
270
|
+
batch_op.create_index(
|
|
271
|
+
"ix_analysis_quarterly_growing_operating_income",
|
|
272
|
+
["quarterly_growing_operating_income"],
|
|
273
|
+
unique=False,
|
|
274
|
+
)
|
|
275
|
+
batch_op.create_index(
|
|
276
|
+
"ix_analysis_quarterly_max_capex_ratio",
|
|
277
|
+
["quarterly_max_capex_ratio"],
|
|
278
|
+
unique=False,
|
|
279
|
+
)
|
|
280
|
+
batch_op.create_index(
|
|
281
|
+
"ix_analysis_quarterly_max_dividend_payout_ratio",
|
|
282
|
+
["quarterly_max_dividend_payout_ratio"],
|
|
283
|
+
unique=False,
|
|
284
|
+
)
|
|
285
|
+
batch_op.create_index(
|
|
286
|
+
"ix_analysis_quarterly_mean_capex_ratio",
|
|
287
|
+
["quarterly_mean_capex_ratio"],
|
|
288
|
+
unique=False,
|
|
289
|
+
)
|
|
290
|
+
batch_op.create_index(
|
|
291
|
+
"ix_analysis_quarterly_mean_dividend_payout_ratio",
|
|
292
|
+
["quarterly_mean_dividend_payout_ratio"],
|
|
293
|
+
unique=False,
|
|
294
|
+
)
|
|
295
|
+
batch_op.create_index(
|
|
296
|
+
"ix_analysis_quarterly_min_capex_ratio",
|
|
297
|
+
["quarterly_min_capex_ratio"],
|
|
298
|
+
unique=False,
|
|
299
|
+
)
|
|
300
|
+
batch_op.create_index(
|
|
301
|
+
"ix_analysis_quarterly_min_dividend_payout_ratio",
|
|
302
|
+
["quarterly_min_dividend_payout_ratio"],
|
|
303
|
+
unique=False,
|
|
304
|
+
)
|
|
305
|
+
batch_op.create_index(
|
|
306
|
+
"ix_analysis_quarterly_operating_cash_flow_is_higher_than_net_income",
|
|
307
|
+
["quarterly_operating_cash_flow_is_higher_than_net_income"],
|
|
308
|
+
unique=False,
|
|
309
|
+
)
|
|
310
|
+
batch_op.create_index(
|
|
311
|
+
"ix_analysis_quarterly_positive_basic_eps",
|
|
312
|
+
["quarterly_positive_basic_eps"],
|
|
313
|
+
unique=False,
|
|
314
|
+
)
|
|
315
|
+
batch_op.create_index(
|
|
316
|
+
"ix_analysis_quarterly_positive_debt_to_equity",
|
|
317
|
+
["quarterly_positive_debt_to_equity"],
|
|
318
|
+
unique=False,
|
|
319
|
+
)
|
|
320
|
+
batch_op.create_index(
|
|
321
|
+
"ix_analysis_quarterly_positive_diluted_eps",
|
|
322
|
+
["quarterly_positive_diluted_eps"],
|
|
323
|
+
unique=False,
|
|
324
|
+
)
|
|
325
|
+
batch_op.create_index(
|
|
326
|
+
"ix_analysis_quarterly_positive_free_cash_flow",
|
|
327
|
+
["quarterly_positive_free_cash_flow"],
|
|
328
|
+
unique=False,
|
|
329
|
+
)
|
|
330
|
+
batch_op.create_index(
|
|
331
|
+
"ix_analysis_quarterly_positive_net_income",
|
|
332
|
+
["quarterly_positive_net_income"],
|
|
333
|
+
unique=False,
|
|
334
|
+
)
|
|
335
|
+
batch_op.create_index(
|
|
336
|
+
"ix_analysis_quarterly_positive_operating_income",
|
|
337
|
+
["quarterly_positive_operating_income"],
|
|
338
|
+
unique=False,
|
|
339
|
+
)
|
|
340
|
+
batch_op.create_index(
|
|
341
|
+
"ix_analysis_quarterly_positive_return_on_assets",
|
|
342
|
+
["quarterly_positive_return_on_assets"],
|
|
343
|
+
unique=False,
|
|
344
|
+
)
|
|
345
|
+
batch_op.create_index(
|
|
346
|
+
"ix_analysis_quarterly_positive_return_on_equity",
|
|
347
|
+
["quarterly_positive_return_on_equity"],
|
|
348
|
+
unique=False,
|
|
349
|
+
)
|
|
350
|
+
batch_op.create_index(
|
|
351
|
+
"ix_analysis_rate_of_change_1", ["rate_of_change_1"], unique=False
|
|
352
|
+
)
|
|
353
|
+
batch_op.create_index(
|
|
354
|
+
"ix_analysis_rate_of_change_30", ["rate_of_change_30"], unique=False
|
|
355
|
+
)
|
|
356
|
+
batch_op.create_index(
|
|
357
|
+
"ix_analysis_rate_of_change_7_12", ["rate_of_change_7_12"], unique=False
|
|
358
|
+
)
|
|
359
|
+
batch_op.create_index(
|
|
360
|
+
"ix_analysis_rate_of_change_7_4", ["rate_of_change_7_4"], unique=False
|
|
361
|
+
)
|
|
362
|
+
batch_op.create_index(
|
|
363
|
+
"ix_analysis_return_on_equity", ["return_on_equity"], unique=False
|
|
364
|
+
)
|
|
365
|
+
batch_op.create_index(
|
|
366
|
+
"ix_analysis_revenue_growth", ["revenue_growth"], unique=False
|
|
367
|
+
)
|
|
368
|
+
batch_op.create_index(
|
|
369
|
+
"ix_analysis_rsi_bearish_crossover", ["rsi_bearish_crossover"], unique=False
|
|
370
|
+
)
|
|
371
|
+
batch_op.create_index(
|
|
372
|
+
"ix_analysis_rsi_bullish_crossover", ["rsi_bullish_crossover"], unique=False
|
|
373
|
+
)
|
|
374
|
+
batch_op.create_index(
|
|
375
|
+
"ix_analysis_rsi_overbought", ["rsi_overbought"], unique=False
|
|
376
|
+
)
|
|
377
|
+
batch_op.create_index(
|
|
378
|
+
"ix_analysis_rsi_oversold", ["rsi_oversold"], unique=False
|
|
379
|
+
)
|
|
380
|
+
batch_op.create_index("ix_analysis_sector", ["sector"], unique=False)
|
|
381
|
+
batch_op.create_index(
|
|
382
|
+
"ix_analysis_stoch_overbought", ["stoch_overbought"], unique=False
|
|
383
|
+
)
|
|
384
|
+
batch_op.create_index(
|
|
385
|
+
"ix_analysis_stoch_oversold", ["stoch_oversold"], unique=False
|
|
386
|
+
)
|
|
387
|
+
batch_op.create_index("ix_analysis_summary", ["summary"], unique=False)
|
|
388
|
+
batch_op.create_index(
|
|
389
|
+
"ix_analysis_trailing_earnings_per_share",
|
|
390
|
+
["trailing_earnings_per_share"],
|
|
391
|
+
unique=False,
|
|
392
|
+
)
|
|
393
|
+
batch_op.create_index(
|
|
394
|
+
"ix_analysis_trailing_price_to_earnings",
|
|
395
|
+
["trailing_price_to_earnings"],
|
|
396
|
+
unique=False,
|
|
397
|
+
)
|
|
398
|
+
batch_op.create_index("ix_analysis_website", ["website"], unique=False)
|
|
399
|
+
batch_op.drop_column("last_year_growth")
|
|
400
|
+
batch_op.drop_column("year_to_date_max_growth")
|
|
401
|
+
batch_op.drop_column("last_month_max_growth")
|
|
402
|
+
batch_op.drop_column("last_week_max_growth")
|
|
403
|
+
batch_op.drop_column("star_wow")
|
|
404
|
+
batch_op.drop_column("last_dmp")
|
|
405
|
+
batch_op.drop_column("year_to_date_growth")
|
|
406
|
+
batch_op.drop_column("last_week_growth")
|
|
407
|
+
batch_op.drop_column("rsi_last_value")
|
|
408
|
+
batch_op.drop_column("ma_50_200_buy_date")
|
|
409
|
+
batch_op.drop_column("slope_14")
|
|
410
|
+
batch_op.drop_column("slope_7")
|
|
411
|
+
batch_op.drop_column("last_52_weeks_growth")
|
|
412
|
+
batch_op.drop_column("slope_60")
|
|
413
|
+
batch_op.drop_column("last_dmn")
|
|
414
|
+
batch_op.drop_column("last_price_date")
|
|
415
|
+
batch_op.drop_column("slope_30")
|
|
416
|
+
batch_op.drop_column("macd_12_26_9_buy")
|
|
417
|
+
batch_op.drop_column("last_year_max_growth")
|
|
418
|
+
batch_op.drop_column("macd_12_26_9_buy_date")
|
|
419
|
+
batch_op.drop_column("last_adx")
|
|
420
|
+
batch_op.drop_column("last_month_growth")
|
|
421
|
+
batch_op.drop_column("star_mom")
|
|
422
|
+
batch_op.drop_column("star_yoy")
|
|
423
|
+
|
|
424
|
+
# ### end Alembic commands ###
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
def downgrade() -> None:
|
|
428
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
429
|
+
with op.batch_alter_table("analysis", schema=None) as batch_op:
|
|
430
|
+
batch_op.add_column(sa.Column("star_yoy", sa.FLOAT(), nullable=True))
|
|
431
|
+
batch_op.add_column(sa.Column("star_mom", sa.FLOAT(), nullable=True))
|
|
432
|
+
batch_op.add_column(sa.Column("last_month_growth", sa.FLOAT(), nullable=True))
|
|
433
|
+
batch_op.add_column(sa.Column("last_adx", sa.FLOAT(), nullable=True))
|
|
434
|
+
batch_op.add_column(
|
|
435
|
+
sa.Column("macd_12_26_9_buy_date", sa.DATE(), nullable=True)
|
|
436
|
+
)
|
|
437
|
+
batch_op.add_column(
|
|
438
|
+
sa.Column("last_year_max_growth", sa.FLOAT(), nullable=True)
|
|
439
|
+
)
|
|
440
|
+
batch_op.add_column(sa.Column("macd_12_26_9_buy", sa.FLOAT(), nullable=True))
|
|
441
|
+
batch_op.add_column(sa.Column("slope_30", sa.FLOAT(), nullable=True))
|
|
442
|
+
batch_op.add_column(sa.Column("last_price_date", sa.DATE(), nullable=True))
|
|
443
|
+
batch_op.add_column(sa.Column("last_dmn", sa.FLOAT(), nullable=True))
|
|
444
|
+
batch_op.add_column(sa.Column("slope_60", sa.FLOAT(), nullable=True))
|
|
445
|
+
batch_op.add_column(
|
|
446
|
+
sa.Column("last_52_weeks_growth", sa.FLOAT(), nullable=True)
|
|
447
|
+
)
|
|
448
|
+
batch_op.add_column(sa.Column("slope_7", sa.FLOAT(), nullable=True))
|
|
449
|
+
batch_op.add_column(sa.Column("slope_14", sa.FLOAT(), nullable=True))
|
|
450
|
+
batch_op.add_column(sa.Column("ma_50_200_buy_date", sa.DATE(), nullable=True))
|
|
451
|
+
batch_op.add_column(sa.Column("rsi_last_value", sa.FLOAT(), nullable=True))
|
|
452
|
+
batch_op.add_column(sa.Column("last_week_growth", sa.FLOAT(), nullable=True))
|
|
453
|
+
batch_op.add_column(sa.Column("year_to_date_growth", sa.FLOAT(), nullable=True))
|
|
454
|
+
batch_op.add_column(sa.Column("last_dmp", sa.FLOAT(), nullable=True))
|
|
455
|
+
batch_op.add_column(sa.Column("star_wow", sa.FLOAT(), nullable=True))
|
|
456
|
+
batch_op.add_column(
|
|
457
|
+
sa.Column("last_week_max_growth", sa.FLOAT(), nullable=True)
|
|
458
|
+
)
|
|
459
|
+
batch_op.add_column(
|
|
460
|
+
sa.Column("last_month_max_growth", sa.FLOAT(), nullable=True)
|
|
461
|
+
)
|
|
462
|
+
batch_op.add_column(
|
|
463
|
+
sa.Column("year_to_date_max_growth", sa.FLOAT(), nullable=True)
|
|
464
|
+
)
|
|
465
|
+
batch_op.add_column(sa.Column("last_year_growth", sa.FLOAT(), nullable=True))
|
|
466
|
+
batch_op.drop_index("ix_analysis_website")
|
|
467
|
+
batch_op.drop_index("ix_analysis_trailing_price_to_earnings")
|
|
468
|
+
batch_op.drop_index("ix_analysis_trailing_earnings_per_share")
|
|
469
|
+
batch_op.drop_index("ix_analysis_summary")
|
|
470
|
+
batch_op.drop_index("ix_analysis_stoch_oversold")
|
|
471
|
+
batch_op.drop_index("ix_analysis_stoch_overbought")
|
|
472
|
+
batch_op.drop_index("ix_analysis_sector")
|
|
473
|
+
batch_op.drop_index("ix_analysis_rsi_oversold")
|
|
474
|
+
batch_op.drop_index("ix_analysis_rsi_overbought")
|
|
475
|
+
batch_op.drop_index("ix_analysis_rsi_bullish_crossover")
|
|
476
|
+
batch_op.drop_index("ix_analysis_rsi_bearish_crossover")
|
|
477
|
+
batch_op.drop_index("ix_analysis_revenue_growth")
|
|
478
|
+
batch_op.drop_index("ix_analysis_return_on_equity")
|
|
479
|
+
batch_op.drop_index("ix_analysis_rate_of_change_7_4")
|
|
480
|
+
batch_op.drop_index("ix_analysis_rate_of_change_7_12")
|
|
481
|
+
batch_op.drop_index("ix_analysis_rate_of_change_30")
|
|
482
|
+
batch_op.drop_index("ix_analysis_rate_of_change_1")
|
|
483
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_return_on_equity")
|
|
484
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_return_on_assets")
|
|
485
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_operating_income")
|
|
486
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_net_income")
|
|
487
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_free_cash_flow")
|
|
488
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_diluted_eps")
|
|
489
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_debt_to_equity")
|
|
490
|
+
batch_op.drop_index("ix_analysis_quarterly_positive_basic_eps")
|
|
491
|
+
batch_op.drop_index(
|
|
492
|
+
"ix_analysis_quarterly_operating_cash_flow_is_higher_than_net_income"
|
|
493
|
+
)
|
|
494
|
+
batch_op.drop_index("ix_analysis_quarterly_min_dividend_payout_ratio")
|
|
495
|
+
batch_op.drop_index("ix_analysis_quarterly_min_capex_ratio")
|
|
496
|
+
batch_op.drop_index("ix_analysis_quarterly_mean_dividend_payout_ratio")
|
|
497
|
+
batch_op.drop_index("ix_analysis_quarterly_mean_capex_ratio")
|
|
498
|
+
batch_op.drop_index("ix_analysis_quarterly_max_dividend_payout_ratio")
|
|
499
|
+
batch_op.drop_index("ix_analysis_quarterly_max_capex_ratio")
|
|
500
|
+
batch_op.drop_index("ix_analysis_quarterly_growing_operating_income")
|
|
501
|
+
batch_op.drop_index("ix_analysis_quarterly_growing_operating_cash_flow")
|
|
502
|
+
batch_op.drop_index("ix_analysis_quarterly_growing_net_income")
|
|
503
|
+
batch_op.drop_index("ix_analysis_quarterly_growing_diluted_eps")
|
|
504
|
+
batch_op.drop_index("ix_analysis_quarterly_growing_basic_eps")
|
|
505
|
+
batch_op.drop_index("ix_analysis_quarterly_earning_per_share")
|
|
506
|
+
batch_op.drop_index("ix_analysis_price_to_book")
|
|
507
|
+
batch_op.drop_index("ix_analysis_price_per_earning_ratio")
|
|
508
|
+
batch_op.drop_index("ix_analysis_positive_return_on_equity")
|
|
509
|
+
batch_op.drop_index("ix_analysis_positive_return_on_assets")
|
|
510
|
+
batch_op.drop_index("ix_analysis_positive_operating_income")
|
|
511
|
+
batch_op.drop_index("ix_analysis_positive_net_income")
|
|
512
|
+
batch_op.drop_index("ix_analysis_positive_free_cash_flow")
|
|
513
|
+
batch_op.drop_index("ix_analysis_positive_diluted_eps")
|
|
514
|
+
batch_op.drop_index("ix_analysis_positive_debt_to_equity")
|
|
515
|
+
batch_op.drop_index("ix_analysis_positive_basic_eps")
|
|
516
|
+
batch_op.drop_index("ix_analysis_operating_margins")
|
|
517
|
+
batch_op.drop_index("ix_analysis_operating_cash_flow_is_higher_than_net_income")
|
|
518
|
+
batch_op.drop_index("ix_analysis_name")
|
|
519
|
+
batch_op.drop_index("ix_analysis_modifier")
|
|
520
|
+
batch_op.drop_index("ix_analysis_min_dividend_payout_ratio")
|
|
521
|
+
batch_op.drop_index("ix_analysis_min_capex_ratio")
|
|
522
|
+
batch_op.drop_index("ix_analysis_mfi_oversold")
|
|
523
|
+
batch_op.drop_index("ix_analysis_mfi_overbought")
|
|
524
|
+
batch_op.drop_index("ix_analysis_mean_dividend_payout_ratio")
|
|
525
|
+
batch_op.drop_index("ix_analysis_mean_capex_ratio")
|
|
526
|
+
batch_op.drop_index("ix_analysis_max_dividend_payout_ratio")
|
|
527
|
+
batch_op.drop_index("ix_analysis_max_capex_ratio")
|
|
528
|
+
batch_op.drop_index("ix_analysis_market_capitalization")
|
|
529
|
+
batch_op.drop_index("ix_analysis_market")
|
|
530
|
+
batch_op.drop_index("ix_analysis_macd_12_26_9_zero_line_cross_up")
|
|
531
|
+
batch_op.drop_index("ix_analysis_macd_12_26_9_zero_line_cross_down")
|
|
532
|
+
batch_op.drop_index("ix_analysis_macd_12_26_9_bullish_crossover")
|
|
533
|
+
batch_op.drop_index("ix_analysis_macd_12_26_9_bearish_crossover")
|
|
534
|
+
batch_op.drop_index("ix_analysis_last_price")
|
|
535
|
+
batch_op.drop_index("ix_analysis_isin")
|
|
536
|
+
batch_op.drop_index("ix_analysis_industry_group")
|
|
537
|
+
batch_op.drop_index("ix_analysis_industry")
|
|
538
|
+
batch_op.drop_index("ix_analysis_growing_operating_income")
|
|
539
|
+
batch_op.drop_index("ix_analysis_growing_operating_cash_flow")
|
|
540
|
+
batch_op.drop_index("ix_analysis_growing_net_income")
|
|
541
|
+
batch_op.drop_index("ix_analysis_growing_diluted_eps")
|
|
542
|
+
batch_op.drop_index("ix_analysis_growing_basic_eps")
|
|
543
|
+
batch_op.drop_index("ix_analysis_gross_margins")
|
|
544
|
+
batch_op.drop_index("ix_analysis_golden_cross")
|
|
545
|
+
batch_op.drop_index("ix_analysis_forward_earnings_per_share")
|
|
546
|
+
batch_op.drop_index("ix_analysis_exchange")
|
|
547
|
+
batch_op.drop_index("ix_analysis_earning_per_share")
|
|
548
|
+
batch_op.drop_index("ix_analysis_dividend_yield")
|
|
549
|
+
batch_op.drop_index("ix_analysis_dividend_rate")
|
|
550
|
+
batch_op.drop_index("ix_analysis_death_cross")
|
|
551
|
+
batch_op.drop_index("ix_analysis_date")
|
|
552
|
+
batch_op.drop_index("ix_analysis_currency")
|
|
553
|
+
batch_op.drop_index("ix_analysis_created_at")
|
|
554
|
+
batch_op.drop_index("ix_analysis_country")
|
|
555
|
+
batch_op.drop_index("ix_analysis_cdltasukigap")
|
|
556
|
+
batch_op.drop_index("ix_analysis_cdlpiercing")
|
|
557
|
+
batch_op.drop_index("ix_analysis_cdlmorningstar")
|
|
558
|
+
batch_op.drop_index("ix_analysis_cdlengulfing")
|
|
559
|
+
batch_op.drop_index("ix_analysis_cdlabandonedbaby")
|
|
560
|
+
batch_op.drop_index("ix_analysis_cdl3whitesoldiers")
|
|
561
|
+
batch_op.drop_index("ix_analysis_cdl3linestrike")
|
|
562
|
+
batch_op.drop_index("ix_analysis_book_value")
|
|
563
|
+
batch_op.drop_index("ix_analysis_base_symbol")
|
|
564
|
+
batch_op.drop_index("ix_analysis_adx_14_short")
|
|
565
|
+
batch_op.drop_index("ix_analysis_adx_14_long")
|
|
566
|
+
batch_op.drop_column("adx_14_short")
|
|
567
|
+
batch_op.drop_column("adx_14_long")
|
|
568
|
+
batch_op.drop_column("macd_12_26_9_zero_line_cross_down")
|
|
569
|
+
batch_op.drop_column("macd_12_26_9_zero_line_cross_up")
|
|
570
|
+
batch_op.drop_column("macd_12_26_9_bearish_crossover")
|
|
571
|
+
batch_op.drop_column("macd_12_26_9_bullish_crossover")
|
|
572
|
+
batch_op.drop_column("rsi_overbought")
|
|
573
|
+
batch_op.drop_column("rsi_oversold")
|
|
574
|
+
batch_op.drop_column("rsi_bearish_crossover")
|
|
575
|
+
batch_op.drop_column("rsi_bullish_crossover")
|
|
576
|
+
batch_op.drop_column("stoch_overbought")
|
|
577
|
+
batch_op.drop_column("stoch_oversold")
|
|
578
|
+
batch_op.drop_column("mfi_overbought")
|
|
579
|
+
batch_op.drop_column("mfi_oversold")
|
|
580
|
+
batch_op.drop_column("death_cross")
|
|
581
|
+
batch_op.drop_column("golden_cross")
|
|
582
|
+
batch_op.drop_column("rate_of_change_30")
|
|
583
|
+
batch_op.drop_column("rate_of_change_7_12")
|
|
584
|
+
batch_op.drop_column("rate_of_change_7_4")
|
|
585
|
+
batch_op.drop_column("rate_of_change_1")
|
|
586
|
+
batch_op.drop_column("cdlengulfing")
|
|
587
|
+
batch_op.drop_column("cdlpiercing")
|
|
588
|
+
batch_op.drop_column("cdltasukigap")
|
|
589
|
+
batch_op.drop_column("cdlabandonedbaby")
|
|
590
|
+
batch_op.drop_column("cdl3whitesoldiers")
|
|
591
|
+
batch_op.drop_column("cdl3linestrike")
|
|
592
|
+
batch_op.drop_column("cdlmorningstar")
|