☰
Login
Signup
Home
›
Python client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
458
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
348
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
January 10
gokulasdf
January 10
sujith
PnL update delay
gokulasdf
December 2023
in
Python client
kite api position book Pnl was not updating live.
sujith
December 2023
You can refer to this
thread
.
gokulasdf
January 10
def calculate_total_return(dat):
total_return = 0
for trade_type in ["day"]:
for trade in data[trade_type]:
pnl = (trade['sell_value'] - trade['buy_value']) + (trade['quantity'] * trade['last_price'] * trade['multiplier'])
total_return += pnl
return total_return
dat = kite.positions()
total_return = calculate_total_return(dat)
print("Total Return:", total_return)
same pnl it didt update live
it update pnl only whenever new order placed after it show same pnl not live
sujith
January 10
You can go through the thread linked above to know the answer.
Sign In
or
Register
to comment.
total_return = 0
for trade_type in ["day"]:
for trade in data[trade_type]:
pnl = (trade['sell_value'] - trade['buy_value']) + (trade['quantity'] * trade['last_price'] * trade['multiplier'])
total_return += pnl
return total_return
dat = kite.positions()
total_return = calculate_total_return(dat)
print("Total Return:", total_return)
same pnl it didt update live
it update pnl only whenever new order placed after it show same pnl not live