Need a sample code snippet for implementing trailing stop loss using Py Kite Connect v3

khanshahbaz786
Hi Folks,

Trading is always challenging for retail investors. Look at one such scenario where BO have been blocked from past 9 months. I almost check daily to see this message on the bulletin board

"Bracket orders have been blocked due to expected volatility for Equity, F&O, and CDS. It will be allowed once volatility subsides"

BO allowed retail traders to trade more volume and allowed for higher profits (even at a smaller percentage move). Nevertheless. One peculiarity of BO was trailing stop loss feature, where if the price of the traded instrument moved in the traders direction, the trigger price for booking profit keeps on advancing thereby giving traders an opportunity to capture a sudden and unprecedented move.

Can someone share their python code snippet if they have implemented this trailing stop loss feature? I am assuming many retail traders are using cover order in absence of bracket orders. If we can add the trailing stop loss feature to cover order then it becomes bracket order but with more margin (sad but has to be accepted).

P.S: Not criticizing increased margin requirements and I know there is a separate thread (https://tradingqna.com/t/new-margin-framework-is-here-to-benefit-hedged-positions/70652). Just wondering how we could modify CO and leverage the platform and technology to get the same benefits as of BO(obviously with increased margin).

Thanks in advance!

Sign In or Register to comment.