Comments (9)
@hmtp140789 can you please help with mcx pnl calculation
from jsvortex.
Hi @kalilinux-png
Please confirm that you are using "net" array for the calculation, not the "day" array.
from jsvortex.
Hi @kalilinux-png Please confirm that you are using "net" array for the calculation, not the "day" array.
@hmtp140789 I am Using Day Array as mentioned in the docs for calculation for Today's Gain
from jsvortex.
@kalilinux-png For today's gain replace "overnight_sell_value" with "sell_value" and "overnight_buy_value" with "buy_value".
Alternatively, you can use the below formula
todayGain = positionData.value + ( positionData.quantity * positionData.multiplier * lastTradePrice);
from jsvortex.
@kalilinux-png For today's gain replace "overnight_sell_value" with "sell_value" and "overnight_buy_value" with "buy_value". Alternatively, you can use the below formula todayGain = positionData.value + ( positionData.quantity * positionData.multiplier * lastTradePrice);
ok Sure @hmtp140789 I will try this during the live market and will let you know
Is this formula valid for all exchanges like CUR and NFO
and also please update this in the documentation
Thanks for your Quick Response 😁
from jsvortex.
Hi @kalilinux-png we will update the documentation for better clarity.
The general formula for today's gain is below
todayGain = positionData.value + ( netQty * lastTradePrice);
however the positionData.quantity changes according to the exchange
if (exchange is NSE_FO) {
netQty = positionData.quantity;
} else if (exchange is MCX_FO) {
netQty = positionData.quantity * positionData.multiplier;
} else {
netQty = positionData.quantity * positionData. lot_size;
}
Let us know if this clarifies your doubt. We are always available to support your development and growth, feel free to reach out to us for any concerns not restricted to technical ones.
from jsvortex.
Yes Surely @hmtp140789 👍🏻 😁
from jsvortex.
resolved @kalilinux-png ?
from jsvortex.
resolved @kalilinux-png ?
Yes @brisingr123 This issue is resolved
Thanks a lot 😃
from jsvortex.
Related Issues (4)
- Websocket Data Not Updating HOT 2
- CORS-Error HOT 5
- Cors-Error for OrderBook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsvortex.