how to calculate net m2m of my intraday trade

palani_kmp
Hi,

I would like to know that how to calculate intraday "net m2m"?

ex: profit at reliance : 100
loss at SBI : -90
net m2m =10.
  • palani_kmp
    I am using below code and I am getting "two pnl" for two different stocks, I am not sure how to get difference for these "two pnl" to determine net profit.I also attached output screen for your knowledge

    import requests,time,json,sys
    def main():

    holding1 = requests.get("https://api.kite.trade/portfolio/positions/?api_key=myapi key&access_token=my token")
    holdjson =holding1.json()
    print(holdjson)
    ##hold1 = holdjson['data']['net'][0]['buy_pnl'] ##not sure ,its not working
    ##hold2 = holdjson['data']['net'][0]['sell_pnl'] ##not sure ,its not working
  • palani_kmp
    Hi, I found the way to to find two differnt stock pnl as per below code.please close my request.Thanks

    hold1 = holdjson['data']['net'][0]['pnl']
    hold2 = holdjson['data']['net'][1]['pnl']
This discussion has been closed.