fyers-apiv3 3.1.1__py3-none-any.whl → 3.1.3__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.
- fyers_apiv3/FyersWebsocket/map.json +1 -0
- fyers_apiv3/fyersModel.py +28 -0
- {fyers_apiv3-3.1.1.dist-info → fyers_apiv3-3.1.3.dist-info}/METADATA +44 -8
- {fyers_apiv3-3.1.1.dist-info → fyers_apiv3-3.1.3.dist-info}/RECORD +7 -7
- {fyers_apiv3-3.1.1.dist-info → fyers_apiv3-3.1.3.dist-info}/WHEEL +1 -1
- {fyers_apiv3-3.1.1.dist-info → fyers_apiv3-3.1.3.dist-info}/LICENSE.txt +0 -0
- {fyers_apiv3-3.1.1.dist-info → fyers_apiv3-3.1.3.dist-info}/top_level.txt +0 -0
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
"NSE:NIFTYGS10YR-INDEX": "Nifty GS 10Yr",
|
|
128
128
|
"NSE:NIFTYMIDCAP100-INDEX": "NIFTY MIDCAP 100",
|
|
129
129
|
"NSE:NIFTYNEXT50-INDEX": "Nifty Next 50",
|
|
130
|
+
"NSE:NIFTYNXT50-INDEX": "Nifty Next 50",
|
|
130
131
|
"NSE:NIFTYM150QLTY50-INDEX": "NIFTY M150 QLTY50",
|
|
131
132
|
"NSE:NIFTYSERVSECTOR-INDEX": "Nifty Serv Sector",
|
|
132
133
|
"NSE:NIFTYMIDSML400-INDEX": "NIFTY MIDSML 400",
|
fyers_apiv3/fyersModel.py
CHANGED
|
@@ -37,6 +37,7 @@ class Config:
|
|
|
37
37
|
quotes = "/quotes"
|
|
38
38
|
market_depth = "/depth"
|
|
39
39
|
option_chain = "/options-chain-v3"
|
|
40
|
+
multileg_orders = "/multileg/orders/sync"
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
|
|
@@ -818,6 +819,33 @@ class FyersModel:
|
|
|
818
819
|
else:
|
|
819
820
|
response = self.service.delete_call(Config.positions, self.header, data)
|
|
820
821
|
return response
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
def place_multileg_order(self, data) -> dict:
|
|
825
|
+
"""
|
|
826
|
+
Places an multileg order based on the provided data.
|
|
827
|
+
|
|
828
|
+
Args:
|
|
829
|
+
data (dict): A dictionary containing the order details.
|
|
830
|
+
- 'productType' (str): Type of the product. Possible values: 'INTRADAY', 'MARGIN'.
|
|
831
|
+
- 'offlineOrder' (bool): Specifies if the order is placed when the market is open (False) or as an AMO order (True).
|
|
832
|
+
- 'orderType' (str): Type of multileg. Possible values: '3L' for 3 legs and '2L' for 2 legs .
|
|
833
|
+
- 'validity' (str): Validity of the order. Possible values: 'IOC' (Immediate or Cancel).
|
|
834
|
+
legs (dict): A dictionary containing multiple legs order details.
|
|
835
|
+
- 'symbol' (str): Symbol of the product. Eg: 'NSE:SBIN-EQ'.
|
|
836
|
+
- 'qty' (int): Quantity of the product. Should be in multiples of lot size for derivatives.
|
|
837
|
+
- 'side' (int): Side of the order. 1 for Buy, -1 for Sell.
|
|
838
|
+
- 'type' (int): Type of the order. Possible values: 1 for Limit Order.
|
|
839
|
+
- 'limitPrice' (float): Valid price for Limit and Stoplimit orders.
|
|
840
|
+
|
|
841
|
+
Returns:
|
|
842
|
+
The response JSON as a dictionary.
|
|
843
|
+
"""
|
|
844
|
+
if self.is_async:
|
|
845
|
+
response = self.service.post_async_call(Config.multileg_orders, self.header, data)
|
|
846
|
+
else:
|
|
847
|
+
response = self.service.post_call(Config.multileg_orders, self.header, data)
|
|
848
|
+
return response
|
|
821
849
|
|
|
822
850
|
def generate_data_token(self, data):
|
|
823
851
|
allPackages = subprocess.check_output([sys.executable, "-m", "pip", "freeze"])
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 3.1.
|
|
2
|
+
Name: fyers_apiv3
|
|
3
|
+
Version: 3.1.3
|
|
4
4
|
Summary: Fyers trading APIs.
|
|
5
|
-
Home-page: https://github.com/FyersDev/fyers-api-
|
|
5
|
+
Home-page: https://github.com/FyersDev/fyers-api-sample-code/tree/sample_v3/v3/python
|
|
6
6
|
Author: Fyers-Tech
|
|
7
7
|
Author-email: support@fyers.in
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -10,11 +10,11 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE.txt
|
|
13
|
-
Requires-Dist: requests
|
|
14
|
-
Requires-Dist: asyncio
|
|
15
|
-
Requires-Dist: aiohttp
|
|
16
|
-
Requires-Dist: aws-lambda-powertools
|
|
17
|
-
Requires-Dist: websocket-client
|
|
13
|
+
Requires-Dist: requests ==2.31.0
|
|
14
|
+
Requires-Dist: asyncio ==3.4.3
|
|
15
|
+
Requires-Dist: aiohttp ==3.9.3
|
|
16
|
+
Requires-Dist: aws-lambda-powertools ==1.25.5
|
|
17
|
+
Requires-Dist: websocket-client ==1.6.1
|
|
18
18
|
|
|
19
19
|
# The Fyers API Python client - v3
|
|
20
20
|
|
|
@@ -155,6 +155,7 @@ print(fyers.positions()) ## This will provide the user with all the positions
|
|
|
155
155
|
There are two ways to place order
|
|
156
156
|
a. single order : wherein you can fire one order at a time
|
|
157
157
|
b. multi order : this is used to place a basket of order but the basket size can max be 10 symbols
|
|
158
|
+
c. multileg order : this is used to place a multileg order but the legs size minimum is 2 and maximum is 3
|
|
158
159
|
"""
|
|
159
160
|
|
|
160
161
|
## SINGLE ORDER
|
|
@@ -208,6 +209,41 @@ data = [{ "symbol":"NSE:SBIN-EQ",
|
|
|
208
209
|
|
|
209
210
|
print(fyers.place_basket_orders(data))
|
|
210
211
|
|
|
212
|
+
## MULTILEG ORDER
|
|
213
|
+
|
|
214
|
+
data = {
|
|
215
|
+
"orderTag": "tag1",
|
|
216
|
+
"productType": "MARGIN",
|
|
217
|
+
"offlineOrder": False,
|
|
218
|
+
"orderType": "3L",
|
|
219
|
+
"validity": "IOC",
|
|
220
|
+
"legs": {
|
|
221
|
+
"leg1": {
|
|
222
|
+
"symbol": "NSE:SBIN24JUNFUT",
|
|
223
|
+
"qty": 750,
|
|
224
|
+
"side": 1,
|
|
225
|
+
"type": 1,
|
|
226
|
+
"limitPrice": 800
|
|
227
|
+
},
|
|
228
|
+
"leg2": {
|
|
229
|
+
"symbol": "NSE:SBIN24JULFUT",
|
|
230
|
+
"qty": 750,
|
|
231
|
+
"side": 1,
|
|
232
|
+
"type": 1,
|
|
233
|
+
"limitPrice": 800
|
|
234
|
+
},
|
|
235
|
+
"leg3": {
|
|
236
|
+
"symbol": "NSE:SBIN24JUN900CE",
|
|
237
|
+
"qty": 750,
|
|
238
|
+
"side": 1,
|
|
239
|
+
"type": 1,
|
|
240
|
+
"limitPrice": 3
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
} ### This is a sample data structure used to place an 3 leg order using multileg order api .you can make the further changes based on your requriements
|
|
244
|
+
|
|
245
|
+
print(fyers.place_multileg_order(data))
|
|
246
|
+
|
|
211
247
|
|
|
212
248
|
###################################################################################################################
|
|
213
249
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
fyers_apiv3/__init__.py,sha256=1vA_F8dAtLKcyOqrmdUOkw1Syl8gIFUtxDoLde8y94E,18
|
|
2
|
-
fyers_apiv3/fyersModel.py,sha256=
|
|
2
|
+
fyers_apiv3/fyersModel.py,sha256=yfNp2vHexQtF0YRIv8bVN_fab864HLiYbT3oyc1TXpU,40332
|
|
3
3
|
fyers_apiv3/fyers_logger.py,sha256=S_WiIwBLytQ_tyHd9bUC8gZo7GHpANCJO0CS6rCJE90,3795
|
|
4
4
|
fyers_apiv3/FyersWebsocket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
fyers_apiv3/FyersWebsocket/data_ws.py,sha256=fSNfsUB_I5-MkWX4hQZvklRQhuQ9n3w5hMDRFrMaBE8,68105
|
|
6
6
|
fyers_apiv3/FyersWebsocket/defines.py,sha256=mhKkkQ6FZHFa6e0_83cRYMOucmSn5yHtcod1Jn2ygCc,1143
|
|
7
|
-
fyers_apiv3/FyersWebsocket/map.json,sha256=
|
|
7
|
+
fyers_apiv3/FyersWebsocket/map.json,sha256=a3N3wgwWn49USqNVtGs-xI_0C1YzU8YFDIyEwWrmGvk,10075
|
|
8
8
|
fyers_apiv3/FyersWebsocket/order_ws.py,sha256=npLBtCcpPxclc5YRaVtLvBkRDCF3oV9NabK_y5EwoAk,16998
|
|
9
|
-
fyers_apiv3-3.1.
|
|
10
|
-
fyers_apiv3-3.1.
|
|
11
|
-
fyers_apiv3-3.1.
|
|
12
|
-
fyers_apiv3-3.1.
|
|
13
|
-
fyers_apiv3-3.1.
|
|
9
|
+
fyers_apiv3-3.1.3.dist-info/LICENSE.txt,sha256=_a5I4lWvSmoZQxwGSPGVVvUbuYby780N9YevsBqNY3k,1063
|
|
10
|
+
fyers_apiv3-3.1.3.dist-info/METADATA,sha256=sJpHtRvOsDLVx7t4-anTaNIBlD8U9P7a7VGUP21XObk,16279
|
|
11
|
+
fyers_apiv3-3.1.3.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
12
|
+
fyers_apiv3-3.1.3.dist-info/top_level.txt,sha256=IaT774gXqIM6uJpgCQPvXruJBOINsupO9oTe2ao6pkc,12
|
|
13
|
+
fyers_apiv3-3.1.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|