fyers-apiv3 3.1.0__py3-none-any.whl → 3.1.2__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/data_ws.py +1 -2
- fyers_apiv3/FyersWebsocket/order_ws.py +1 -0
- fyers_apiv3/fyersModel.py +28 -0
- {fyers_apiv3-3.1.0.dist-info → fyers_apiv3-3.1.2.dist-info}/METADATA +43 -7
- fyers_apiv3-3.1.2.dist-info/RECORD +13 -0
- {fyers_apiv3-3.1.0.dist-info → fyers_apiv3-3.1.2.dist-info}/WHEEL +1 -1
- fyers_apiv3-3.1.0.dist-info/RECORD +0 -13
- {fyers_apiv3-3.1.0.dist-info → fyers_apiv3-3.1.2.dist-info}/LICENSE.txt +0 -0
- {fyers_apiv3-3.1.0.dist-info → fyers_apiv3-3.1.2.dist-info}/top_level.txt +0 -0
|
@@ -115,7 +115,6 @@ class SymbolConversion:
|
|
|
115
115
|
datadict[hsm_symbol] = symbol
|
|
116
116
|
if response_data["invalidSymbol"]:
|
|
117
117
|
wrong_symbol = response_data["invalidSymbol"]
|
|
118
|
-
# print("datadict",datadict)
|
|
119
118
|
return (datadict, wrong_symbol, dp_index_flag,"")
|
|
120
119
|
|
|
121
120
|
elif response_data['s'] == "error":
|
|
@@ -1499,6 +1498,7 @@ class FyersDataSocket:
|
|
|
1499
1498
|
"""
|
|
1500
1499
|
if self.OnError is not None:
|
|
1501
1500
|
self.OnError(message)
|
|
1501
|
+
self.data_logger.error(message)
|
|
1502
1502
|
else:
|
|
1503
1503
|
if self.write_to_file:
|
|
1504
1504
|
self.data_logger.debug(f"ERROR Response:{message}")
|
|
@@ -1576,7 +1576,6 @@ class FyersDataSocket:
|
|
|
1576
1576
|
self.add_message(message)
|
|
1577
1577
|
self.reconnect_attempts = 0
|
|
1578
1578
|
self.reconnect_delay = 0
|
|
1579
|
-
print(self.reconnect_attempts,self.reconnect_delay )
|
|
1580
1579
|
if self.lite:
|
|
1581
1580
|
message = self.__lite_mode_msg()
|
|
1582
1581
|
# self.message.append(message)
|
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,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 3.1.
|
|
2
|
+
Name: fyers_apiv3
|
|
3
|
+
Version: 3.1.2
|
|
4
4
|
Summary: Fyers trading APIs.
|
|
5
5
|
Home-page: https://github.com/FyersDev/fyers-api-py
|
|
6
6
|
Author: Fyers-Tech
|
|
@@ -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
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
fyers_apiv3/__init__.py,sha256=1vA_F8dAtLKcyOqrmdUOkw1Syl8gIFUtxDoLde8y94E,18
|
|
2
|
+
fyers_apiv3/fyersModel.py,sha256=yfNp2vHexQtF0YRIv8bVN_fab864HLiYbT3oyc1TXpU,40332
|
|
3
|
+
fyers_apiv3/fyers_logger.py,sha256=S_WiIwBLytQ_tyHd9bUC8gZo7GHpANCJO0CS6rCJE90,3795
|
|
4
|
+
fyers_apiv3/FyersWebsocket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
fyers_apiv3/FyersWebsocket/data_ws.py,sha256=fSNfsUB_I5-MkWX4hQZvklRQhuQ9n3w5hMDRFrMaBE8,68105
|
|
6
|
+
fyers_apiv3/FyersWebsocket/defines.py,sha256=mhKkkQ6FZHFa6e0_83cRYMOucmSn5yHtcod1Jn2ygCc,1143
|
|
7
|
+
fyers_apiv3/FyersWebsocket/map.json,sha256=vBImwLWTrCchKNtEvT5TECRHiwyjHjOSxWuVV9A01JQ,10026
|
|
8
|
+
fyers_apiv3/FyersWebsocket/order_ws.py,sha256=npLBtCcpPxclc5YRaVtLvBkRDCF3oV9NabK_y5EwoAk,16998
|
|
9
|
+
fyers_apiv3-3.1.2.dist-info/LICENSE.txt,sha256=_a5I4lWvSmoZQxwGSPGVVvUbuYby780N9YevsBqNY3k,1063
|
|
10
|
+
fyers_apiv3-3.1.2.dist-info/METADATA,sha256=9mPxgRKjNx8eemnQ5t0eWb0h0heUmkgpRHUDNVOn0u0,16245
|
|
11
|
+
fyers_apiv3-3.1.2.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
|
12
|
+
fyers_apiv3-3.1.2.dist-info/top_level.txt,sha256=IaT774gXqIM6uJpgCQPvXruJBOINsupO9oTe2ao6pkc,12
|
|
13
|
+
fyers_apiv3-3.1.2.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
fyers_apiv3/__init__.py,sha256=1vA_F8dAtLKcyOqrmdUOkw1Syl8gIFUtxDoLde8y94E,18
|
|
2
|
-
fyers_apiv3/fyersModel.py,sha256=zkedCA3UxiXcXKC64VHEMxMlDhlwGbtycDBPRrC6N28,38810
|
|
3
|
-
fyers_apiv3/fyers_logger.py,sha256=S_WiIwBLytQ_tyHd9bUC8gZo7GHpANCJO0CS6rCJE90,3795
|
|
4
|
-
fyers_apiv3/FyersWebsocket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
fyers_apiv3/FyersWebsocket/data_ws.py,sha256=hgjdKvjN8Ltk3mBohUzbTw3r3hJUDQ-0jBtsJ3QEFMQ,68171
|
|
6
|
-
fyers_apiv3/FyersWebsocket/defines.py,sha256=mhKkkQ6FZHFa6e0_83cRYMOucmSn5yHtcod1Jn2ygCc,1143
|
|
7
|
-
fyers_apiv3/FyersWebsocket/map.json,sha256=vBImwLWTrCchKNtEvT5TECRHiwyjHjOSxWuVV9A01JQ,10026
|
|
8
|
-
fyers_apiv3/FyersWebsocket/order_ws.py,sha256=l8Gp0RhFepK0mpL3OE67HDveDA_MJNICRn5IjAKTZFE,16953
|
|
9
|
-
fyers_apiv3-3.1.0.dist-info/LICENSE.txt,sha256=_a5I4lWvSmoZQxwGSPGVVvUbuYby780N9YevsBqNY3k,1063
|
|
10
|
-
fyers_apiv3-3.1.0.dist-info/METADATA,sha256=555vaaMt-g6TdG4-r8jsh9GqeMp4nnHAfyjBculH15I,15262
|
|
11
|
-
fyers_apiv3-3.1.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
12
|
-
fyers_apiv3-3.1.0.dist-info/top_level.txt,sha256=IaT774gXqIM6uJpgCQPvXruJBOINsupO9oTe2ao6pkc,12
|
|
13
|
-
fyers_apiv3-3.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|