☰
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
14K
All Categories
0
Incidents
157
Node JS client
41
Go client
795
.Net API client
384
Kite Publisher
537
.Net / VBA / Excel (3rd party)
463
Algorithms and Strategies
1K
Java client
1.1K
API clients
406
PHP client
4.1K
Python client
349
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.