I use only BO orders. When I reached a profitable position, I want to modify the SL limit price of all the orders to a few ticks away from the LTP, so that I can secure the profitable position. TSL is not useful for this purpose. Since I used to took more trades it is hectic to do it manually. Is there any way to place modifyBOSL of all pending orders at a price few ticks away from the LTP. Thanks in advance.
The best way to do this, virtually trail your mtm in excel and when your PnL crosses below your trailmtm, then call ExitBO to close your BO position.
But if still want to modify all SL order, then you can use the below code;
'This is generic example to modify all BO stoploss at certain % from Ltp
'Modify your code to suit your requirements
'Make sure you are not calling this function in a loop
'Use static variables to restrict multiple calling of this function