Single Ledger - Trading via GoLang API

YateshKandoi
While using API framework (in GoLang) to trade, so far, we had to validate if the Margins were available in Commodity sector with the help of the following:

// Set access token
kc.SetAccessToken(data.AccessToken)

MarginResponse, err = kc.GetUserMargins()
if err != nil {
log.Fatalln(err)
} else {
TotalMargin = MarginResponse.Commodity.Net
}

But now, since activation of Single Ledger, I am able to add funds in Equity account - so, the response to above code is coming as TotalMargin = 0, even when there is actual funds residing under Equity.

What changes do I have to make, so trades under MCX goes out smoothly while using single ledger facility!
  • Nivas
    It looks like your code is currently set to retrieve funds for the commodity segment. You might want to adjust it to get the details for the equity segment instead.
  • YateshKandoi
    Thank you Nivas. Would do the needful. I do hope that, my trades would go through, in case of any concerns, will come back to this thread itself.
Sign In or Register to comment.