How to get the pnl on current open trade

kamaralikhan
Hello,
During the day if i opened and closed the position on one Symbol (e.g IDBI).
Suppose i again open a position in IDBI, how do i get pnl of this latest trade.

Following is the IDBI net position which i get, (note that day position gives the same Json)


{"tradingsymbol":"IDBI","exchange":"NSE","instrument_token":377857,"product":"MIS","quantity":-350,
"overnight_quantity":0,"multiplier":1,"average_price":52.65,"close_price":0,"last_price":53.5,"value":18550,
"pnl":-175,"m2m":-175,"unrealised":-175,"realised":0,"buy_quantity":350,"buy_price":52.3,"buy_value":18305,
"buy_m2m":18305,"sell_quantity":700,"sell_price":52.65,"sell_value":36855,"sell_m2m":36855,"day_buy_quantity":350,
"day_buy_price":52.3,"day_buy_value":18305,"day_sell_quantity":700,
"day_sell_price":52.65,"day_sell_value":36855}

is there no way to find out the pnl on the latest trade ?

thanks
Kamarali



  • kamaralikhan
    file:///home/kamarali/Desktop/DeepinScreenshot_select-area_20181001161007.png

    I want to find the pnl on the position highlighted above. I dont find any way to identify it based on the json object for day or net.
  • sujith
    You need to look at orderbook to check this.
    You find the difference between the product of the average price and quantity of BUY and SELL order.
  • sujith
    It will be something like this,
    P&L = (average_price*quantity) of entry order - (average_price*quantity) of exit order.
  • kamaralikhan
    This will again give me the same pnl which is already in the json object of postion.
    A simple filed in pos would have sufficed. Now there is such a big overhead of coding to find out the pnl of last trade.
    I need to assume that the orders list i receive is in sequence. Hoping that is true assumption.
  • sujith
    A consolidated position is something we get from the OMS. That's the way it was designed. I am afraid we can't change that.
    In the above method, you can find the P&L of a particular order.
  • Venkat123
    what is the difference between pnl,m2m,unrealised

    If I had taken one position and closed it in loss of 1K
    And I ented again, There should be some factor like unrealised should give me ZERO 0 (just now I opened position)


    So, That I can easily know the new active PNL.

    So, PNL means total PNL
    Unrealised means : New PNL

    Why can't u implement in this way,
    Everybody will be happy.



    Unnecessarily 3 parameters for same value now
Sign In or Register to comment.