How can i calculate the current price ?

Pandiyaraj
Hi ,

i am getting open , high, low, close and last traded price, But i don't know how to calculate the current price . i want to display the current prices with positive or negative values. Can you please help me how to do it?
  • sujith
    Hi @Pandiyaraj,
    LTP(last traded price) is the current price but what is the use case?
  • sujith
    Do you want to display price same as Kite marketwatch?
  • Pandiyaraj
    Yes.. I need to display the values in graph like your marketwatch.
  • sujith
    @Pandiyaraj,
    You can use last traded price(last price).
  • Pandiyaraj
    Hi Sujith,


    Last traded price was always returning the same value, I don't see any postive and negative values on after that time, Current price was Last Traded Price.

    I want to display current price in graphical view with up and down values, But i can't get it .

    Please give me some ideas to calculate this.

    Thanks
    Pandiyaraj
  • sujith
    Hi @Pandiyaraj,
    Last traded price is not something that can be calculated. It is the price at which last trade happened which is published by the exchange. You will have to use the same value.
  • Pandiyaraj
    Pandiyaraj edited June 2017
    Hi @sujith


    So Shall i just use the last traded price as current price value in graph right?
  • Pandiyaraj
    Hi @sujith


    Where can i get the up / down prices in that streaming bytes .
  • sujith
    Hi @Pandiyaraj,
    Yes, you can use LTP as the current price.
    You can display change(which says if current price is above/below previous close), check out parsing change from websockets here
  • Pandiyaraj
    Hi @sujith

    Thanks for your help. I got some ideas now to get the changes of price, But constantly getting same value i didn't see any changes on this instrument token. I am getting value '280' as LTP. The same price only i getting.
  • sujith
    @Pandiyaraj,
    Can you let us know instrument token?
  • Pandiyaraj
    Oh Sorry, I forgot to mention that token. I used mulitple tokens Please see below tokens
    : 16922626 , 779521 , 16778754, 23666434
  • Vivek
    @Pandiyaraj Are you using any of the official Kite connect libraries to get ticks or you have rolled your own? Few instruments which you posted above like SBIN (779521) are volatile and you should be getting different LTP every few seconds during the markets.
Sign In or Register to comment.