Code Monkey home page Code Monkey logo

Comments (9)

brisingr123 avatar brisingr123 commented on June 14, 2024

@hmtp140789 can you please help with mcx pnl calculation

from jsvortex.

hmtp140789 avatar hmtp140789 commented on June 14, 2024

Hi @kalilinux-png
Please confirm that you are using "net" array for the calculation, not the "day" array.

from jsvortex.

kalilinux-png avatar kalilinux-png commented on June 14, 2024

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.

hmtp140789 avatar hmtp140789 commented on June 14, 2024

@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 avatar kalilinux-png commented on June 14, 2024

@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.

hmtp140789 avatar hmtp140789 commented on June 14, 2024

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.

kalilinux-png avatar kalilinux-png commented on June 14, 2024

Yes Surely @hmtp140789 👍🏻 😁

from jsvortex.

brisingr123 avatar brisingr123 commented on June 14, 2024

resolved @kalilinux-png ?

from jsvortex.

kalilinux-png avatar kalilinux-png commented on June 14, 2024

resolved @kalilinux-png ?

Yes @brisingr123 This issue is resolved
Thanks a lot 😃

from jsvortex.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.