FreqSignals client for python! FreqSignals is a platform enabling easier exchange of trading signals. This client library assists in token management and abstracts the HTTP requests to make it easy to upload or download signals.
Learn more at https://freqsignals.com.
pip install freqsignals-client
from freqsignals_client import FreqSignalsClient,
client = FreqSignalsClient(
client_id="1234",
client_secret="567890",
)
# get all signals
client.get_signals()
# pass some filters as a dict of query parameters (see documentation)
client.get_signals({
"data_set_id": "1234-56-78-9012",
"updated_date__gt": "2023-01-01",
"limit": 1,
})
Note: Might raise a freqsignals_client.FreqSignalsError
if FreqSignals rejects the request
Note: Might raise a freqsignals_client.FreqSignalsTimeoutError
if the request times out
which returns:
{
"count": 420,
"next": "https://api.freqsignals.com/api/crud/signals/?limit=1&offset=1",
"previous": null,
"results": [
{
"id": "1237-45-67-8910",
"symbol": "DOGE/USDT",
"value": 48.965,
"ttl_minutes": 5,
"created_date": "2022-11-13T22:52:58.216164Z",
"updated_date": "2023-01-26T23:25:46.360932Z",
"context": {
"rsi": 48.965,
"price": 0.086,
"open": 0.086,
"close": 0.086,
"high": 0.086,
"low": 0.086,
"last_move": 0.0
},
"data_set_id": "2345-67-89-1234"
}
]
}
client.post_signal({
"symbol": "BTC",
"value": 0.1,
"ttl_minutes": 60,
"data_set_id": "DATA_SET_ID"
})
To get visibility into logged events, override the log method and log however your app needs to log:
class CustomFreqSignalsClass(FreqSignalsClient):
def log(self, level, msg, **log_variables):
print(f"[{level}] {msg}", log_variables)
client = CustomFreqSignalsClass(client_id, client_secret)
from freqsignals import FreqSignalsClient, FreqSignalsError, FreqSignalsTimeoutError
my_client = FreqSignalsClient("1234", "56-789")
try:
results = my_client.get_signals()
print(results)
except FreqSignalsError:
print("FreqSignals failure")
except FreqSignalsTimeoutError:
print("FreqSignals timed out")
Black Formatting
$ black freqsignals_client --config freqsignals_client.toml
Build
$ python3 setup.py sdist
Pypi Distribution
$ python3 -m twine upload dist/*
FreqSignals Client is MIT licensed.