Webhook Signals: Testing and Errors
How to test
There are two useful ways to test the webhook signals and code.
In the JSON code, use “test”: true to send the signal as a test signal. This will create Pending orders in Altrady that can be checked. Otherwise, live orders will be created.
Test using a paper trading account.
Test the syntax in Swagger:
First, exclude any Trading View special names e.g. {{ price }}, {{ time }}. These can be replaced with appropriate fixed values, e.g 123.45 and "2024-08-31 03:00:00", respectively. If used, the value of the Signal ID must be unique in every signal, including for test signals in Swagger.
Paste
Use "test": true while testing. If this is not used, the signal will be sent to the bot and potentially a position will be opened/closed etc.
Try it now
See below for error messages when testing in Swagger i=or sending live signals
![](https://storage.crisp.chat/users/helpdesk/website/6dec030fcf420800/swagger-1_fpxg5x.png)
Error messages in Swagger and Runtime errors
Successful Result: Response Code = 201 (200, 202, 203 etc)
A 20x response code means the syntax was correct, the bot was found, the secret matched, exchange and symbol matched bot and the signal was received.
Some types of signals do not return a Response Body, e.g. Close, Start and Stop signals.
![The Response Body includes success and error messages. Response Code is 20x if successful](https://storage.crisp.chat/users/helpdesk/website/6dec030fcf420800/swagger-error-2_13qa4y.png)
Most error messages are self-explanatory.
Check the Signal Bot Settings and JSON code articles for details of how to specific values.
The exception is the first one listed in the table below, which is always the result of a syntax error in the JSON code. Check carefully and make sure if matches our documentation.
Error Message | Meaning |
---|---|
message body does not match declared format\nResolution:\n when specifying application/json as content-type, you must pass valid application/json in the request's 'body' | Syntax error in the JSON. Double check commas, brackets, braces, double quotes, etc. This error can also occur if the code was created or edited in a non-text editor. |
Signal bot not found | Invalid API key |
Invalid secret | API Key is valid and found, but API secret is incorrect |
Market not found | The value for market does not match any market. Recheck the format for the market or use Altrady's default format "EXCH_QUOTE_BASE", e.g. "KUCN_USDT_BTC" |
Exchange missing | Either exchange was not specified, or the value was not valid. |
side is missing | "side": "long" or "side": "short" is required for this signal action |
order_type is missing | "order_type": "limit" or "order_type": "market" is required for this signal action |
price is missing | the setting for "price" is required for this signal action, but is missing. When a Limit order is specified for a Close signal, the signal_price setting must be included |
signal_price is invalid, price is missing | This is a double whammy. "signal_price" should not be used for this signal type. And "price" is required but missing. |
price is invalid, price must be greater than zero | The value for the "price" setting is zero, or non-numeric. |
404: Not Found | There were no syntax errors. For a Close signal, this means that no positions were found to Close. |
Checking the signal
The signal sent by Trading view can be seen in teh TV Alert Log.
The signal details in Altrady can be viewed on the Overview, Positions and Error Log pages of the Signal Bot, by clicking on the i next to the market name.
![](https://storage.crisp.chat/users/helpdesk/website/6dec030fcf420800/view-signal_1akw51d.png)
Signal Bot Error Log
The SIgnal Bot error log lists errors that occur after the signal is successfully received, but the signal is not actioned.
Common warnings and ewrrors are describer here: Signal Bot Processing, FAQ and Error Log messages
Related Articles
Webhook and Trading View SIgnals: Overview
Webhook: Setting up the Signal Bot
Webhook Signals: Open, Close, Increase or Reverse a Position
Webhook Signals: start or stop a Signal Bot
Valid values for Exchange and Symbol
Webhook Signals: Trading View Setup
Updated on: 31/08/2024
Thank you!