Metadata-Version: 2.1
Name: algomojo-upstox
Version: 0.1
Summary: A functional python wrapper for trading api
Home-page:
Author: Algomojo
Author-email: support@algomojo.com
License: MIT
Description:
## ABOUT
A functional python wrapper for firststock trading api.
It is a python library for the [Algomojo Free API + Free Algo Trading Platform ](https://algomojo.com/).
It allows rapid trading algo development easily, with support for both REST-API interfaces.
Execute Orders in Reatime, Modify/Cancel Orders, Retrieve Orderbook, Tradebook, Open Positions, Squareoff Positions and much more functionalities.
For more details of each API behavior, Pease see the Algomojo API documentation.
## License
Licensed under the MIT License.
## Documentation
[Algomojo Rest API documentation ](https://algomojo.com/docs/python)
## Installation
Install from PyPI
pip install algomojo-upstox
Alternatively, install from source. Execute setup.py from the root directory.
python setup.py install
Always use the newest version while the project is still in alpha!
## Usage Examples
In order to call Algomojo trade API, you need to sign up for an trading account with one of the partner broker and obtain API key pairs and enjoy unlimited access to the API based trading.
Replace api_key and api_secret_key with what you get from the web console.
## Getting Started
After downloading package import the package and create the object with api credentials
from algomojo import upstox
## Creating Object
For creating an object there are 3 arguments which would be passed
api_key : str
User Api key (logon to algomojo account to find api credentials)
api_secret : str
User Api secret (logon to algomojo account to find api credentials)
Broker : str
This takes broker it generally consists 2 letters , EX: upstox--> up,
Sample:
at=angel.api(api_key="20323f062bb71ca6fbb178b4df8ac5z6",
api_secret="686786a302d7364d81badc233f1d22e3",
broker="up")
## Using Object Methods
obj.method(mandatory_parameters) or obj.method(madatory_parameters+required_parameters)
# Avaliable Methods
### 1. place_order:
Function with mandatory parmeters:
place_order(ticker,exchange,action,ordertype,qty,product)
Function with all parametrs:
place_order(ticker,exchange,action,ordertype,qty,product,
prc,dscqty,trgprc)
Sample :
at.place_order(ticker="SBIN",exchange="NSE_EQ",action="B",ordertype="MKT",
qty="15",product="CNC")
### 2.place_multi_order(order_list)
Sample order_list:
[{"user_apikey":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"api_secret":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ticker":"INFY","exchange":"NSE_EQ","action":"B",
"qty":"1","price":"0","ordertype":"MKT","product":"CNC",
"trigprc":"0","discqty":"0"},
{"user_apikey":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"api_secret":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ticker":"SBIN","exchange":"NSE_EQ","action":"B",
"qty":"10","price":"0","ordertype":"MKT","product":"CNC",
"trigprc":"0","discqty":"0"}])
Sample function call:
at.place_multi_order(order_list)
###3.place_bracket_order:
Function with mandatory parameters:
place_bracket_order(ticker,exchange,action,ordertype,qty,
dscqty,prc,trgprc,stoploss,squareoff,trailticks)
sample:
at.place_bracket_order(ticker="INFY",exchange="NSE_EQ",action="B",ordertype="SL",
qty="15",dscqty="1",prc="1",trgprc="1",stoploss="1",
squareoff="1",trailticks="20")
### 4. place_option_order
Funtion with mandatory parameters:
place_option_order(spot,expiry,optiontype,action,ordertype,qty,product,strike)
Function with all parameters:
place_option_order(spot,expiry,optiontype,action,ordertype,qty,product,
strike,price,offset,trigprice)
Sample :
at.place_option_order(spot="BANKNIFTY",expiry="22407",optiontype="CE",action="B"
ordertype="MKT",qty="50",product="MIS",strike="100")
### 5. modify_order:
Funtion with mandatory parameters:
modify_order(orderno,qty)
Function with all parameters:
modify_order(self,orderno,qty,ordertype,dscqty,prc,trigprice)
Sample : `
at.modify_order(orderno="220401000439413",qty="3")
### 6. cancel_order
Funtion with mandatory parameters:
cancel_order(orderno)
Function with all parameters:
cancel_order(orderno)
Sample:
at.cancel_order(orderno="4567891523")
### 7. profile:
Funtion with mandatory parameters:
profile()
Function with all parameters:
profile()
Sample:
at.profile()
### 8. balance
Funtion with mandatory parameters:
balance()
Function with all parameters:
balance()
Sample:
at.balance()
### 9. holdings:
Funtion with mandatory parameters:
holdings()
Function with all parameters:
holdings()
Sample:
at.holdings()
### 10. order_book:
Funtion with mandatory parameters:
order_book()
Function with all parameters:
order_book()
Sample:
at.order_book()
### 11. order_history:
Funtion with mandatory parameters:
order_history(orderno)
Function with all parameters:
order_history(orderno)
Sample:
at.order_history(orderno='201109000000025')
### 12.. positions
Funtion with mandatory parameters:
positions()
Function with all parameters:
positions()
Sample:
at.positions()
### 13. trade_book:
Function with mandatory parameters:
trade_book()
Sample:
at.trade_book()
### 14. feed:
Functions with mandatory parameters:
feed(exchange,ticker,typ)
Sample:
at.feed(exchange="nse_eq",ticker="RELIANCE",typ="full")
### 15.historical
Functions with mandatory parameters:
historical(exchange,ticker,interval,startdate,enddate)
Sample:
at.historical(exchange="NSE_EQ",ticker="RELIANCE",interval="1",startdate="19-01-202"
enddate="25-01-2021")
### 16.security_info:
Functions with mandatory parameters:
security_info(exchange,ticker)
Sample:
at.security_info(exchange="NSE_EQ",ticker="SBIN")
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown