Compute pnl before closing the trade in FNO

Prape
How do I place a cover order for FNO by computing the profit? E.g. I have a Strangle who has started making a loss. But I want to keep a Stop Loss on this. How do I compute this? What is the latest price that I can use? I used the 'last price' and 'depth.buy.get(4).getPrice()', both of which are giving me a wrong results. I compute the formula as below:

Loss= (75*((mktPricePE + mktPriceCE) - (tradePricePE + tradePriceCE)));

where mktPriceCE=(quotes2.get("NFO:"+CE).depth.buy.get(4).getPrice())

mktPricePE=(quotes2.get("NFO:"+PE).depth.buy.get(4).getPrice())

tradePriceCE = (orders1.get(i2).averagePrice+"")

tradePricePE = (orders1.get(i2).averagePrice+"")

Please help.
Sign In or Register to comment.