Forum

How to Calculate Pr...
 
Notifications
Clear all

How to Calculate Profit & loss with Nested If or with any other function

2 Posts
2 Users
0 Reactions
169 Views
(@chakkrav)
Posts: 3
Active Member
Topic starter
 

Problem Statement / Requirement: How to calculate Options Positions Profit & loss :

If B/S = "BUY" and BS_Avg_Trade_CL_Price > BS_Avg_Trade_OP_Price then (BS_Avg_Trade_OP_Price - BS_Avg_Trade_CL_Price])*Total_Qty 
else (BS_Avg_Trade_OP_Price-BS_Avg_Trade_CL_Price)*Total_Qty and vice versa If B/S = "SELL" 

PQ_PNL.PNG

Expected PNL Values:

PQ_PNL_ExpectedValues.PNG

Really appreciate expert advise on the approach & solution 🙂

 
Posted : 04/11/2020 6:02 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Ravikiran,

Based on your expected values, you don't need to check if it's a buy or sell, it's a simple formula taking the closing prices minus the opening price x quantity.

See example attached.

Mynda

 
Posted : 04/11/2020 11:01 pm
Share: