Hi, I want to exit from all trades if day loss exceeds some amount. For that i want to get the updated pnl value each 5 seconds. I was retrieving Unrealised/PnL value from positions but its values are not dynamic. They are getting updated every 15 minutes. Please help.
Code snippet.
q, err := kiteapi.GetPositions() netpnl := 0.0 for i := range q.Day { pnl := q.Day[i].Unrealised netpnl += pnl i++ }
how can this give current pnl of day ?