bullishpy 0.57.0__py3-none-any.whl → 0.58.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/constants.py +54 -0
- bullish/analysis/predefined_filters.py +23 -25
- {bullishpy-0.57.0.dist-info → bullishpy-0.58.0.dist-info}/METADATA +1 -1
- {bullishpy-0.57.0.dist-info → bullishpy-0.58.0.dist-info}/RECORD +7 -7
- {bullishpy-0.57.0.dist-info → bullishpy-0.58.0.dist-info}/LICENSE +0 -0
- {bullishpy-0.57.0.dist-info → bullishpy-0.58.0.dist-info}/WHEEL +0 -0
- {bullishpy-0.57.0.dist-info → bullishpy-0.58.0.dist-info}/entry_points.txt +0 -0
bullish/analysis/constants.py
CHANGED
|
@@ -400,3 +400,57 @@ Country = Literal[
|
|
|
400
400
|
"Liberia",
|
|
401
401
|
"Kenya",
|
|
402
402
|
]
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
HighGrowthIndustry = Literal[
|
|
406
|
+
"Software - Infrastructure",
|
|
407
|
+
"Software - Application",
|
|
408
|
+
"Internet Retail",
|
|
409
|
+
"Internet Content & Information",
|
|
410
|
+
"Electronic Gaming & Multimedia",
|
|
411
|
+
"Semiconductors",
|
|
412
|
+
"Semiconductor Equipment & Materials",
|
|
413
|
+
"Information Technology Services",
|
|
414
|
+
"Communication Equipment",
|
|
415
|
+
"Consumer Electronics",
|
|
416
|
+
"Health Information Services",
|
|
417
|
+
"Biotechnology",
|
|
418
|
+
"Medical Devices",
|
|
419
|
+
"Diagnostics & Research",
|
|
420
|
+
"Medical Instruments & Supplies",
|
|
421
|
+
"Drug Manufacturers - Specialty & Generic",
|
|
422
|
+
]
|
|
423
|
+
|
|
424
|
+
DefensiveIndustries = Literal[
|
|
425
|
+
"Utilities - Independent Power Producers",
|
|
426
|
+
"Utilities - Diversified",
|
|
427
|
+
"Utilities - Renewable",
|
|
428
|
+
"Utilities - Regulated Gas",
|
|
429
|
+
"Utilities - Regulated Water",
|
|
430
|
+
"Utilities - Regulated Electric",
|
|
431
|
+
"Household & Personal Products",
|
|
432
|
+
"Food Distribution",
|
|
433
|
+
"Packaged Foods",
|
|
434
|
+
"Grocery Stores",
|
|
435
|
+
"Beverages - Non - Alcoholic",
|
|
436
|
+
"Beverages - Brewers",
|
|
437
|
+
"Confectioners",
|
|
438
|
+
"Tobacco",
|
|
439
|
+
"Paper & Paper Products",
|
|
440
|
+
"Medical Devices",
|
|
441
|
+
"Drug Manufacturers - Specialty & Generic",
|
|
442
|
+
"Medical Instruments & Supplies",
|
|
443
|
+
"Medical Distribution",
|
|
444
|
+
"Medical Care Facilities",
|
|
445
|
+
"Drug Manufacturers - General",
|
|
446
|
+
"Healthcare Plans",
|
|
447
|
+
"Pharmaceutical Retailers",
|
|
448
|
+
"Waste Management",
|
|
449
|
+
"Pollution & Treatment Controls",
|
|
450
|
+
"Insurance Brokers",
|
|
451
|
+
"Insurance - Property & Casualty",
|
|
452
|
+
"Insurance - Specialty",
|
|
453
|
+
"Insurance - Reinsurance",
|
|
454
|
+
"Insurance - Diversified",
|
|
455
|
+
"Insurance - Life",
|
|
456
|
+
]
|
|
@@ -12,7 +12,12 @@ from bullish.analysis.backtest import (
|
|
|
12
12
|
BacktestQueryRange,
|
|
13
13
|
BacktestQuerySelection,
|
|
14
14
|
)
|
|
15
|
-
from bullish.analysis.constants import
|
|
15
|
+
from bullish.analysis.constants import (
|
|
16
|
+
Europe,
|
|
17
|
+
Us,
|
|
18
|
+
HighGrowthIndustry,
|
|
19
|
+
DefensiveIndustries,
|
|
20
|
+
)
|
|
16
21
|
from bullish.analysis.filter import FilterQuery, BOOLEAN_GROUP_MAPPING
|
|
17
22
|
from pydantic import BaseModel, Field
|
|
18
23
|
|
|
@@ -20,7 +25,7 @@ from bullish.analysis.indicators import Indicators
|
|
|
20
25
|
from bullish.database.crud import BullishDb
|
|
21
26
|
|
|
22
27
|
DATE_THRESHOLD = [
|
|
23
|
-
datetime.date.today() - datetime.timedelta(days=
|
|
28
|
+
datetime.date.today() - datetime.timedelta(days=2),
|
|
24
29
|
datetime.date.today(),
|
|
25
30
|
]
|
|
26
31
|
|
|
@@ -204,6 +209,14 @@ class NamedFilterQuery(FilterQuery):
|
|
|
204
209
|
}
|
|
205
210
|
return self._custom_variant("Long-term profitability", properties)
|
|
206
211
|
|
|
212
|
+
def high_growth(self) -> "NamedFilterQuery":
|
|
213
|
+
properties = {"industry": list(get_args(HighGrowthIndustry))}
|
|
214
|
+
return self._custom_variant("Growth", properties)
|
|
215
|
+
|
|
216
|
+
def defensive(self) -> "NamedFilterQuery":
|
|
217
|
+
properties = {"industry": list(get_args(DefensiveIndustries))}
|
|
218
|
+
return self._custom_variant("Defensive", properties)
|
|
219
|
+
|
|
207
220
|
def variants(self) -> List["NamedFilterQuery"]:
|
|
208
221
|
variants_ = [
|
|
209
222
|
self.country_variant("Europe", list(get_args(Europe))),
|
|
@@ -237,10 +250,14 @@ class NamedFilterQuery(FilterQuery):
|
|
|
237
250
|
variants_long_term_profitability = [
|
|
238
251
|
v.long_term_profitability() for v in variants_
|
|
239
252
|
]
|
|
253
|
+
variants_growth = [v.high_growth() for v in variants_]
|
|
254
|
+
variants_defensive = [v.defensive() for v in variants_]
|
|
240
255
|
return [
|
|
241
256
|
*variants_,
|
|
242
257
|
*variants_short_term_profitability,
|
|
243
258
|
*variants_long_term_profitability,
|
|
259
|
+
*variants_growth,
|
|
260
|
+
*variants_defensive,
|
|
244
261
|
]
|
|
245
262
|
|
|
246
263
|
|
|
@@ -264,24 +281,17 @@ SMALL_CAP = NamedFilterQuery(
|
|
|
264
281
|
market_capitalization=[5e7, 5e8],
|
|
265
282
|
properties=["positive_debt_to_equity"],
|
|
266
283
|
average_volume_30=[50000, 5e9],
|
|
267
|
-
volume_above_average=DATE_THRESHOLD,
|
|
268
|
-
sma_50_above_sma_200=[
|
|
269
|
-
datetime.date.today() - datetime.timedelta(days=5000),
|
|
270
|
-
datetime.date.today(),
|
|
271
|
-
],
|
|
272
|
-
weekly_growth=[1, 100],
|
|
273
|
-
monthly_growth=[8, 100],
|
|
274
284
|
order_by_desc="market_capitalization",
|
|
275
285
|
).variants()
|
|
276
286
|
|
|
277
287
|
LARGE_CAPS = NamedFilterQuery(
|
|
278
|
-
name="Large
|
|
288
|
+
name="Large Cap",
|
|
279
289
|
order_by_desc="market_capitalization",
|
|
280
290
|
market_capitalization=[1e10, 1e14],
|
|
281
291
|
).variants()
|
|
282
292
|
|
|
283
293
|
MID_CAPS = NamedFilterQuery(
|
|
284
|
-
name="Mid
|
|
294
|
+
name="Mid Cap",
|
|
285
295
|
order_by_desc="market_capitalization",
|
|
286
296
|
market_capitalization=[5e8, 1e10],
|
|
287
297
|
).variants()
|
|
@@ -294,27 +304,15 @@ NEXT_EARNINGS_DATE = NamedFilterQuery(
|
|
|
294
304
|
datetime.date.today() + timedelta(days=20),
|
|
295
305
|
],
|
|
296
306
|
).variants()
|
|
297
|
-
SEMICONDUCTORS = NamedFilterQuery(
|
|
298
|
-
name="Semiconductors",
|
|
299
|
-
order_by_desc="market_capitalization",
|
|
300
|
-
industry=["Semiconductors"],
|
|
301
|
-
).variants()
|
|
302
|
-
SOFTWARE = NamedFilterQuery(
|
|
303
|
-
name="Software - Application",
|
|
304
|
-
order_by_desc="market_capitalization",
|
|
305
|
-
industry=["Software - Application"],
|
|
306
|
-
).variants()
|
|
307
307
|
|
|
308
308
|
|
|
309
309
|
def predefined_filters() -> list[NamedFilterQuery]:
|
|
310
310
|
return [
|
|
311
|
+
*load_custom_filters(),
|
|
311
312
|
*SMALL_CAP,
|
|
313
|
+
*MID_CAPS,
|
|
312
314
|
*LARGE_CAPS,
|
|
313
315
|
*NEXT_EARNINGS_DATE,
|
|
314
|
-
*MID_CAPS,
|
|
315
|
-
*SEMICONDUCTORS,
|
|
316
|
-
*SOFTWARE,
|
|
317
|
-
*load_custom_filters(),
|
|
318
316
|
]
|
|
319
317
|
|
|
320
318
|
|
|
@@ -2,12 +2,12 @@ bullish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
bullish/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
bullish/analysis/analysis.py,sha256=Bcupt-qROPddj1hGTNAY8vhu0pnFqNvXoDtUNhRXErY,24217
|
|
4
4
|
bullish/analysis/backtest.py,sha256=x91ek5kOzJHvYq0TmJh1Q8wBDDduIaieE0zDaoZFXew,14325
|
|
5
|
-
bullish/analysis/constants.py,sha256=
|
|
5
|
+
bullish/analysis/constants.py,sha256=j3vQwjGhY-4dEEV-TkeKMDUTo2GM7M97Hcpi19LDcFQ,11458
|
|
6
6
|
bullish/analysis/filter.py,sha256=LKmsO3ei7Eo_SJsEVbZqETyIdOpW55xVheO6_GNoA0s,9286
|
|
7
7
|
bullish/analysis/functions.py,sha256=CuMgOjpQeg4KsDMUBdHRlxL1dRlos16KRyLhQe8PYUQ,14819
|
|
8
8
|
bullish/analysis/indicators.py,sha256=f5FReOeM1qgs_v3yEFp2ebPYqIQNib_4tftG0WDkhRQ,27648
|
|
9
9
|
bullish/analysis/industry_views.py,sha256=-B4CCAYz2arGQtWTXLLMpox0loO_MGdVQd2ycCRMOQQ,6799
|
|
10
|
-
bullish/analysis/predefined_filters.py,sha256=
|
|
10
|
+
bullish/analysis/predefined_filters.py,sha256=fXXKqa0K2A3UVhCo3g2SBwkI1qbZasNY3P7I574ygDE,12366
|
|
11
11
|
bullish/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
bullish/app/app.py,sha256=7hWVVd2jBM-Es9S904ck1mtIMSadWgFqwns0bTwrKOU,16720
|
|
13
13
|
bullish/cli.py,sha256=yYqiEQAvOIQ-pTn77RPuE449gwaEGBeQwNHHAJ5yQDM,2739
|
|
@@ -56,8 +56,8 @@ bullish/jobs/models.py,sha256=rBXxtGFBpgZprrxq5_X2Df-bh8BLYEfw-VLMRucrqa8,784
|
|
|
56
56
|
bullish/jobs/tasks.py,sha256=vmglWAADUUkhc_2ArzgAGdjtWotkYymvK6LQt08vGo4,6096
|
|
57
57
|
bullish/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
bullish/utils/checks.py,sha256=g-5QXNWNe1_BwHKrc2PtvPiLraL0tqGgxnzG7u-Wkgo,2189
|
|
59
|
-
bullishpy-0.
|
|
60
|
-
bullishpy-0.
|
|
61
|
-
bullishpy-0.
|
|
62
|
-
bullishpy-0.
|
|
63
|
-
bullishpy-0.
|
|
59
|
+
bullishpy-0.58.0.dist-info/LICENSE,sha256=nYb7AJFegu6ndlQhbbk54MjT-GH-0x9RF6Ls-ggJ_g4,1075
|
|
60
|
+
bullishpy-0.58.0.dist-info/METADATA,sha256=CdnabIEYe_DgQ2vx6OZiTkM1EzdHyS6_Is_X0AFuXdI,3009
|
|
61
|
+
bullishpy-0.58.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
62
|
+
bullishpy-0.58.0.dist-info/entry_points.txt,sha256=eaPpmL6vmSBFo0FBtwibCXGqAW4LFJ83whJzT1VjD-0,43
|
|
63
|
+
bullishpy-0.58.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|