quantplay 2.0.133__tar.gz → 2.0.136__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.
- {quantplay-2.0.133 → quantplay-2.0.136}/PKG-INFO +1 -1
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/icici_direct.py +29 -14
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay.egg-info/PKG-INFO +1 -1
- {quantplay-2.0.133 → quantplay-2.0.136}/setup.py +1 -1
- {quantplay-2.0.133 → quantplay-2.0.136}/README.md +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/pyproject.toml +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/aliceblue.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/angelone.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/auto_login/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/auto_login/aliceblue.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/broker_factory.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/dhan.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/finvasia_utils/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/finvasia_utils/fa_noren.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/five_paisa.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/flattrade.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/ft_utils/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/ft_utils/flattrade_utils.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/ft_utils/ft_noren.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/generics/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/generics/broker.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/iifl_xts.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/jainam_xts.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/kite_utils.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/kotak.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/motilal.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/noren.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/shoonya.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/uplink/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/uplink/uplink_utils.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/upstox.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/xts.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/xts_utils/Connect.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/xts_utils/Exception.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/xts_utils/InteractiveSocketClient.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/xts_utils/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/zerodha.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/exception/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/exception/exceptions.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/model/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/model/broker.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/model/broker_response.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/model/generics.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/model/instrument_data.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/model/order_event.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/py.typed +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/utils/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/utils/caching.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/utils/constant.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/utils/exchange.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/utils/number_utils.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/utils/pickle_utils.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/utils/selenium_utils.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/wrapper/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay/wrapper/aws/s3.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay.egg-info/SOURCES.txt +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay.egg-info/dependency_links.txt +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay.egg-info/requires.txt +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/quantplay.egg-info/top_level.txt +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/setup.cfg +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/tests/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/tests/conftest.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/tests/wrapper/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/tests/wrapper/aws/__init__.py +0 -0
- {quantplay-2.0.133 → quantplay-2.0.136}/tests/wrapper/aws/s3_test.py +0 -0
|
@@ -54,7 +54,7 @@ class ICICI(Broker):
|
|
|
54
54
|
load_instrument: bool = True,
|
|
55
55
|
) -> None:
|
|
56
56
|
if api_key and api_secret and session_token:
|
|
57
|
-
self.wrapper = BreezeConnect(api_key)
|
|
57
|
+
self.wrapper = BreezeConnect(api_key) # type:ignore
|
|
58
58
|
self.wrapper.generate_session(api_secret, session_token) # type: ignore
|
|
59
59
|
|
|
60
60
|
if load_instrument:
|
|
@@ -143,7 +143,7 @@ class ICICI(Broker):
|
|
|
143
143
|
"exchange_code": "exchange",
|
|
144
144
|
"expiry_date": "expiry",
|
|
145
145
|
"strike_price": "strike",
|
|
146
|
-
"user_remark"
|
|
146
|
+
"user_remark": "tag",
|
|
147
147
|
}
|
|
148
148
|
)
|
|
149
149
|
orders_df = orders_df.with_columns(
|
|
@@ -196,8 +196,17 @@ class ICICI(Broker):
|
|
|
196
196
|
pl.lit(None).alias("status_message_raw"),
|
|
197
197
|
pl.col("order_timestamp").alias("update_timestamp"),
|
|
198
198
|
)
|
|
199
|
+
orders_df = orders_df[list(self.orders_schema.keys())].cast(self.orders_schema)
|
|
200
|
+
orders_df = orders_df.with_columns(
|
|
201
|
+
pl.when(pl.col("status") == "EXECUTED")
|
|
202
|
+
.then(pl.lit("COMPLETE"))
|
|
203
|
+
.when(pl.col("status") == "ORDERED")
|
|
204
|
+
.then(pl.lit("OPEN"))
|
|
205
|
+
.otherwise(pl.col("status"))
|
|
206
|
+
.alias("status")
|
|
207
|
+
)
|
|
199
208
|
|
|
200
|
-
return orders_df
|
|
209
|
+
return orders_df
|
|
201
210
|
|
|
202
211
|
def positions(self, drop_cnc: bool = True) -> pl.DataFrame:
|
|
203
212
|
to_date = datetime.now().isoformat()[:19] + ".000Z"
|
|
@@ -229,6 +238,12 @@ class ICICI(Broker):
|
|
|
229
238
|
.when(pl.col("right") == "Put")
|
|
230
239
|
.then(pl.lit("PE"))
|
|
231
240
|
.alias("instrument_type"),
|
|
241
|
+
(
|
|
242
|
+
pl.col("unrealized_profit").cast(pl.Float32)
|
|
243
|
+
+ pl.col("realized_profit").cast(pl.Float32)
|
|
244
|
+
).alias("pnl"),
|
|
245
|
+
pl.col("quantity").cast(pl.Int32).alias("quantity"),
|
|
246
|
+
pl.col("average_price").cast(pl.Float32).alias("average_price")
|
|
232
247
|
)
|
|
233
248
|
|
|
234
249
|
positions_df = positions_df.with_columns(
|
|
@@ -255,17 +270,17 @@ class ICICI(Broker):
|
|
|
255
270
|
)
|
|
256
271
|
|
|
257
272
|
positions_df = positions_df.with_columns(
|
|
258
|
-
pl.
|
|
259
|
-
pl.lit(0).alias("
|
|
273
|
+
pl.when(pl.col("quantity") < 0)
|
|
274
|
+
.then(pl.col("quantity").abs()*pl.col("average_price")).otherwise(pl.lit(0)).alias("sell_value"),
|
|
275
|
+
pl.when(pl.col("quantity") > 0)
|
|
276
|
+
.then(pl.col("quantity").abs() * pl.col("average_price")).otherwise(pl.lit(0)).alias("buy_value"),
|
|
260
277
|
pl.lit(0).alias("ltp"),
|
|
261
|
-
pl.
|
|
278
|
+
pl.when(pl.col("quantity") < 0)
|
|
279
|
+
.then(pl.col("quantity").abs()).otherwise(pl.lit(0)).alias("sell_quantity"),
|
|
280
|
+
pl.when(pl.col("quantity") > 0)
|
|
281
|
+
.then(pl.col("quantity").abs()).otherwise(pl.lit(0)).alias("buy_quantity"),
|
|
262
282
|
pl.lit("NRML").alias("product"),
|
|
263
|
-
pl.lit(0).alias("buy_quantity"),
|
|
264
283
|
pl.col("instrument_type").alias("option_type"),
|
|
265
|
-
(
|
|
266
|
-
pl.col("unrealized_profit").cast(pl.Float32)
|
|
267
|
-
+ pl.col("realized_profit").cast(pl.Float32)
|
|
268
|
-
).alias("pnl"),
|
|
269
284
|
)
|
|
270
285
|
return positions_df[list(self.positions_schema.keys())].cast(
|
|
271
286
|
self.positions_schema
|
|
@@ -307,7 +322,7 @@ class ICICI(Broker):
|
|
|
307
322
|
quantity=str(quantity),
|
|
308
323
|
price=str(price),
|
|
309
324
|
validity="day",
|
|
310
|
-
user_remark=tag
|
|
325
|
+
user_remark=tag,
|
|
311
326
|
)
|
|
312
327
|
else:
|
|
313
328
|
response = self.wrapper.place_order(
|
|
@@ -323,7 +338,7 @@ class ICICI(Broker):
|
|
|
323
338
|
expiry_date=str(symbol_data["expiry"]) + "T06:00:00.000Z",
|
|
324
339
|
right=self.get_right(symbol_data),
|
|
325
340
|
strike_price=str(symbol_data["strike"]),
|
|
326
|
-
user_remark=tag
|
|
341
|
+
user_remark=tag,
|
|
327
342
|
)
|
|
328
343
|
return response["Success"]["order_id"]
|
|
329
344
|
|
|
@@ -373,7 +388,7 @@ class ICICI(Broker):
|
|
|
373
388
|
}
|
|
374
389
|
|
|
375
390
|
def get_exchange(self, exchange: ExchangeType) -> ...:
|
|
376
|
-
return
|
|
391
|
+
return exchange
|
|
377
392
|
|
|
378
393
|
def get_product(self, product: ProductType) -> ...:
|
|
379
394
|
return
|
|
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
|
|
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
|
|
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
|
{quantplay-2.0.133 → quantplay-2.0.136}/quantplay/broker/xts_utils/InteractiveSocketClient.py
RENAMED
|
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
|
|
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
|
|
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
|