☰
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
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)
457
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
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.