For alert on the profit of Rs.2000, this trigger should work -
(LastTradedPrice('NFO:NIFTY21JUL16700CE') + LastTradedPrice('NFO:NIFTY21JUL14900PE') + (79.55 - LastTradedPrice('NFO:NIFTY21JUL15200PE')) + (57.8 - LastTradedPrice('NFO:NIFTY21JUL16400CE'))) > 105.1
For alert on the loss of Rs.2000, this trigger should work -
(LastTradedPrice('NFO:NIFTY21JUL16700CE') + LastTradedPrice('NFO:NIFTY21JUL14900PE') + (79.55 - LastTradedPrice('NFO:NIFTY21JUL15200PE')) + (57.8 - LastTradedPrice('NFO:NIFTY21JUL16400CE'))) < 25.1
- I have assumed you want to track the profit and loss from the starting values that you shared
- The Rs.2000 movement translates to 40 points as the lot size is 50.
- For options that have been bought, I have added their premiums (22.15 + 42.95 = 65.1).
- Adding the last traded price for the options that have been bought
- For options that have been sold, Individually subtracting their last trading price from their initial premium
- Then, I have added all the values from Point (4) and Point (5)
- For the profit calculation, I have added the sum of premiums of bought options (aka Point 3) & Point (2) and then checked if 105.1 ( (22.15 + 42.95) + 40 ) is less than the value of Point (6)
- For the loss calculation, I have subtracted the value of Point (2) from the sum of premiums of bought options (aka Point 3) and then checked if 25.1 ( (22.15 + 42.95) - 40 ) is greater than the value of Point (6)
For the method to find the trade symbols for a particular contract, refer to this thread