Skip to main content

GreekApi Client use for trading purpose

Project description

Greek_API

Greek_API is a Python-based package that allows users to subscribe to the Greek token and retrieve the latest tick by tick data. This project helps in authenticating a user, broadcasting tokens, and placing orders in a seamless manner.

Features Authentication:

By passing a username, session password, and user password, the project authenticates the user.

Token Retrieval:

Retrieves the latest token broadcast.

Order Placement:

Capable of placing orders once authenticated.

Technologies Used

Python built-in Libs & third party libs (Pandas, numpy,requests,etc.)

What's New in Version 0.0.3

Bug Fix: Fixed an issue where placing a new order would fail due to a regenerating the new session token. The issue is now resolved, and order requests should succeed.

New Feature: Added new feature for unsubscribe the unwanted token where a single GreekToken can pass to clear confusion between response data.

New Feature: Added New Feature To Terminate the all connection as "api.close_connection"

pip install greekapi

Usage Once installed, you can use the project by importing the greekapi, from the greekapi package.

Below is an example of how to use the API:

from greekapi import Greek_API

username="username" # String Format

session_pwd="session_pwd"  #String Format

user_pwd="user_pwd" #String Format

procli="procli" # for client id procli="2", retail id procli='1'

ac_no='ac_no' # if retail id pass account number in String Format. 

api = Greek_API(username,session_pwd,user_pwd,procli,ac_no) #to authenticate the creadentials passed.

token_no='102000000' # string format

# Authenticate and fetch the latest token

token = api.token_broadcast('token_no','asset_type') # token_no in 'String', asset_type='option' or 'future' or 'equity' in string format.

# token=token['data.token'][0] <-- get token no

# symbol=token['data.symbol'][0] <-- get symbol name of token passed

# time=token['data.ltt'][0] <-- provide the time

# strike=token['data.strikeprice'][0] <-- get Strike 

# option_type=token['data.optiontype'][0] <-- get Option type CE or PE

# instrument=token['data.instrument'][0] <-- get instrument type FUTSTK,OPTSTK...

# bid_price=token[data.bid][0] <-- get bid price of token passed 

# ask_price=token['data.ask'][0] <-- get ask price of token passed


# Subscribe with the Greek Token and pass it in list eg:token_list=['','',...] into the declared variable. 

token_list=['102000000','102000000',...] # Only pass Greek Token.

for data in api.get_apollo_resp(token_list): # To get response of tokens passed of list using loop.
    print(data)
    
# Place order passing required paramets, # token_no='102000000', symbol="RELIANCE", qty="minimum_lot" for respective token,

# price= value get from bid/ask price from token broadcast against respective token in strictly in string format,

#buysell= if buy then pass 1 and for sell 2 in integer format,

ordtype=1, trigprice=0, strategyname="example" strategy name will be anything as per userinput.

var_response=api.place_order(tokenno,symbol,qty,price,buysell,ordtype,trigprice,strategyname) # pass the required parameters
 
print(var_response) # acknowledge the response get from place order function.

**Unsubscribe Token**
api.unsubscribe_token(token) # Token in string--MANDATORY

**Close connection**
api.close_connection() # to terminate all sessions

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

greekapi-0.0.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

greekapi-0.0.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file greekapi-0.0.3.tar.gz.

File metadata

  • Download URL: greekapi-0.0.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for greekapi-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d2f075a29beffcf251dea642f95a83576f92743bd32b6acec7b701baec762487
MD5 7741eab080abc127de2e901cdc300041
BLAKE2b-256 94e2100406c84d3dbec02da044ca1294b0f945159807ff0234c64a99d9ba3f5d

See more details on using hashes here.

File details

Details for the file greekapi-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: greekapi-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for greekapi-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 11b258716a2b4c5c271b17a82fd5758c5baa2c913d5cdbd8ba7e6a943a21c7ea
MD5 dfa1959f1c1402f368252239f9355d37
BLAKE2b-256 1d7242e1360b8cf3f522cc6a99ac8d60876d3485ef7d4d5d5d6ed7c795360e64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page