In my python code, I am finding it challenging to close a position during a crash and there is a sudden Gap Down. Limit Order is failing as the LTP is going below Limit Price very rapidly. Because of this, I lose all my profits covered using trailing SL and incurring losses more than the estimated risk.
Currently, I am catching the exception and retrying. Also, tried Market Depth bid price to set as Limit Price. That too has less impact.
Request your suggestion, if you folks faced this issue before.