☰
Login
Signup
Home
›
.Net / VBA / Excel (3rd party)
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.2K
All Categories
0
Incidents
158
Node JS client
45
Go client
802
.Net API client
386
Kite Publisher
538
.Net / VBA / Excel (3rd party)
466
Algorithms and Strategies
1K
Java client
1.1K
API clients
408
PHP client
4.1K
Python client
350
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
General
In this Discussion
December 2020
sujith
LastPrice from Positions is not updated
Mangesh
December 2020
in
.Net / VBA / Excel (3rd party)
I am using following code
PositionResponse positions = kite.GetPositions();
int TCnt = 0;
double BuyValue = 0;
double SellValue = 0;
RunningM2M = 0;
for (TCnt = 0; TCnt < positions.Net.Count; TCnt++)
{
OrderSymbol = Utils.JsonSerialize(positions.Net[TCnt].TradingSymbol);
// THIS IS SHOWN VERY OLD (NOT REFRESHED) HENCE LATEST M2M IS NOT SHOWN CORRECTLY
lastPrice = Convert.ToDouble(positions.Net[TCnt].LastPrice);
buyValue = Convert.ToDouble(positions.Net[TCnt].BuyValue);
sellValue = Convert.ToDouble(positions.Net[TCnt].SellValue);
netQuantity = Convert.ToInt32(positions.Net[TCnt].Quantity);
multiplier = Convert.ToDouble(positions.Net[TCnt].Multiplier);
OrderProfit = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);
RunningM2M = RunningM2M + OrderProfit;
}
sujith
December 2020
edited December 2020
@Mangesh
,
You can check out this thread
thread
to know more.
Sign In
or
Register
to comment.
You can check out this thread thread to know more.