Portfolio & Risk Management

This article describes the Portfolio and Risk Management component that we provide. It is responsible for risk and portfolio management of automated trading system. This component is completely independent from the strategies that run in a trading system.

This component manages the trading done by all the strategies in the trading system.
Think about this as a Senior & Experienced trader, who is looking after the trading done
by junior traders (in our case, traders represent multiple strategies that are being run in a trading system).

The job of this component is to spot any strategy doing things it is not supposed to do.
Basically avoid losses, when strategies perform erroneously due to problems in its code.

Please find below some examples of how this component works:

  • Set maximum limit on stock position. Example, total value of a position in any stock must not go beyond 25,000/-
  • Set maximum limit on the portfolio. Example, total value of all positions in a portfolio must not go beyond 25,00,000/-
  • Set maximum limit on the orders. Example, total value (quantity * price) of any order must not go beyond 10,000/-
  • Maximum limit on position stoploss (Example 10% loss). Strategies can have their own stoploss (example 3%, 5% etc.). But for some reason (Say, due to code issues), if the stoploss order was not entered by the strategy. Then this component enters stoploss order.
  • Maximum limit on portfolio (all positions combined) stoploss (Example: Maximum of (3% portfolio value OR 15,000/-). There are days when market moves completely against your strategies, on such days this rule can avoid extreme losses.
  • Set LONG/SHORT bias: Example, you can say that once the LONG portfolio value goes say beyond 2,00,000/-; then the portfolio must maintain at least 40% SHORT positions. It means that after 2,00,000/- the system will only accept SHORT orders and reject LONG orders until the SHORT value of portfolio reaches at least 80,000/- after which new longs will be accepted.
  • Stock circuit safety. If you have sold SBIN @ 100 (intraday), and price closes the upper circuit (say 110), then as per this rule this position is immediately squared off.
  • Strategic end of day square off (intraday): Intraday positions are squared off at end of the day by brokers using market orders. And market orders can be traded in any price, mostly bringing losses on stocks that have low liquidity. This rule saves in such situations, it starts squaring off positions before end of market using limit orders.
  • Limit the stocks that are allowed to trade. Example, Only SBIN & LT are allowed to trade today.
  • Exclude stocks with extremely high volatility. Example, if SUZLON has shown very large movements today then do not include it for next day’s trading.

These were just a few examples, we can have even more rules as per your requirements. For details, contact us!

I have around 15 years of experience developing Financial Software. I took a break from my career to start my own algorithmic trading setup. This new journey started well and along with my own proprietary trading systems, I also started building automation systems for retail traders, fund managers and HNIs. I was employed with firms like Morgan Stanley, HSBC & SunGard. I work on various technologies, but my strengths are building server side cloud based algorithmic trading systems built primarily using Java programming language. Apart from all of this, I am a big fan of Formula 1 racing :-)

6 thoughts on “Portfolio & Risk Management”
  • Pradeep says:


    Thanks for developing a good tool, however I have following requirement which I could not find by studying about your software so far:

    1. To trade with options selling, I need realtime replication of Market watch & Admin Positions from Zerodha kite as worksheet in Excel.

    2. As per the strategies profit/loss and price of underlying, the order to be placed from excel sheet itself. No need for any other software.

    3. Other features like limiting total loss of all the positions etc. appears to be already covered by you.

    Hope you will help me above feature in your software or let me know if it already there.

    Let me know, if my requirement is not clear to you.


    June 24, 2018 at 4:15 am
    • Admin says:

      1. It is not available, but you can easily do it as we provide excel formulas that can give you all these values.
      2. You only need AutoTrader software

      June 29, 2018 at 4:33 am
  • Amit jagtap says:

    Hi, Can you please provide details regarding BulkOrders-OneOrderMultiClient for
    zeroda multiple client accounts.

    June 30, 2018 at 12:35 pm
    • Admin says:

      Zerodha KITE platform does not allow orders to be placed for multiple clients. You will need NOW/NEST dealer terminal for that.

      July 4, 2018 at 5:57 am
  • Venkata Ramana Tamminani says:

    Regarding point 8: “Strategic end of day square off (intraday):”, Is there any way by which Autotrader squares off bracket orders/OCO using limit orders?

    July 20, 2019 at 2:08 am
    • Admin says:

      The only way bracket orders can be squared off is by exiting from them. You can use exitOrder() functions to achieve this.

      July 29, 2019 at 4:38 am

Comments are closed.