Skip to main content

GreekApi Client use for trading purpose

Project description

Greek_API

Greek_API is a Python-based project that allows users to subscribe to the Greek token and retrieve the latest 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.2

Fixed

  • 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.
pip install greekapi

Usage Once installed, you can use the project by importing the Greek_API from the greek_api_client 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,

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

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.2.tar.gz (6.7 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.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: greekapi-0.0.2.tar.gz
  • Upload date:
  • Size: 6.7 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.2.tar.gz
Algorithm Hash digest
SHA256 f88fc3051e6f8e59cc2765f4b592ad6e5c243567e88849468ae93c583773314b
MD5 4979b56d3ee3d871afe4261bf65e775f
BLAKE2b-256 ee1e5bdc327036463d29cb73271e8a7bfa3866d117b0e9eb5879f6329fbc92b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: greekapi-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11dc9cca7067a8f92f18c44ffd2c284798fcbfca79c59f8441a7afe65f4f5cb0
MD5 1ea146065ba1993a81754c178b156f1f
BLAKE2b-256 19cbdafcdd6c55d3b18911624edaa84ea63cea4e7f9c5cadc667e203c9bcc449

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