☰
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
14.1K
All Categories
0
Incidents
157
Node JS client
41
Go client
797
.Net API client
385
Kite Publisher
537
.Net / VBA / Excel (3rd party)
463
Algorithms and Strategies
1K
Java client
1.1K
API clients
407
PHP client
4.1K
Python client
349
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
General
In this Discussion
January 2024
gokulasdf
January 2024
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 2024
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 2024
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