ritpytrading package

Submodules

ritpytrading.assets module

exception ritpytrading.assets.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.assets.Asset(asset_response)[source]

Bases: object

case_response is a json obj returned from the API get request

ritpytrading.assets.asset(ses, ticker_sym)[source]

function that returns a single asset object given for a given ticker

ritpytrading.assets.assets_dict(ses)[source]

function that returns a dictionary of the assets object

ritpytrading.assets.assets_list(ses)[source]

returns a list of JSON formatted output for assets object

ritpytrading.cases module

exception ritpytrading.cases.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.cases.Case(case_response)[source]

Bases: object

case_response is a json obj returned from the API get request

class ritpytrading.cases.CaseLimits(limit_response)[source]

Bases: object

limit_response is a json obj returned from the API get request

ritpytrading.cases.case(ses)[source]

function that returns the case object

ritpytrading.cases.case_json(ses)[source]

returns a list of JSON formatted output for case object

ritpytrading.cases.case_limits(ses)[source]

returns a CaseLimits obj from the CaseLimits class

ritpytrading.cases.case_limits_json(ses)[source]

returns a list of JSON fomratted output for case limits

ritpytrading.cases.trade_lim_enforce_chk(ses)[source]

functions for information on case limits checking if a trade_limit is actually enforced

ritpytrading.news module

exception ritpytrading.news.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.news.News(news_response)[source]

Bases: object

case_response is a json obj returned from the API get request

ritpytrading.news.news_dict(ses, since_id=None, limit_itm=None)[source]

function that returns the news object

ritpytrading.news.news_json(ses, since_id=None, limit_itm=None)[source]

returns a list of JSON fomratted output for news object

ritpytrading.orders module

exception ritpytrading.orders.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.orders.Order(order_response)[source]

Bases: object

order_response is a json obj returned from the API get request

ritpytrading.orders.order(ses, orderId, status='OPEN')[source]

status can be OPEN, TRANSACTED or CLOSED status OPEN by default returns a Order object of the order class given an order id

ritpytrading.orders.orders_dict(ses, status='OPEN')[source]

returns all the orders as a dict with the order_ids as key

ritpytrading.orders.orders_json(ses, status='OPEN')[source]

returns all the attribs of all orders in a json type list format

ritpytrading.securities module

exception ritpytrading.securities.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.securities.Security(security_response)[source]

Bases: object

Security class takes a security_response object ( a list of json objects ) as its initializing paramenter to extract all relevant information security_response is a json obj returned from the API get request

ritpytrading.securities.security_dict(ses, ticker_sym=None)[source]

By default no specific ticker_sym is None returns the list of available securities as a dict of security objects with ticker name as keys

ritpytrading.securities.security_json(ses, ticker_sym=None)[source]

returns the list of available securities with all info in a json format

ritpytrading.securities_book module

exception ritpytrading.securities_book.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

ritpytrading.securities_book.get_all_asks(ses, ticker_sym)[source]

Returns a list of all JSON objects in ask side of the order

ritpytrading.securities_book.get_all_bids(ses, ticker_sym)[source]

Returns a list of all JSON objects in bid side of the order

ritpytrading.securities_book.get_all_bids_asks(ses, ticker_sym)[source]

Returns a list of JSON objects representing all_flag the orders in the Bid and Ask side of the book

ritpytrading.securities_book.get_bbo(ses, ticker_sym)[source]
ritpytrading.securities_book.get_best_ask(ses, ticker_sym)[source]
ritpytrading.securities_book.get_best_bid(ses, ticker_sym)[source]
ritpytrading.securities_book.get_security_info(ses, ticker_sym, side, param)[source]

All possible values for the param parameter are listed at the top i.e. param = “trader_id”

Returns the value of the param for the given ticker from the given side side = bids / asks

ritpytrading.securities_history module

exception ritpytrading.securities_history.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.securities_history.Security_History(sec_history)[source]

Bases: object

sec_history is a json obj returned from the API get request

ritpytrading.securities_history.security_history_dict(ses, ticker_sym, period_numb=None, lim_numb=None)[source]

function to get values of different parameters

ritpytrading.securities_history.security_history_json(ses, ticker_sym, period_numb=None, lim_numb=None)[source]

get all full JSON response for the securities history get request as a list of JSON objects

ritpytrading.submit_cancel_orders module

exception ritpytrading.submit_cancel_orders.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

ritpytrading.submit_cancel_orders.cancel_all_open_orders(ses)[source]

Cancels all open orders

ritpytrading.submit_cancel_orders.cancel_order(ses, order_id)[source]

function requires a requests.Session() object as the ses argument with a loaded API_KEY

ritpytrading.submit_cancel_orders.cancel_order_bulk(ses, price_direc, price_lim, volume_direc, volume_lim, all_flag=0)[source]

Volume < 0 for cancelling all open sell orders and Volume > 0 for cancelling all open buy orders query_gen example ‘Price < 20.0 AND Volume > 0’

ritpytrading.submit_cancel_orders.limit_order(ses, ticker, side, quantity, price)[source]

function requires a requests.Session() object as the ses argument with a loaded API_KEY

ritpytrading.submit_cancel_orders.market_order(ses, ticker, side, quantity)[source]

submitting a market order side = BUY/SELL function requires a requests.Session() object as the ses argument with a loaded API_KEY

ritpytrading.tenders module

exception ritpytrading.tenders.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.tenders.Tender(tender_response)[source]

Bases: object

case_response is a json obj returned from the API get request

ritpytrading.tenders.accept_tender(ses, tender_iden, price_tender=None)[source]
ritpytrading.tenders.decline_tender(ses, tender_iden)[source]
ritpytrading.tenders.is_tender_fixed_bid(ses, tender_iden)[source]

check if the given tender is fixed bid

ritpytrading.tenders.tenders_dict(ses)[source]

function that returns the tender object

ritpytrading.tenders.tenders_json(ses)[source]

returns a list of JSON fomratted output for tender object

ritpytrading.traders module

exception ritpytrading.traders.ApiException[source]

Bases: Exception

to print error messages and stop the program when needed

class ritpytrading.traders.Trader(trader_response)[source]

Bases: object

Trader class takes a trader_response object which is a json obj to extract all relevant information. trader_response is a json obj returned from the API get request

ritpytrading.traders.trader(ses)[source]

Module contents