Improve portfolio marking of long term investments or API calls for notes

I notice a bug in “Mark shares as long-term investment”.

Once I sell all the shares from the portfolio, it should mark it away/off automatically. Anyways, when I try to do it myself, it gives me this error.

One issue here that I note is that when you give an option for “Mark shares as long-term investment”, that’s the end of it. Why don’t you provide labels for people to handle them short/mid/long term themselves?

Perhaps attach it together with the note, that people can add to the trades too.
Also, the note is not available over API calls.

I know I am saying multiple items. The biggest benefit for everybody would be just allow notes to be added/edited over API calls.

1 Like

Hello @tradata

Thank you for highlighting this. Will check this and deploy the fix.

On enabling notes on API, as per feedback and conversations with multiple systematic traders, the same is not adopted as there is a different tagging that users use for this (known as correlation ID).

We do not want to build the API stack where in users are using APIs just to reflect information on the frontend, rather give the option on frontend itself at the first place.

Thanks for the update, @Hardik . Something is amiss here.

Ideally the backend and frontend should always be in sync. Any action that is taken on the frontend should be equally supported by backend. In this case - the API as well.

This means there are 2 things that are wrong:

  • If I can control the correlationID when sending an Order, it should be visible on the frontend of dhan (it is not).
  • If you want me to control the Notes of a trade only through the frontend, then why does it not apply to correlationID also? That would sound silly, I know.

correlationID thing is used by the API on orders but invisible on UI. On the other hand, Notes are available on Trades UI, but invisible to the API. I want consistency.

1 Like

Hello @tradata

Yes, I agree on the sync which does take place across Dhan Products. This is how you get same experience on all Dhan products and all are synced realtime.

However, for APIs, the approach is a bit different. correlationID is provided specific to API to make it simple for systematic traders while placing order and track the same. You will notice there is API which lets you fetch order details based on Correlation ID as well. This was built specifically for systematic traders who do not access Frontend and usually do reconciliation as well via code logics only.

I have placed some forever single orders via the API with both correlationId and notes fields populated. But I can’t see the same orders in the app. Is this the expected behaviour to not be able to see the API sourced orders to be not visible. For additional context the orders have been placed via Conditional Trigger API (POST /v2/alerts/orders).