Request for Guidance on Building Firstock API Code Base Framework

Dear Imran Sir,

I hope you are doing well.

As discussed earlier, due to my non-residential status, I am currently working with the Firstock broker API. While it may not yet be as mature as platforms like Zerodha, XTS, or Dhan, I have found it to be quite promising and steadily improving.

Over the past week, I have dedicated additional time and effort to better understand and work with the API. I have successfully developed a wrapper that simplifies several core functions, allowing me to execute trades from my main script with a single-line call—similar in spirit to the Tradehull TSL approach. This has been both a challenging and rewarding experience, and it has strengthened my interest in building a more robust and scalable framework around Firstock.

However, I recognize that developing a comprehensive and reliable codebase will require a more structured approach. In this regard, I would greatly appreciate your guidance. If there are existing frameworks, design patterns, or codebases that I can refer to or learn from, it would significantly help me accelerate my development and avoid common pitfalls.

From my side, I am fully committed to putting in the necessary hard work and consistent effort. I am eager to learn, experiment, and refine the system to the best of my ability. I would only seek your support and direction whenever I encounter challenges or uncertainties along the way.

Thank you very much for your time and consideration. I look forward to your guidance.

Warm regards,
Venkat

Hi @VENKATV ,

Follow these steps -

  1. One function shall have only one responsibility, a single function shall not do too many tasks. For a simple rule of thumb. allow a function to be max of 20 lines

  2. In codebase Function shall be reused, example in atm function to get ltp we can use already created ltp function inside of it

  3. Commenting is necessary, as it will help to make code readable

  4. Avoid deep indentation Flat is better than nested structure

  5. Also don’t pass the error , do log them or generate exeception.