Portfolio Management Functions

1. Get Holdings

Fetch current holdings.

holdings = tsl.get_holdings(debug="NO")
  • debug: "YES" → print debug info (default "NO").
  • Returns: pd.DataFrame with symbol, quantity, average price.
  • On error: dictionary with status='failure'.

2. Get Positions

Fetch open positions.

positions = tsl.get_positions(debug="NO")
  • debug: "YES" for debug info.
  • Returns: pd.DataFrame with symbol, quantity, avg price, etc.

3. Get Orderbook

Fetch all placed orders.

orderbook = tsl.get_orderbook(debug="NO")
  • Returns: pd.DataFrame with symbol, quantity, status, price.

4. Get Trade book

Fetch all completed trades.

tradebook = tsl.get_trade_book(debug="NO")
  • Returns: pd.DataFrame with symbol, quantity, price, trade time.

5. Get Balance

Available trading balance.

available_balance = tsl.get_balance()

6. Get Live PNL

Live P&L of current positions.

PNL = tsl.get_live_pnl()

7. Get Lot Size

Lot size for futures/options.

lot_size = tsl.get_lot_size(tradingsymbol='NIFTY 19 DEC 24400 CALL')

8. Get Margin

Margin requirement for a symbol.

Margin = tsl.margin_calculator(
    tradingsymbol='NIFTY DEC FUT',
    exchange='NFO',
    transaction_type='BUY',
    quantity=75,
    trade_type='MARGIN',
    price=24350,
    trigger_price=0
)

📈 Option Chain Analysis

Get Option Chain

Retrieve options chain.

option_chain = tsl.get_option_chain(
    Underlying="NIFTY",
    exchange="INDEX",
    expiry=0,
    num_strikes=10
)
  • Underlying: e.g. "NIFTY", "BANKNIFTY", "RELIANCE".
  • exchange: "NSE", "NFO", "MCX", etc.
  • expiry: 0 = nearest expiry.
  • num_ strikes: default 10.

Leave a Reply

Your email address will not be published. Required fields are marked *

Your Business Potential with Our Proven Strategies

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Your Algo Trading Partner. Trade Smart, Trade Right “Trade Algo!

Help

Address: Shubhash Nagar, New Delhi - 110018

Phone: 91757 84461

Terms And Conditions

Refund & Cancellation Policy

Company

Blog

Privacy Policy

Subscribe Us Today

Stay Ahead in Trading – Subscribe for Updates and Insights

Address: Shubhash Nagar, New Delhi – 110018 | Phone: 91757 84461 | Email: [email protected]

 Copyright © 2026 – TradeHull