Official Finterion plugin for the investing algorithm framework
Project description
Finterion Investing Algorithm Framework Plugin
This is the official plugin for the investing algorithm framework open source project.
Installation
You can install the plugin with pip.
pip install finterion-investing-algorithm-framework
Usage
In order to use the plugin you must use the 'create_app' function provided by the plugin. This function will return an instance of the investing algorithm framework configured with the finterion platform.
Note: You must provide the API key of your algorithm in order to use the plugin. You can find your API keys in the developer dashboard of your algorithm on the finterion platform.
import os
import pathlib
from datetime import datetime, timedelta
from finterion_investing_algorithm_framework import create_app
from investing_algorithm_framework import RESOURCE_DIRECTORY, TimeUnit, \
TradingTimeFrame, TradingDataType, OrderSide
dir_path = os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir))
app = create_app(
api_key="<your_api_key>",
config={RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()}
)
@app.strategy(
time_unit=TimeUnit.SECOND, # Algorithm will be executed every 5 seconds
interval=5,
market="binance", # Will retrieve trading data from binance
symbols=["BTC/USDT", "ETH/USDT", ["DOT/USDT"]], # Symbols must be in the format of TARGET/TRADE symbol (e.g. BTC/USDT)
trading_data_types=[TradingDataType.OHLCV, TradingDataType.TICKER, TradingDataType.ORDER_BOOK],
trading_time_frame_start_date=datetime.utcnow() - timedelta(days=1), # Will retrieve data from the last 24 hours
trading_time_frame=TradingTimeFrame.ONE_MINUTE # Will retrieve data on 1m interval (OHLCV)
)
def perform_strategy(algorithm, market_data):
print(algorithm.get_allocated())
print(algorithm.get_unallocated())
print(market_data)
algorithm.create_limit_order(
target_symbol="BTC",
side=OrderSide.BUY,
price=market_data["TICKER"]["BTC/USDT"]["BID"],
amount_target_symbol=0.00001
)
if __name__ == "__main__":
app.run()
Documentation
You can find the official documentation at our documentation website
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for finterion_investing_algorithm_framework-0.9.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345087d5b09c225856e9a29f6b50b9520c4cc6eaa44077866bdfe068b47a9a67 |
|
MD5 | 4979d3b227c9d1ec82c1b6e27feb6684 |
|
BLAKE2b-256 | 8279e5af7b68843cba4d6e8464b90323d7f80d9df1628e0096cfcc27d5281e2e |