Hi, I am looking for python coding solution for when there is change in formula based excel cell (in Quantity), than buy / sell triggers. Please note, Changes happens in same cell. For example, here in "C2" i.e. in Quantity Exchange Symbol Quantity Price Transaction Type NSE IDEA 1 1 buy
I have try to write below codes for the same, but unable to get solution for the same. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> firstrun = None while True: try: # df = pd.read_excel ("filepath") # Update with your file path
# Keep track of previous values previous_values = {}
# Iterate through each row in the DataFrame and send orders for index, row in df.iterrows(): # Extract order details from the Excel row symbol = row['Symbol'] exchange = row['Exchange'] price = (row['Price']) quantity_formula = str(row['Quantity']) transaction_type_formula = (row['Transaction Type'])
# Check if there is a change in quantity or transaction type
if firstrun == None or (symbol in previous_values and \ (quantity != previous_values[symbol]['quantity'] or transaction_type != previous_values[symbol]['Transaction Type'])):