Capture the “Margin available” value i.e net CASH available

jkoracle23
jkoracle23 edited April 2019 in Java client
Hello,
My code to calculate available cash is :
Float.parseFloat(kc.getMargins("equity").available.cash)

My aim is capture the “Margin available” value i.e net CASH available (in other words the hard cash in my hand to do CNC buy orders) in my account for CNC trading (after certain point of time during day) ..In the screenshot the value is 3840.90. This value I want to capture while placing intraday or CNC buy orders.

I started with intraday with value in “Margin available” field as around 5000.
When I used above code, I got available cash value as 9546.25015258789 at some point of time .

I would like to know why.
I need to calculate FINAL CASH amount using which I could do CNC trading in between Intraday trading.
Help in this regard would be appreciated.

  • rishiswethan
    kite.margins() # returns all account-related data that you see above in python

    If a stock ABS has 2X margin and you buy one share of it in intraday for 100rs, only 50rs margin gets used from your account
  • jkoracle23
    Thanks for your reply @rishiswethan . I know margin() function returns account related information and it will show in Java as well :).


    Please understand my specific query to capture the cash I have which I can use to do CNC.
    @sujith Any comments?
  • rishiswethan
    The "Margin available" is the amount left available for CNC or any other use. The "Margin used" is the amount used for your current interday positions. Regardless of the outcomes of your trades, your account value number only gets changed overnight.

    Also, note that if you square off your interday positions. Your "Margin available" get's updated instantly with the square off value, so, you can use this "Margin available" to buy CNC positions in say, the end of the day after you square off your positions.

    {'equity': {'enabled': True, 'net':3840, 'available': {'adhoc_margin': 0, 'cash': 11704, 'collateral': 0, 'intraday_payin': 0}, 'utilised': {'debits': 7863, 'exposure': 0, 'm2m_realised': 0, 'm2m_unrealised': 0, 'option_premium': 0, 'payout': 0, 'span': 0, 'holding_sales': 0, 'turnover': 0}}, 'commodity': {'enabled': True, 'net': 0, 'available': {'adhoc_margin': 0, 'cash': 0, 'collateral': 0, 'intraday_payin': 0}, 'utilised': {'debits': 0, 'exposure': 0, 'm2m_realised': 0, 'm2m_unrealised': 0, 'option_premium': 0, 'payout': 0, 'span': 0, 'holding_sales': 0, 'turnover': 0}}}

    The above would be what would be close to what's returned for your account, you can see that,
    "Margin available" would be 'net'
    "account value" would be "cash"
    "Margin used" would be "debits"
  • rishiswethan
    rishiswethan edited April 2019
    The real amount you can use for any trades is the value in 'net' or 'margin available'.That's the real balance you have left to use for trading.

    The account value or cash is the amount you can withdraw instantly to your bank account
  • sujith
    For clarification, the following is the meaning of the params from the funds response

    net = free cash, available.cash = total account value, utilized.debits = margin used
  • jkoracle23
    thanks @rishiswethan and @sujith for reply. The statement "The account value or cash is the amount you can withdraw instantly to your bank account" I interpreted this as --the max amount which can be used for CNC trading.
    Thanks ! Pls close the ticket.
This discussion has been closed.