Issues in Zerodha_Tradehull codebase file

Hi,

there are some issues in codebase file for zerodha which I want to point out…

  1. for stock options ATM, ITM, OTM, get_atm, get_otm function it first check the step_value_dict dictionary, there are lot of mistakes in step value of stocks, few example (‘TRENT’: 20 >> 100, ‘BHARTIARTL’: 10 >> 20, ‘SBIN’: 5 >> 10, ‘MPHASIS’: 20 >> 50, )
  2. to overcome this issue I have written a function to get step value from insruments file but there are some stocks which step value are different (not in sequence) for exampl - (IOC, VEDL, HINDPETRO)
  3. get_fut_scripts, get_itm, get_otm, get_atm misses the future or options for SENSEX and BANKEX INDEX
  4. there is no step dictionary for MCX scripts
  5. tsl.market_over_close_all_order() dosent work
  6. there is no cancel_order in zerodha codebase, took it from kite.cancel_order
  7. need a margin requirement function,
  8. the code below is working code for margin requirement , we can add in the main file. Thanks…
def get_order_margin(self, tradingsymbol:str, exchange:str, quantity:int, transaction_type:str, product:str, order_type:str):
		try:
			order_params = [{
				"exchange": exchange,
				"tradingsymbol": tradingsymbol,
				"transaction_type": transaction_type,
				"variety": self.kite.VARIETY_REGULAR,
				"product": product,
				"order_type": order_type,
				"quantity": quantity
			}]

			margin_info = self.kite.order_margins(order_params)
			return margin_info
		except Exception as e:
			print("Error fetching order margin:", e)
			return None

Hi @Khaisar ,

Thanks for flagging these, we are currently updating our codebase we will make sure to check include these points as well.

1 Like