Comment on page
Sending Trading Signals
Documentation for creating and formatting Signal Provider Group trade notifications on the Compendium application.
To link your trading strategy with Compendium, simply head back to the admin page of your Signal Provider Group. Scroll down until you see the "View This Strategy's Alert API Key" section, then click the "View My Strategy API Key" button. This will reveal your private API key, which you can then input into the Compendium WebHook.
It's crucial to keep your API key confidential as it's used to identify calls. Sharing your API key can result in unauthorized signals being sent and potentially compromise the security of your group. If you suspect that your API key has been compromised, we recommend clicking the "Reroll API Key" button. Don't forget to update the API key in your webhooks to ensure that your strategy continues to post trades successfully.
Now that you have your API key it is time to learn how signals can be sent!
All signals should be sent to the following webhook URL as POST. If you are using TradingView it will automatically format webhook + JSON in the correct method.
You can learn more about specific JSON formatting at the link below.
Please follow TradingView's internal documentation for educational resources on posting Webhook orders from their system.

About webhooks — TradingView
TradingView
Official documentation provided by TradingView on interacting with their webhooks system.
URL: https://compendium.finance/api/1.1/wf/signal
Method: POST
{
"apiKey": "insertGroupAPIKeyHere",
"orderchain" : [
{
"signal" : "place",
"orderType" : "limit",
"symbol" : "BTC-USDT-SWAP",
"marketType" : "linear",
"side" : "buy",
"risk" : "100",
"mode" : "cross",
"reduceOnly" : "false",
"postOnly" : "false",
"ioc" : "false",
"fok" : "false",
"price" : "20000",
"tpTrigger" : "21000",
"tpPrice" : "21500",
"tpType" : "last",
"tpOrderType" : "limit",
"slTrigger" : "19900",
"slPrice" : "19500",
"slType" : "last",
"slOrderType" : "limit"
}
]
}
The above JSON example shows a single signal in the
orderchain
array. Please read the next section to understand how to fully utilize this new integration.Our new signal system requires signal commands to be sent in the
orderchain
array, even if you are only sending a single command. We can now offer supremely advanced capabilities by offering the capability to chain orders together. We have provided some simple examples below.The
orderchain
array has a capacity of accommodating a maximum of 5 signal types in a stacked manner and mandates the presence of at least one signal type to effectively transmit a trade notification signal. It is imperative to acknowledge that the execution of Orderchain commands is dependent on the sequence of WebHook post in which they are transmitted, thus dictating their placement order.The
orderchain
array will continue to post in-line commands even if the previous command has failed. The following example shows the user sending a single signal in the
orderchain
array to close all open positions.{
"apiKey": "insertGroupAPIKeyHere",
"orderchain" : [
{
"signal" : "closeall"
}
]
}
The following example shows the user sending multiple signals in the
orderchain
array. This specific example shows the user closing all open positions and then opening a new trade. This code snippet should be helpful if your trading strategy is always in a trade and needs to flip sides from "short" to "long" or vice-versa.POST (System Currently In Development, WebHook Available Shortly)
{
"apiKey": "insertGroupAPIKeyHere",
"orderchain" : [
{
"signal" : "closeall"
},
{
"signal" : "place",
"orderType" : "limit",
"symbol" : "BTC-USDT-SWAP",
"marketType" : "linear",
"side" : "buy",
"risk" : "100",
"mode" : "cross",
"reduceOnly" : "false",
"postOnly" : "false",
"ioc" : "false",
"fok" : "false",
"price" : "20000",
"tpTrigger" : "21000",
"tpPrice" : "21500",
"tpType" : "last",
"tpOrderType" : "limit",
"slTrigger" : "19900",
"slPrice" : "19500",
"slType" : "last",
"slOrderType" : "limit"
}
]
}
All parameters should be sent as a "string" from your POST API call. This is to simplify connections from platforms like TradingView while normalizing our structure. It is also important to note that if you are passing a number, it should be treated as an
integer
within the "string".Parameter | Type | Requirements & Description |
---|---|---|
signal | String | ALWAYS REQUIRED - See valid values below |
orderId | String | Required if signal = cancel |
orderType | String | Required if signal = place. See valid values below |
symbol | String | Required if signal parameter requires. |
marketType | String | Optional - if signal is cancel type, the orders canceled will be of marketType . |
side | String | Required if signal = place |
risk | String | Required if signal = place (READ MORE BELOW) |
price | String | Required if orderType requires it (eg limit) |
mode | String | Optional - default value = cross |
reduceOnly | String | Optional - default is false |
postOnly | String | Optional - default value is false |
ioc | String | Optional - default = false |
fok | String | Optional - default = false |
closepct | String | Optional if signal = close ( "1" - "100" ) |
tpTrigger | String | Optional |
tpPrice | String | Required if tpTrigger submitted and tpOrderType = limit |
tpType | String | Optional - default = last |
tpOrderType | String | Required if tpTrigger submitted |
slTrigger | String | Optional |
slPrice | String | Required if slTrigger submitted and slOrderType = limit |
slType | String | Optional - default = last |
slOrderType | String | Required if slTrigger submitted |
The following breakdown includes JSON Type, Required Conditions, & Valid Values for all available
signal
parameters.JSON type: "String"
Required: Always
Valid Values:
place
: used to place orderscancel
: cancels ONE specific order, must provideorderid
cancelall
: cancels ALL open orders without regard to market or complexitycancelbuys
: cancels all open buy orderscancelsells
: cancels all open sell orderscanceltps
: cancel all take profit orders (including embedded TP orders)cancelsls
: cancels all stop loss orders (including embedded SL orders)canceltriggers
: cancels all orders having TP or SL orders embedded but not bothclose
: if submitted with a symbol (e.g. symbol:BTC-USDT-SWAP
), then closes all current positions on that symbol. Otherwise closes all positions on all tokens (same behavior ascloseall
)closeall
: closes all positions on all token marketscloselongs
: closes all long positions on any token marketcloseshorts
: closes all short positions on any token
JSON Type: "String"
Required: Required if
signal
= placeValid Values:
- Risk is limited from 1 - 100 for spot markets.
- Risk can be above 100 for perpetual swap markets.
Explanation: Risk is our system's version of trade size. Your
risk
parameter for each signal will be compared against the default trade leverage
variable you have saved on your Signal Provider Group management panel.Examples of
risk
utilization: (All examples use 100% as default trade leverage)- 50 = 50% of the connected exchange account balance
- 100 = 100% of the connected exchange account balance
- 150 = 150% of the connected exchange account balance (1.5x Leverage)
- 200 = 200% of the connected exchange account balance (2x Leverage)
Advanced examples of
risk
utilization:Default trade leverage
is set to 50% on the management portal. Signal post insertsrisk
parameter of 50. This would result in 50% of 50% (25% of the connected balance) being utilized for this signal post.
JSON Type: "String"
Required: Optional if
signal
= closeValid Values:
- Close Percent is limited from "1" - "100" for all markets.
Explanation: This number will be treated as a percent in our systems. If you send a
closepct
for "50" on BTC-USDT-SWAP then our system will look to close 50% of all open positions for this market.Please Keep Minimum Order Sizes In Mind For All Markets When Using This Parameter.
Group leaders can also utilize the "Send Manual Signal" option from their Signal Provider management page to send a manual signal to our system. These signals will be treated the same way as any signal posted through our API.
After pressing the "Send Manual Signal" button, the following popup will display.

Send Manual Signal Popup Available On Group Management Page
Parameters in this popup are precisely the same as when sending a call via API or Webhook to our system. Before utilizing this option, please familiarize yourself with the data structure and capabilities above.
Last modified 1mo ago