Skip to content

jcoffi/profitspi-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

profitspi-sdk

Welcome to the Profitspi.com API v1 Beta. This project is in no way affiliated with Profitspi. I just saw a need. Here you will find a complete description of all the current APIs. Please check back regularly as we continue to roll-out new functions.

For example, to retrieve the list of default screens use https://www.profitspi.com/api/v1/defaultscreens?api_key={api_key}&user_id={user_id}.

Functions will return JSON or XML depending on an Accept header setting of 'application/json' or 'application/xml' respectively, with JSON being the default. The Instruments functions can also return CSV for an Accept header setting of 'text/csv'. As an alternative to an Accept header add a query parameter of 'format='JSON|XML|CSV'.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/jcoffi/profitspi-sdk.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/jcoffi/profitspi-sdk.git)

Then import the package:

import profitspi-sdk 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import profitspi-sdk

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import profitspi-sdk
from profitspi-sdk.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = profitspi-sdk.BacktestingApi(profitspi-sdk.ApiClient(configuration))
id = 56 # int | The strategy_id from the User Strategies API.
api_key = 'api_key_example' # str | The unique key provided to you by Profitspi.com.
user_id = 'user_id_example' # str | The unique id identifying the user.

try:
    # Deletes a User Strategy and all it's Tests.
    api_response = api_instance.backtesting_delete_strategy(id, api_key, user_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BacktestingApi->backtesting_delete_strategy: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://www.profitspi.com/api/v1

Class Method HTTP request Description
BacktestingApi backtesting_delete_strategy DELETE /strategies/{id} Deletes a User Strategy and all it's Tests.
BacktestingApi backtesting_delete_strategy_test DELETE /strategies/{id}/tests/{test} Deletes a User Strategy Test.
BacktestingApi backtesting_get_default_strategies GET /defaultstrategies Retrieves the list of Default Strategies.
BacktestingApi backtesting_get_default_strategy_test GET /defaultstrategies/{id}/tests/{test} Retrieves the definition and results for a Default Strategy Test.
BacktestingApi backtesting_get_user_strategies GET /strategies Retrieves the list of Strategies for a User.
BacktestingApi backtesting_get_user_strategy_test GET /strategies/{id}/tests Retrieves the list of Tests for a User Strategy.
BacktestingApi backtesting_get_user_strategy_test_0 GET /strategies/{id}/tests/{test} Retrieves the definition and results for a User Strategy Test.
BacktestingApi backtesting_get_user_strategy_test_history GET /strategies/{id}/tests/{test}/history Retrieves the history for a User Strategy Test.
BacktestingApi backtesting_get_user_strategy_test_trades GET /strategies/{id}/tests/{test}/trades Retrieves the trades generated for a User Strategy Test.
BacktestingApi backtesting_post_strategy POST /strategies Adds a new User Strategy Test to a new Strategy and initiates a Test Run.
BacktestingApi backtesting_post_strategy_test POST /strategies/{id}/tests Adds a new User Strategy Test to an existing Strategy and initiates a Test Run.
BacktestingApi backtesting_put_strategy PUT /strategies/{id} Updates header information for a User Strategy.
InstrumentsApi instruments_get_instrument_group_item_instruments GET /instrumentgroups/{id}/{item}/instruments Retrieves the list of Instruments for a specific Instrument Group Item together with adhoc technical indicators.
InstrumentsApi instruments_get_instrument_group_item_sub_types GET /instrumentgroups/{id}/{item}/subtypes Retrieves the list of different subtypes for a specific Instrument Group Item.
InstrumentsApi instruments_get_instrument_groups GET /instrumentgroups Retrieves the list of different types of Instrument Groups.
InstrumentsApi instruments_get_instrument_groups_0 GET /instrumentgroups/{id} Retrieves the list of different items for a specific Instrument Group.
InstrumentsApi instruments_get_instrument_history GET /instrumenthistory/{id} Retrieves historic data for a specific Instrument together with adhoc technical indicators.
InstrumentsApi instruments_get_instrument_search_instruments GET /instrumentsearch/{search} Retrieves the list of Instruments matching a search string together with adhoc technical indicators.
ReferenceDataApi reference_data_get_criteria_conditions GET /criteriaconditions Retrieves the list of Criteria Conditions.
ReferenceDataApi reference_data_get_days_to_test_codes GET /daystotestcodes Retrieves the list of Strategy Days to Test Codes.
ReferenceDataApi reference_data_get_indicator_aliases GET /indicatoraliases Retrieves the list of Indicator Aliases.
ReferenceDataApi reference_data_get_indicator_types GET /indicatortypes Retrieves the list of Indicator Types.
ReferenceDataApi reference_data_get_indicators GET /indicators Retrieves the list of Indicators.
ReferenceDataApi reference_data_get_periods GET /periods Retrieves the list of Periods.
ReferenceDataApi reference_data_get_position_entry_price_types GET /positionentrypricetypes Retrieves the list of Strategy Position Entry Price Types.
ReferenceDataApi reference_data_get_position_exit_price_types GET /positionexitpricetypes Retrieves the list of Strategy Position Exit Price Types.
ReferenceDataApi reference_data_get_position_rounding_amounts GET /positionroundingamounts Retrieves the list of Strategy Position Rounding Amounts.
ReferenceDataApi reference_data_get_position_sizing_types GET /positionsizingtypes Retrieves the list of Strategy Position Sizing Types.
ReferenceDataApi reference_data_get_stop_loss_exit_price_types GET /stoplossexitpricetypes Retrieves the list of Strategy Stop Loss Exit Price Types.
ReferenceDataApi reference_data_get_target_exit_price_types GET /targetexitpricetypes Retrieves the list of Strategy Target Exit Price Types.
ReferenceDataApi reference_data_get_time_stop_exit_price_types GET /timestopexitpricetypes Retrieves the list of Strategy Time Stop Exit Price Types.
ReferenceDataApi reference_data_get_trailing_stop_loss_exit_price_types GET /trailingstoplossexitpricetypes Retrieves the list of Strategy Trailing Stop Loss Exit Price Types.
ReferenceDataApi reference_data_get_trailing_stop_loss_price_to_use_types GET /trailingstoplosspricetouses Retrieves the list of Strategy Trailing Stop Loss Price to Use Types.
ScreeningApi screening_delete_screen DELETE /screens/{id} Deletes a User Screen.
ScreeningApi screening_get_default_screen GET /defaultscreens/{id} Retrieves the definition and results for a Default Screen.
ScreeningApi screening_get_default_screens GET /defaultscreens Retrieves the list of Default Screens.
ScreeningApi screening_get_user_screen_additional_items GET /screens/{id}/additionalresultitems Retrieves the additional result items definition only for a User Screen.
ScreeningApi screening_get_user_screen_criteria GET /screens/{id}/criteria Retrieves the criteria definition only for a User Screen.
ScreeningApi screening_get_user_screen_results GET /screens/{id}/results Retrieves the results only for a User Screen.
ScreeningApi screening_get_user_screens GET /screens Retrieves the list of Screens for a User.
ScreeningApi screening_get_user_screens_0 GET /screens/{id} Retrieves the definition and results for a User Screen.
ScreeningApi screening_post_screen POST /screens Adds a new User Screen.
ScreeningApi screening_put_screen PUT /screens/{id} Updates a User Screen.
UserInstrumentsApi user_instruments_delete_user_calendar_holidays DELETE /usercalendars/{id}/holidays Deletes all Holidays for a User or Corporate Calendar.
UserInstrumentsApi user_instruments_delete_user_exchange_instrument DELETE /userexchanges/{id}/instruments/{instrument} Deletes a specific Instrument for a User or Corporate Instrument.
UserInstrumentsApi user_instruments_delete_user_instrument_price_history DELETE /userexchanges/{id}/instruments/{instrument}/pricehistory Deletes all price history for a User or Corporate Instrument.
UserInstrumentsApi user_instruments_delete_user_instrument_splits DELETE /userexchanges/{id}/instruments/{instrument}/splits Deletes all Splits for a User or Corporate Instrument.
UserInstrumentsApi user_instruments_get_user_calendar GET /usercalendars/{id} Retrieves a specific User or Corporate Calendar.
UserInstrumentsApi user_instruments_get_user_calendar_holidays GET /usercalendars/{id}/holidays Retrieves the list of Holidays for a User or Corporate Calendar.
UserInstrumentsApi user_instruments_get_user_calendars GET /usercalendars Retrieves the list of User or Corporate Calendars.
UserInstrumentsApi user_instruments_get_user_exchange GET /userexchanges/{id} Retrieves a specific User or Corporate Exchange.
UserInstrumentsApi user_instruments_get_user_exchange_instrument GET /userexchanges/{id}/instruments/{instrument} Retrieves a specific Instrument for a User or Corporate Exchange.
UserInstrumentsApi user_instruments_get_user_exchange_instruments GET /userexchanges/{id}/instruments Retrieves the list of Instruments for a User or Corporate Exchange.
UserInstrumentsApi user_instruments_get_user_exchanges GET /userexchanges Retrieves the list of User and Corporate Exchanges.
UserInstrumentsApi user_instruments_get_user_instrument_price_history GET /userexchanges/{id}/instruments/{instrument}/pricehistory Retrieves price history for a specific User or Corporate Instrument.
UserInstrumentsApi user_instruments_get_user_instrument_splits GET /userexchanges/{id}/instruments/{instrument}/splits Retrieves Splits for a specific User or Corporate Instrument.
UserInstrumentsApi user_instruments_post_user_calendar POST /usercalendars Adds a new User or Corporate Calendar.
UserInstrumentsApi user_instruments_post_user_calendar_holidays POST /usercalendars/{id}/holidays Adds one or more new Holidays to a User or Corporate Calendar.
UserInstrumentsApi user_instruments_post_user_exchange POST /userexchanges Adds a new User or Corporate Exchange.
UserInstrumentsApi user_instruments_post_user_exchange_instrument POST /userexchanges/{id}/instruments Adds a new Instrument to a User or Corporate Exchange.
UserInstrumentsApi user_instruments_post_user_instrument_price_history POST /userexchanges/{id}/instruments/{instrument}/pricehistory Adds / replaces price history for a User or Corporate Instrument.
UserInstrumentsApi user_instruments_post_user_instrument_splits POST /userexchanges/{id}/instruments/{instrument}/splits Adds one or more Splits to a Corporate Instrument.
UserInstrumentsApi user_instruments_put_exchange PUT /userexchanges/{id} Updates a User or Corporate Exchange.
UserInstrumentsApi user_instruments_put_user_calendar PUT /usercalendars/{id} Updates a User or Corporate Calendar.
UserInstrumentsApi user_instruments_put_user_exchange_instrument PUT /userexchanges/{id}/instruments/{instrument} Updates a specific Instrument for a User or Corporate Exchange.

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author