Coder Social home page Coder Social logo

sanjdcool / angeloneoptionchainsmartapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markov404/angeloneoptionchainsmartapi

0.0 0.0 0.0 118 KB

That script is getting data of NFO`s OPTIDX from AngelOne using SmartApi

License: MIT License

Python 100.00%

angeloneoptionchainsmartapi's Introduction

OptionChain from AngelOne

This information is correct on 18.02.2023, SmartAPI MAY change their API.

How to?

Settings

For proper working of the programm, firstly you should create settings.txt file in root of programm. Fill it with format of example below:

API_KEY:####;ID:####;PASSWORD:####;OTP_CODE:####

You may change the way of programm getting settings by changing InitSettings class in settings.py module.

Using

After making settings.txt file you`ll start main.py and every 3 minutes you will have updated .txt files of OPTIDX data in root of your programm. Each file have time of last update in first row, and contains all data provided about option.

Example of output data:

19:45:32
key:value/key:value/key:value/.../key:value
key:value/key:value/.../key:value/key:value
key:value/.../key:value/key:value/key:value

Change the output format or way

Change the format of data

To change the format of saved data you have to go into output_processor.py and change method parse_options_data_into_string. It gets python dictionary with format below:

{
   "CE":{
   }"PE":{
   }
}

CE is Call data; PE is Put data. Each have the dictionary of properties from Instrument list and WebSocket2.0 merged.

Instrument List - https://smartapi.angelbroking.com/docs/Instruments

WebSocket2.0 - https://smartapi.angelbroking.com/docs/WebSocket2

All the properties you can check in the SmartApi documentation in part about WebSocket2.0 (Snap Quote).

Change the way programm saving data

To change the way programm saving option data you have to go into output_processor.py and change method _push in it. This method is working with options_store_key_name dictionary where you have this structure:

{
   "BANKNIFTY":{
      "SYMBOL1":{
         "CE":{},
         "PE":{}
      }
      "SYMBOL2":{
         "CE":{},
         "PE":{}
      }
   }
   "NIFTY":{
      "SYMBOL1":{
         "CE":{},
         "PE":{}"
      }
      "SYMBOL2":{
         "CE":{},
         "PE":{}"
      }
   }
   ...
}

angeloneoptionchainsmartapi's People

Contributors

markov404 avatar

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.