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.)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file greekapi-0.0.1.tar.gz.
File metadata
- Download URL: greekapi-0.0.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
813dbaab6203130fddc6ed8fce946df1b8f345567c313b69bdd17ad80963acba
|
|
| MD5 |
c5dc1cdfbcbca6617c9e172e33bc5a51
|
|
| BLAKE2b-256 |
e2679d3769e9695a5876a4a56772f6208d793e088f8cd6b628e104305c902ac2
|
File details
Details for the file greekapi-0.0.1-py3-none-any.whl.
File metadata
- Download URL: greekapi-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
554b96ad48826b87541c1f8a4bbe003731dae3802a30d81f404cb9805d0be15e
|
|
| MD5 |
adb0629a1c0c60e8a950c05c13c46723
|
|
| BLAKE2b-256 |
c438e7242971bcd7009a93128a118dd986cd551b4879bf9980767fbce2c62534
|