firstrade 0.0.20__tar.gz → 0.0.21__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.
- {firstrade-0.0.20 → firstrade-0.0.21}/PKG-INFO +2 -2
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade/order.py +17 -1
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade.egg-info/PKG-INFO +2 -2
- {firstrade-0.0.20 → firstrade-0.0.21}/setup.py +2 -2
- {firstrade-0.0.20 → firstrade-0.0.21}/LICENSE +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/README.md +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade/__init__.py +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade/account.py +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade/symbols.py +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade/urls.py +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade.egg-info/SOURCES.txt +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade.egg-info/dependency_links.txt +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade.egg-info/requires.txt +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/firstrade.egg-info/top_level.txt +0 -0
- {firstrade-0.0.20 → firstrade-0.0.21}/setup.cfg +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: firstrade
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.21
|
|
4
4
|
Summary: An unofficial API for Firstrade
|
|
5
5
|
Home-page: https://github.com/MaxxRK/firstrade-api
|
|
6
|
-
Download-URL: https://github.com/MaxxRK/firstrade-api/archive/refs/tags/
|
|
6
|
+
Download-URL: https://github.com/MaxxRK/firstrade-api/archive/refs/tags/0021.tar.gz
|
|
7
7
|
Author: MaxxRK
|
|
8
8
|
Author-email: maxxrk@pm.me
|
|
9
9
|
License: MIT
|
|
@@ -45,6 +45,17 @@ class OrderType(str, Enum):
|
|
|
45
45
|
BUY_TO_COVER = "BC"
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
class OrderInstructions(str, Enum):
|
|
49
|
+
"""
|
|
50
|
+
This is an :class:'~enum.Enum'
|
|
51
|
+
that contains the valid instructions for an order.
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
AON = "1"
|
|
55
|
+
OPG = "4"
|
|
56
|
+
CLO = "5"
|
|
57
|
+
|
|
58
|
+
|
|
48
59
|
class Order:
|
|
49
60
|
"""
|
|
50
61
|
This class contains information about an order.
|
|
@@ -66,6 +77,7 @@ class Order:
|
|
|
66
77
|
price=0.00,
|
|
67
78
|
dry_run=True,
|
|
68
79
|
notional=False,
|
|
80
|
+
order_instruction: OrderInstructions = None,
|
|
69
81
|
):
|
|
70
82
|
"""
|
|
71
83
|
Builds and places an order.
|
|
@@ -88,6 +100,10 @@ class Order:
|
|
|
88
100
|
|
|
89
101
|
if price_type == PriceType.MARKET:
|
|
90
102
|
price = ""
|
|
103
|
+
if order_instruction == OrderInstructions.AON and price_type != PriceType.LIMIT:
|
|
104
|
+
raise ValueError("AON orders must be a limit order.")
|
|
105
|
+
if order_instruction == OrderInstructions.AON and quantity <= 100:
|
|
106
|
+
raise ValueError("AON orders must be greater than 100 shares.")
|
|
91
107
|
|
|
92
108
|
data = {
|
|
93
109
|
"submiturl": "/cgi-bin/orderbar",
|
|
@@ -109,7 +125,7 @@ class Order:
|
|
|
109
125
|
"priceType": price_type,
|
|
110
126
|
"limitPrice": price,
|
|
111
127
|
"duration": duration,
|
|
112
|
-
"qualifier": "0",
|
|
128
|
+
"qualifier": "0" if order_instruction is None else order_instruction,
|
|
113
129
|
"cond_symbol0_0": "",
|
|
114
130
|
"cond_type0_0": "2",
|
|
115
131
|
"cond_compare_type0_0": "2",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: firstrade
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.21
|
|
4
4
|
Summary: An unofficial API for Firstrade
|
|
5
5
|
Home-page: https://github.com/MaxxRK/firstrade-api
|
|
6
|
-
Download-URL: https://github.com/MaxxRK/firstrade-api/archive/refs/tags/
|
|
6
|
+
Download-URL: https://github.com/MaxxRK/firstrade-api/archive/refs/tags/0021.tar.gz
|
|
7
7
|
Author: MaxxRK
|
|
8
8
|
Author-email: maxxrk@pm.me
|
|
9
9
|
License: MIT
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as f:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="firstrade",
|
|
8
|
-
version="0.0.
|
|
8
|
+
version="0.0.21",
|
|
9
9
|
author="MaxxRK",
|
|
10
10
|
author_email="maxxrk@pm.me",
|
|
11
11
|
description="An unofficial API for Firstrade",
|
|
@@ -13,7 +13,7 @@ setuptools.setup(
|
|
|
13
13
|
long_description_content_type="text/markdown",
|
|
14
14
|
license="MIT",
|
|
15
15
|
url="https://github.com/MaxxRK/firstrade-api",
|
|
16
|
-
download_url="https://github.com/MaxxRK/firstrade-api/archive/refs/tags/
|
|
16
|
+
download_url="https://github.com/MaxxRK/firstrade-api/archive/refs/tags/0021.tar.gz",
|
|
17
17
|
keywords=["FIRSTRADE", "API"],
|
|
18
18
|
install_requires=["requests", "beautifulsoup4", "lxml"],
|
|
19
19
|
packages=["firstrade"],
|
|
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
|
|
File without changes
|