GithubHelp home page GithubHelp logo

Comments (9)

aswinm227 avatar aswinm227 commented on August 16, 2024

you may subscribe to the websocket, i think all the actions are available on it
what actually you are trying to get

from kotak-neo-api.

youngking1686 avatar youngking1686 commented on August 16, 2024

you may subscribe to the websocket, i think all the actions are available on it what actually you are trying to get

Hi, I just want to get order status changes updated on any event from open to pending/open to completion etc, So that I can work on limit orders too.

If already available with api, please provide a sample code which I can try. Thanks.

from kotak-neo-api.

aswinm227 avatar aswinm227 commented on August 16, 2024

https://github.com/Kotak-Neo/kotak-neo-api/blob/main/docs/Order_report.md#order_report

from kotak-neo-api.

youngking1686 avatar youngking1686 commented on August 16, 2024

This is rest api call which already we use to check the order status. I am asking if there is any live order websocket which gives any order activities without having to call everytime.

from kotak-neo-api.

aswinm227 avatar aswinm227 commented on August 16, 2024

i think no

from kotak-neo-api.

rosevinod avatar rosevinod commented on August 16, 2024

subscribe_to_orderfeed() works very well, you just need to write as follows:
based on the order status, you can write your methods.



def on_message(message):
    print(f"--live--- order -- feed ----")
    message = json.loads(message)
    print(message)

def on_error(error_message):
    print(error_message)

def on_open(open_msg):
    print(open_msg)

def on_close(close_msg):
    print(close_msg)

def main():
    client = stock_main.startKotakEngineCold(on_message,on_error,on_close,on_open)   
    client.subscribe_to_orderfeed(on_message, on_close, on_error) 


from kotak-neo-api.

crypt0inf0 avatar crypt0inf0 commented on August 16, 2024

@rosevinod how to get ltp only from

inst_tokens = [ {"instrument_token": "65625", "exchange_segment": "nse_fo"} ]
ltp_value = c.subscribe(instrument_tokens = inst_tokens, isIndex=False, isDepth=False)
print(ltp_value[0].get('ltp'))

returns [{'ftm0': '04/01/1970 00:00:27', 'dtm1': '29/12/1971 15:09:28', 'fdtm': '15/12/2023 11:57:47', 'ltt': '15/12/2023 09:59:59', 'v': '14014000', 'ltp': '214.0000', 'ltq': '50', 'tbq': '143900', 'tsq': '70300', 'bp': '212.1500', 'sp': '216.0000', 'bq': '50', 'bs': '50', 'ap': '145.8300', 'lo': '97.9000', 'h': '236.9000', 'lcl': '0.0500', 'ucl': '485.6500', 'yh': '21474836.4800', 'yl': '21474836.4800', 'op': '118.0000', 'c': '94.3500', 'oi': '2795400', 'mul': '1', 'prec': '2', 'cng': '119.6500', 'nc': '126.8151', 'to': '2043661620.0000', 'name': 'sf', 'tk': '65625', 'e': 'nse_fo', 'ts': 'NIFTY23DEC21500CE'}]

from kotak-neo-api.

rosevinod avatar rosevinod commented on August 16, 2024

@crypt0inf0 what do you mean?

from kotak-neo-api.

crypt0inf0 avatar crypt0inf0 commented on August 16, 2024

@rosevinod If I place a order and want to subscribe to that token to fetch the ltp and calculate the P/L and once it below a desired level I wish to close this position.

from kotak-neo-api.

Related Issues (20)

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.