Binance Trigger icon

Binance Trigger

Binance Trigger

Overview

The provided source code snippet defines a "Binance Trigger" node for n8n, which is designed to listen for events or data changes from the Binance platform. However, the snippet does not include the implementation of the execute() method or any logic related to the "Candle" operation under the "Default" resource. Instead, it references external modules and sets up the trigger node's metadata and credentials.

Given the context and the properties you provided (Percent Threshold, TimeThreshold, Is Final), the "Candle" operation likely relates to monitoring candlestick data from Binance's market data streams, possibly triggering workflows based on price movement thresholds or timing conditions.

Common scenarios where such a node would be beneficial include:

  • Triggering alerts or automated trades when a candlestick's price change exceeds a certain percentage.
  • Monitoring market conditions over specific time intervals.
  • Reacting to finalized candlestick data for accurate analysis.

Practical examples:

  • A trader wants to execute a buy order if the price increases by more than 2% within a 5-minute candle.
  • An analyst wants to log candle data only after the candle has closed (is final).

Properties

Name Meaning
Percent Threshold A numeric value specifying the minimum percentage change in the candle to trigger action.
TimeThreshold A numeric value representing a time limit or duration relevant to the candle monitoring.
Is Final A boolean indicating whether to consider only finalized (closed) candles for triggering.

Output

The output structure is not explicitly defined in the provided code snippet. Typically, for a candle-related trigger node, the output JSON would include details about the candlestick event that triggered the workflow, such as:

  • Open, high, low, close prices
  • Volume
  • Timestamp of the candle
  • Whether the candle is final or still forming

If binary data were involved (not indicated here), it would typically represent raw data streams or snapshots, but this is unlikely for candlestick data.

Dependencies

  • Requires an API key credential for authenticating with the Binance API.
  • Depends on external modules (./triggers/binance.trigger, ./triggers/binance.properties, and ./methods) which presumably contain the core logic for connecting to Binance and handling events.
  • The node must be configured with valid Binance API credentials in n8n.

Troubleshooting

  • Common issues:

    • Missing or invalid API credentials will prevent the node from connecting to Binance.
    • Network connectivity problems can cause failures in receiving real-time data.
    • Incorrect property values (e.g., negative percent threshold) may lead to unexpected behavior or no triggers firing.
  • Error messages:

    • Authentication errors typically indicate invalid or expired API keys; re-authenticate with valid credentials.
    • Timeout or connection errors suggest network issues; verify internet access and Binance service status.
    • Validation errors on input properties should be resolved by ensuring correct data types and sensible values.

Links and References


Note: The actual execution logic for the "Candle" operation was not present in the provided source code. The above summary is based on typical usage patterns and the given property definitions.

Discussion