Skip to content

Funds

dhanhq._funds

Classes

Funds

Funds(dhan_context)
Functions
get_fund_limits
get_fund_limits()

Get all information of your trading account like balance, margin utilized, collateral, etc.

Returns:

Name Type Description
dict

The response containing fund limits data.

margin_calculator
margin_calculator(security_id, exchange_segment, transaction_type, quantity, product_type, price, trigger_price=0)

Calculate the margin required for a trade based on the provided parameters.

Parameters:

Name Type Description Default
security_id str

The ID of the security for which the margin is to be calculated.

required
exchange_segment str

The exchange segment (e.g., NSE_EQ) where the trade will be executed.

required
transaction_type str

The type of transaction (BUY/SELL).

required
quantity int

The quantity of the security to be traded.

required
product_type str

The product type (e.g., CNC, INTRA) of the trade.

required
price float

The price at which the trade will be executed.

required
trigger_price float

The trigger price for the trade. Defaults to 0.

0

Returns:

Name Type Description
dict

The response containing the margin calculation result.