quantplay 1.2.95__tar.gz → 1.2.97__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-1.2.95 → quantplay-1.2.97}/PKG-INFO +1 -1
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/xts.py +2 -4
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/services/tradelens.py +21 -16
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay.egg-info/PKG-INFO +1 -1
- {quantplay-1.2.95 → quantplay-1.2.97}/setup.py +1 -1
- {quantplay-1.2.95 → quantplay-1.2.97}/README.md +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/backtest/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/backtest/backtest_trades.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/angelone.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/broker_client.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/client.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/finvasia_utils/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/finvasia_utils/shoonya.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/generics/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/generics/broker.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/iifl.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/iifl_xts.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/kite_utils.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/motilal.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/shoonya.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/symphony.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/xts_utils/Connect.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/xts_utils/Exception.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/xts_utils/InteractiveSocketClient.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/xts_utils/MarketDataSocketClient.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/xts_utils/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/broker/zerodha.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/brokerage/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/brokerage/angelone/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/brokerage/angelone/angel_broker.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/brokerage/generics/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/brokerage/generics/broker.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/brokerage/zerodha/ZBroker.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/brokerage/zerodha/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/config/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/config/qplay_config.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/create_sample_data.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/data_modify_script.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/date_fix.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/exception/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/exception/exceptions.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/executor/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/executor/strategy_executor.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/indicators/Indicator.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/indicators/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/indicators/atr.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/model/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/model/exchange/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/model/exchange/instrument.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/model/exchange/order.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/model/exchange/tick.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/model/strategy/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/model/strategy/strategy_response.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/oms/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/order_execution/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/order_execution/execution_algorithm.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/order_execution/mean_price.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/reporting/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/reporting/strategy_report.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/reporting/visuals.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/service.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/services/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/services/market.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/equities/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/equities/intraday/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/equities/overnight/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/futures/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/futures/overnight/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/options/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/options/intraday/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/options/intraday/ladder.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/options/intraday/musk.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/options/intraday/short_straddle.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategy/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategy/base.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategy_run.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/config_util.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/constant.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/data_utils.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/exchange.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/number_utils.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/pickle_utils.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/selenium_utils.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay/utils/transaction_utils.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay.egg-info/SOURCES.txt +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay.egg-info/dependency_links.txt +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay.egg-info/requires.txt +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/quantplay.egg-info/top_level.txt +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/setup.cfg +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/broker/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/broker/finvasia.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/executor/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/executor/strategy_executor.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/strategy/__init__.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/strategy/base.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/strategy/sample_strategy.py +0 -0
- {quantplay-1.2.95 → quantplay-1.2.97}/test/test_motilal.py +0 -0
|
@@ -106,12 +106,10 @@ class XTS(Broker):
|
|
|
106
106
|
|
|
107
107
|
self.symbol_data["{}:{}".format(exchange, tradingsymbol)] = instrument
|
|
108
108
|
|
|
109
|
-
|
|
110
109
|
PickleUtils.save_data(self.symbol_data, "xts_instruments")
|
|
111
110
|
Constants.logger.info("[LOADING_INSTRUMENTS] loading data from server")
|
|
112
111
|
self.initialize_broker_symbol_map()
|
|
113
112
|
|
|
114
|
-
|
|
115
113
|
def login(self):
|
|
116
114
|
response_interact = self.wrapper.interactive_login()
|
|
117
115
|
self.wrapper.marketdata_login()
|
|
@@ -521,8 +519,8 @@ class XTS(Broker):
|
|
|
521
519
|
new_ord = {}
|
|
522
520
|
|
|
523
521
|
try:
|
|
524
|
-
new_ord["placed_by"] = order["
|
|
525
|
-
new_ord["tag"] = order["
|
|
522
|
+
new_ord["placed_by"] = order["ClientID"]
|
|
523
|
+
new_ord["tag"] = order["ClientID"]
|
|
526
524
|
new_ord["order_id"] = order["AppOrderID"]
|
|
527
525
|
new_ord["exchange_order_id"] = order["ExchangeOrderID"]
|
|
528
526
|
new_ord["exchange"] = order["ExchangeSegment"]
|
|
@@ -210,34 +210,39 @@ class TradeLens:
|
|
|
210
210
|
try:
|
|
211
211
|
alpha_bucket_name = "{}_bucket".format(alpha_name)
|
|
212
212
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
day_candles.loc[:, 'liquidity'] = day_candles.volume*day_candles.close
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
day_candles.loc[:, 'liquidity_20'] = day_candles.groupby('symbol')['liquidity'].transform(
|
|
217
|
+
lambda x: x.rolling(20).mean())
|
|
218
|
+
|
|
219
|
+
day_candles.loc[:, "liquidity_rank"] = day_candles.groupby("date")[
|
|
220
|
+
"liquidity_20"
|
|
216
221
|
].rank(ascending=False)
|
|
217
222
|
|
|
218
|
-
|
|
219
|
-
(
|
|
223
|
+
day_candles.loc[:, "is_top500"] = np.where(
|
|
224
|
+
(day_candles["liquidity_rank"] <= 500), True, False
|
|
220
225
|
)
|
|
221
226
|
|
|
222
|
-
|
|
227
|
+
day_candles.loc[:, "intraday_return"] = (
|
|
223
228
|
day_candles.close / day_candles.open - 1
|
|
224
229
|
)
|
|
225
|
-
|
|
230
|
+
day_candles.loc[
|
|
226
231
|
:, "next_day_intraday_return"
|
|
227
|
-
] =
|
|
232
|
+
] = day_candles.intraday_return.shift(-1)
|
|
228
233
|
|
|
229
|
-
|
|
234
|
+
day_candles.loc[:, alpha_bucket_name] = 1 + 10 * day_candles.groupby(
|
|
230
235
|
["is_top500", "date"]
|
|
231
236
|
)[alpha_name].rank(method="first", pct=True)
|
|
232
237
|
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
day_candles.loc[:, alpha_bucket_name] = np.where(
|
|
239
|
+
day_candles["is_top500"] == False,
|
|
235
240
|
np.nan,
|
|
236
|
-
|
|
241
|
+
day_candles[alpha_bucket_name],
|
|
237
242
|
)
|
|
238
243
|
|
|
239
|
-
|
|
240
|
-
|
|
244
|
+
day_candles.loc[:, alpha_bucket_name] = (
|
|
245
|
+
day_candles[alpha_bucket_name]
|
|
241
246
|
.replace([np.inf, -np.inf, np.nan], 0)
|
|
242
247
|
.astype(int)
|
|
243
248
|
.replace([0], np.nan)
|
|
@@ -246,14 +251,14 @@ class TradeLens:
|
|
|
246
251
|
|
|
247
252
|
# plotting
|
|
248
253
|
t_df = (
|
|
249
|
-
|
|
254
|
+
day_candles.groupby(alpha_bucket_name)
|
|
250
255
|
.next_day_intraday_return.mean()
|
|
251
256
|
.reset_index()
|
|
252
257
|
)
|
|
253
258
|
|
|
254
259
|
plt.clf()
|
|
255
260
|
plt.title(f"{alpha_name} intraday return analysis")
|
|
256
|
-
plt.bar(t_df[alpha_bucket_name],
|
|
261
|
+
plt.bar(t_df[alpha_bucket_name],
|
|
257
262
|
t_df.next_day_intraday_return)
|
|
258
263
|
plt.show()
|
|
259
264
|
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{quantplay-1.2.95 → quantplay-1.2.97}/quantplay/strategies/options/intraday/short_straddle.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
|