AnandMC

About

Username
AnandMC
Joined
Visits
29
Last Active
Roles
Member

Activity

  • XS8910
    get_live_data() ---will return LTP for instrument.-- i Have customized it.
    October 2020
  • XS8910
    Hi Brother...
    df_curr_pos = pd.DataFrame(positions['net'])
    sell_trades = df_curr_pos.loc[(df_curr_pos['quantity'] <= 0) | (df_curr_pos['quantity'] > 0) & (df_curr_pos['tradingsymbol']).str.contains("NIFTY")]
    ####pnl = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);
    ####################################################
    symbol = sell_trades['tradingsymbol']
    sell_value = sell_trades['sell_value']
    buy_value = sell_trades['buy_value']
    multi = sell_trades['multiplier']
    qty = sell_trades['quantity']
    #print(positions)
    k =0
    mtm_sum = 0
    for i in symbol :
    lp = get_live_data(i,ins_type)
    pnl = (sell_value[k]- buy_value[k]) + (qty[k] * lp * multi[k])
    mtm_sum = mtm_sum + pnl
    k = k+1
    print(mtm_sum)
    October 2020
  • XS8910
    HI Brother this is not working as expected to calculate MTM...can you hep me.
    October 2020