☰
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
8.7K
All Categories
8
Go client
513
.Net API client
225
Kite Publisher
466
.Net / VBA / Excel (3rd party)
274
Algorithms and Strategies
695
Java client
646
API clients
318
PHP client
2.2K
Python client
256
Mobile and Desktop apps
955
Market data (WebSockets)
2.2K
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.