API

This API enables users to automate trading strategies by crafting custom signals that respond to specific market conditions. This allows seamless integration with tools like TradingView or custom scripts in Python and other languages.

Custom Signals function similarly to TradingView webhooks—triggering trading rules based on external inputs. You have full flexibility to connect any signal-generating system to Coinrule via webhook.

Understand the Signal API

Explore the /signal endpoint and its related data models to understand how to format and send your custom trading signals correctly:

  • /signal Endpoint This single endpoint receives your trading signals. It accepts a JSON payload defined by the payload schema.

  • Data Schemas These models describe the structure of signals and related data:

    1. Payload Schema – defines fields like signal, symbol, and any additional metadata.

    2. Response Schema – outlines what Coinrule returns after signal ingestion.

    3. Error Schema – details formats for error responses if your signal is invalid or malformed.

Getting Started

Use the following steps to implement your custom signal and start automating trades:

  1. Create a new rule in Coinrule, see the example below for TradingView signals (change this to "Custom Signal" for other integrations).

  2. After setup, click Launch to activate the rule.

    • Custom Signals: Each rule will generate a unique webhook URL. Send your custom signal to this endpoint to trigger the rule.

    • TradingView SIgnals: After clicking, 'Launch' a pop-up opens with settings for TradingView - this provides the Webhook URL and Message. Do not launch the rule again yet as we need to copy and paste these details when creating the TradingView alert.

  3. Configure Your Signal Source: TradingView alerts, Python scripts, any external script that sends HTTP requests.

  4. If your rule supports both BUY and SELL, your message should include an "ACTION" placeholder. Your script must replace it with "buy" or "sell" depending on the condition.

  5. Select from a variety of programming languages to match your development preferences:

    • cURL

    • Python

    • JavaScript

Step-by-Step Guides

For a complete setup walkthrough, refer to the following official guides:

Watch the tutorial video for a hands-on demonstration of the TradingView signal integration process:

For additional help, visit our Help Center or the Open API Specification.

Last updated