It looks like you're new here. If you want to get involved, click one of these buttons!
Nifty_Max_Qty_Per_Order = 1800
End_Time = datetime.now().replace(hour=15, minute=15, second=10)
def Condn_Check_Shift():
.....
.....
.....
def NS_PlaceSellOrder(symbolName, qty1):
loop = int(qty1 / Nifty_Max_Qty_Per_Order)
remainder = qty1 % Nifty_Max_Qty_Per_Order
run = 0
threads = []
def place_order(quantity):
kite.place_order(tradingsymbol=symbolName, exchange=kite.EXCHANGE_NFO, transaction_type=kite.TRANSACTION_TYPE_SELL, quantity=quantity, order_type=kite.ORDER_TYPE_MARKET, product=kite.PRODUCT_MIS, variety=kite.VARIETY_REGULAR)
if loop > 0:
while run < loop:
thread = threading.Thread(target=place_order, args=(Nifty_Max_Qty_Per_Order,))
threads.append(thread)
thread.start()
run += 1
if remainder != 0:
thread = threading.Thread(target=place_order, args=(remainder,))
threads.append(thread)
thread.start()
else:
thread = threading.Thread(target=place_order, args=(qty1,))
threads.append(thread)
thread.start()
# Wait for all threads to finish
for thread in threads:
thread.join()
print(f"Nifty sell {symbolName} {qty1} qty {datetime.now().isoformat(' ', 'seconds')}")
NS_PlaceSellOrder('NIFTY2580724500CE', 1500)
NS_PlaceSellOrder('NIFTY2580724500PE', 1500)
.....
.....
.....
while datetime.now() < End_Time:
Condn_Check_Shift()
sleep(1)
API secret - RECEIVED
REQUEST TOKEN - RECEIVED
Access Token - Not recived