A simple service converting tradingview webhooks into exchange orders. Once running, the end user is able to submit commands via http. This tool was made so I could concurrently test multiple alert/signal stratagies using live market data. We now offer a hosted version at Fundingrate.io.
Below are the required software dependancies.
RethinkDB
- RethinkDB 2.3.6
The .env contains all the app's configuration details.
name=api
port=9001
# database
rethink.db=tradingview
rethink.host=localhost
# rethink.port=32769
# rethink.user=
# rethink.password=
# bitmex api key
bitmex.key=
bitmex.secret=
# bybit api key
bybit.key=
bybit.secret=
Install the dependancies and startup the app.
npm install
npm run api
Below is the format the bot expects.
type
- The event position type.provider
- Defined name for the event.timeframe
- Timeframe the event is listening to.
{
"token": "4432424-d9b3-433d-9388-19650eb7bf2a",
"type": "LONG",
"condition": "Whale",
"description": "Price can still go up",
"provider": "Market Liberator A",
"timeframe": "5m"
}
Below is a short tutorial on how to setup the app.
- Clone the repository.
- Create a .env file (example above.).
- Configure the app.
- install and run.
- Point a domain to the app.
- Input that domain into tradingview.
- Create events using the format.
Below is an example of how to use the http interface exposed by the app.
import axios from 'axios'
import assert from 'assert'
export default async baseURL => {
const api = axios.create({
baseURL,
transformResponse: [
function(data) {
return JSON.parse(data)
},
],
})
const { data } = await api.get('/')
console.log(data)
return data.reduce(
(memo, action) => {
return {
...memo,
[action]: async params => {
const { data } = await api.post(`/${action}`, params)
console.log(action, params, data)
return data
},
}
},
{
_api: api,
_post: async (endpoint, params) => {
const { data } = await api.post(endpoint, params)
return data
},
_get: async (endpoint, params) => {
const { data } = await api.get(endpoint, params)
return data
},
}
)
}
Below is a list of the available api endpoints.
returns back whatever is posted to it.
params
- optional params.
returns 200 ok message.
returns the user valided by the token.
token
- a user token.
returns the current bybit ticker information.
returns user token and creates userid.
username
- desired username.
list all registered users.
list all users who are active traders.
returns the created event.
token
- a user token.params
- optional event params.
returns list of created trades.
token
- a user token.
list my current trade stats.
token
- a user token.
list all my created tokens.
token
- a user token.
list all event providers and count of events.
list all event providers and count of events from each userid.
Subscribe to a provider
token
- a user token.userid
- provider name (indicator name)
list all your subscriptions.
token
- a user token.
license zero parity and apache 2.0 (contributions)