fyers-apiv3 3.1.1__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/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: 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,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 (==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
+ 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=zkedCA3UxiXcXKC64VHEMxMlDhlwGbtycDBPRrC6N28,38810
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
7
  fyers_apiv3/FyersWebsocket/map.json,sha256=vBImwLWTrCchKNtEvT5TECRHiwyjHjOSxWuVV9A01JQ,10026
8
8
  fyers_apiv3/FyersWebsocket/order_ws.py,sha256=npLBtCcpPxclc5YRaVtLvBkRDCF3oV9NabK_y5EwoAk,16998
9
- fyers_apiv3-3.1.1.dist-info/LICENSE.txt,sha256=_a5I4lWvSmoZQxwGSPGVVvUbuYby780N9YevsBqNY3k,1063
10
- fyers_apiv3-3.1.1.dist-info/METADATA,sha256=ene_5DlBnspe1mmCYArICfb-nSp5XdX_MrAKk6kjJL4,15262
11
- fyers_apiv3-3.1.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
12
- fyers_apiv3-3.1.1.dist-info/top_level.txt,sha256=IaT774gXqIM6uJpgCQPvXruJBOINsupO9oTe2ao6pkc,12
13
- fyers_apiv3-3.1.1.dist-info/RECORD,,
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,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.40.0)
2
+ Generator: setuptools (70.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5