fyers-apiv3 3.1.1__tar.gz → 3.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: fyers-apiv3
3
- Version: 3.1.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,6 +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==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
13
18
 
14
19
  # The Fyers API Python client - v3
15
20
 
@@ -150,6 +155,7 @@ print(fyers.positions()) ## This will provide the user with all the positions
150
155
  There are two ways to place order
151
156
  a. single order : wherein you can fire one order at a time
152
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
153
159
  """
154
160
 
155
161
  ## SINGLE ORDER
@@ -203,6 +209,41 @@ data = [{ "symbol":"NSE:SBIN-EQ",
203
209
 
204
210
  print(fyers.place_basket_orders(data))
205
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
+
206
247
 
207
248
  ###################################################################################################################
208
249
 
@@ -1,16 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: fyers_apiv3
3
- Version: 3.1.1
4
- Summary: Fyers trading APIs.
5
- Home-page: https://github.com/FyersDev/fyers-api-py
6
- Author: Fyers-Tech
7
- Author-email: support@fyers.in
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE.txt
13
-
14
1
  # The Fyers API Python client - v3
15
2
 
16
3
  The official Python client for communicating with the [Fyers API](https://myapi.fyers.in)
@@ -150,6 +137,7 @@ print(fyers.positions()) ## This will provide the user with all the positions
150
137
  There are two ways to place order
151
138
  a. single order : wherein you can fire one order at a time
152
139
  b. multi order : this is used to place a basket of order but the basket size can max be 10 symbols
140
+ c. multileg order : this is used to place a multileg order but the legs size minimum is 2 and maximum is 3
153
141
  """
154
142
 
155
143
  ## SINGLE ORDER
@@ -203,6 +191,41 @@ data = [{ "symbol":"NSE:SBIN-EQ",
203
191
 
204
192
  print(fyers.place_basket_orders(data))
205
193
 
194
+ ## MULTILEG ORDER
195
+
196
+ data = {
197
+ "orderTag": "tag1",
198
+ "productType": "MARGIN",
199
+ "offlineOrder": False,
200
+ "orderType": "3L",
201
+ "validity": "IOC",
202
+ "legs": {
203
+ "leg1": {
204
+ "symbol": "NSE:SBIN24JUNFUT",
205
+ "qty": 750,
206
+ "side": 1,
207
+ "type": 1,
208
+ "limitPrice": 800
209
+ },
210
+ "leg2": {
211
+ "symbol": "NSE:SBIN24JULFUT",
212
+ "qty": 750,
213
+ "side": 1,
214
+ "type": 1,
215
+ "limitPrice": 800
216
+ },
217
+ "leg3": {
218
+ "symbol": "NSE:SBIN24JUN900CE",
219
+ "qty": 750,
220
+ "side": 1,
221
+ "type": 1,
222
+ "limitPrice": 3
223
+ }
224
+ }
225
+ } ### 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
226
+
227
+ print(fyers.place_multileg_order(data))
228
+
206
229
 
207
230
  ###################################################################################################################
208
231
 
@@ -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,3 +1,21 @@
1
+ Metadata-Version: 2.1
2
+ Name: fyers_apiv3
3
+ Version: 3.1.2
4
+ Summary: Fyers trading APIs.
5
+ Home-page: https://github.com/FyersDev/fyers-api-py
6
+ Author: Fyers-Tech
7
+ Author-email: support@fyers.in
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE.txt
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
+
1
19
  # The Fyers API Python client - v3
2
20
 
3
21
  The official Python client for communicating with the [Fyers API](https://myapi.fyers.in)
@@ -137,6 +155,7 @@ print(fyers.positions()) ## This will provide the user with all the positions
137
155
  There are two ways to place order
138
156
  a. single order : wherein you can fire one order at a time
139
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
140
159
  """
141
160
 
142
161
  ## SINGLE ORDER
@@ -190,6 +209,41 @@ data = [{ "symbol":"NSE:SBIN-EQ",
190
209
 
191
210
  print(fyers.place_basket_orders(data))
192
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
+
193
247
 
194
248
  ###################################################################################################################
195
249
 
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name='fyers_apiv3',
8
- version='3.1.1',
8
+ version='3.1.2',
9
9
  author="Fyers-Tech",
10
10
  author_email="support@fyers.in",
11
11
  description="Fyers trading APIs.",
@@ -14,7 +14,7 @@ setuptools.setup(
14
14
  url="https://github.com/FyersDev/fyers-api-py",
15
15
  packages=setuptools.find_packages(),
16
16
  package_data={
17
- 'fyers_apiv3': ['/home/vinay/Documents/repo/fyers-api-py/fyers_apiv3/FyersWebsocket/map.json']
17
+ 'fyers_apiv3': ['/Users/em743/Desktop/codebase/fyers-api-py/fyers_apiv3/FyersWebsocket/map.json']
18
18
  },
19
19
  include_package_data=True,
20
20
  install_requires=[
File without changes
File without changes