sorry , the cnc_limit function , i did not edit it correctly . I removed the order code from the function and executed it separately . It worked , Don't know why the same code does not work when used in a funtion.
Beacuse you have a pass statement in the except block.
KiteConnect was throwing exception because of invalid variety(upper-case),but the program just ignored it.
However,first of all,your function name is limit_order but you are calling CNC_limit_order.
Second,you are sending variety in upper-case,which should be small-case .
https://kite.trade/docs/connect/v3/orders/#glossary-of-constants
KiteConnect was throwing exception because of invalid variety(upper-case),but the program just ignored it.