Skip to content

Latest commit

 

History

History
552 lines (298 loc) · 6.67 KB

File metadata and controls

552 lines (298 loc) · 6.67 KB

TradingView Alerts Processor

Indices


Accounts

1. Add account

Endpoint:

Method: POST
Type: RAW
URL: YOUR.STATIC.IP.ADDRESS/accounts

Body:

{
    "stub": "{{account_alias}}",
    "exchange": "{{exchange_id}}",
    "apiKey": "{{exchange_api_key}}",
    "secret": "{{exchange_api_secret}}"
}

More example Requests/Responses:

I. Example Request: Main account

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "{{account_alias}}",
    "exchange": "{{exchange_id}}",
    "apiKey": "{{exchange_api_key}}",
    "secret": "{{exchange_api_secret}}"
}

Status Code: 0


II. Example Request: FTX subaccount

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "{{account_alias}}",
    "subaccount": "{{subaccount_alias}}",
    "exchange": "ftx",
    "apiKey": "{{exchange_api_key}}",
    "secret": "{{exchange_api_secret}}"
}

Status Code: 0


III. Example Request: KuCoin account

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "{{account_alias}}",
    "exchange": "kucoin",
    "apiKey": "{{exchange_api_key}}",
    "secret": "{{exchange_api_secret}}",
    "passphrase": "{{exchange_api_passphrase}}"
}

Status Code: 0


2. Get account

Endpoint:

Method: GET
Type: 
URL: YOUR.STATIC.IP.ADDRESS/accounts

3. List configured accounts

Endpoint:

Method: GET
Type: 
URL: YOUR.STATIC.IP.ADDRESS/accounts

4. Remove account

Endpoint:

Method: DELETE
Type: 
URL: YOUR.STATIC.IP.ADDRESS/accounts/MAIN

Balances

1. List account balances

Endpoint:

Method: GET
Type: 
URL: YOUR.STATIC.IP.ADDRESS/balances/MAIN

2. List balances on all configured accounts

Endpoint:

Method: GET
Type: 
URL: YOUR.STATIC.IP.ADDRESS/balances

Health

1. Check server health

Endpoint:

Method: GET
Type: 
URL: YOUR.STATIC.IP.ADDRESS/health

Markets

1. List available markets

Endpoint:

Method: GET
Type: 
URL: YOUR.STATIC.IP.ADDRESS/markets/ftx

Trades

1. Close a position

Endpoint:

Method: POST
Type: 
URL: YOUR.STATIC.IP.ADDRESS/trades

More example Requests/Responses:

I. Example Request: Close 100% of a position

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Status Code: 0


II. Example Request: Close XX% of a position

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "test",
    "symbol": "ETH-PERP",
    "direction": "close",
    "size": "33%"
}

Status Code: 0


2. Open a position

Endpoint:

Method: POST
Type: RAW
URL: YOUR.STATIC.IP.ADDRESS/trades

Body:

{
    "stub": "test",
    "symbol": "ETH-PERP",
    "size": "11",
    "direction": "short"
}

More example Requests/Responses:

I. Example Request: Long position

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "test",
    "symbol": "ETH-PERP",
    "size": "11",
    "direction": "long"
}

Status Code: 0


II. Example Request: Short position

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "test",
    "symbol": "ETH-PERP",
    "size": "11",
    "direction": "short"
}

Status Code: 0


III. Example Request: Long position with XX% of available collateral (Futures) or available balance (Spot)

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "test",
    "symbol": "ETH-PERP",
    "size": "5%",
    "direction": "long"
}

Status Code: 0


IV. Example Request: Short position with XX% of available collateral (Futures) or available balance (Spot)

Headers:

Key Value Description
Content-Type application/json
charset utf-8

Body:

{
    "stub": "test",
    "symbol": "ETH-PERP",
    "size": "5%",
    "direction": "short"
}

Status Code: 0


3. Process multiple trades at once

Endpoint:

Method: POST
Type: RAW
URL: YOUR.STATIC.IP.ADDRESS/trades

Body:

[
    {
        "stub": "test",
        "symbol": "ETH-PERP",
        "size": "11",
        "direction": "long"
    },
    {
        "stub": "test",
        "symbol": "BTC-PERP",
        "size": "11",
        "direction": "long"
    }
]

Available Variables:

Key Value Type
server_ip YOUR.STATIC.IP.ADDRESS
account_alias MAIN
subaccount_alias
exchange_id ftx
exchange_api_key YOUR_API_KEY
exchange_api_secret YOUR_API_SECRET
exchange_api_passphrase YOUR_KUCOIN_PASSPHRASE

Back to top

Made with ♥ by thedevsaddam | Generated at: 2021-09-21 17:48:47 by docgen