🔄 Automating Infinity Algo Alerts via 3Commas

Guide for non-backtest version

Connect Infinity Algo signals directly to 3Commas for automated trading execution.


🎯 Three Integration Methods

Automatic Position Flipping

What it does:

  • Switches Long ↔ Short automatically

  • One bot handles both directions

  • Closes opposite position before opening new

Best for:

  • ✅ Trending markets

  • ✅ Active trading

  • ✅ Maximum efficiency

  • ✅ Less alert management

Setup Requirements
Direction: Reversal (both)
Pairs: Single or Multi-pair (up to 200)
Alerts: 2 total
- Buy Signal → enter_long
- Sell Signal → enter_short

Reversal Behavior:

  • Spot: With Reverse position ON, opposite signal closes & flips; OFF ignores opposite signals

  • Futures Hedge Mode ON: Enable "Reverse position" to flip positions

  • Futures Hedge Mode OFF: Bot automatically closes opposite before opening new

For simplicity, we recommend one pair per bot for reversal workflows.


⚙️ Step 1: Configure Signal Bot

Navigate to 3Commas:

  1. Log in → 3Commas.io

  2. BotsSignal BotCreate Bot

  3. Configure with these settings:

Setting
Value

Name

e.g. Infinity Algo BTC

Exchange

Select your exchange

Pairs

Single or Multi (up to 200)

Alert Type

Custom Signal

Direction

Long / Short / Reversal (both)

TP/SL

Set here or via webhook

Risk Caps

Max Investment, Leverage

For multi-pair bots, also set Max active SmartTrades.


📩 Step 2: Get Webhook Credentials

After saving your bot, find "Message for deal start signal" and copy:

Your Unique Credentials
{
  "secret":   "ab12cd34.ef56gh78…",   // Keep this private!
  "bot_uuid": "f1a2b3c4-…-9d0e1f2a",  // Your bot's ID
  "action":   "enter_long",
  "tv_exchange": "{{exchange}}",
  "tv_instrument": "{{ticker}}"
}

📊 Step 3: Create TradingView Alerts

Alert Configuration

Field
Value

Condition

Match your Infinity Algo signal exactly

Options

Once Per Bar Close (not "Once Per Bar")

Webhook URL

https://api.3commas.io/signal_bots/webhooks

Message

JSON template with YOUR-SECRET & YOUR-UUID

Important: Alert condition must match your Infinity Algo signal names exactly, including any numeric prefixes


📝 JSON Templates

enter_long.json
{
  "secret": "YOUR-SECRET",
  "bot_uuid": "YOUR-UUID",
  "action": "enter_long",
  
  "tv_exchange": "{{exchange}}",
  "tv_instrument": "{{ticker}}",
  
  "order": { 
    "amount": 150, 
    "currency_type": "quote",
    "order_type": "market"
  },
  
  "take_profit": {
    "enabled": true,
    "steps": [
      { "order_type": "limit", "price_percent": 1, "volume_percent": 25 },
      { "order_type": "limit", "price_percent": 2, "volume_percent": 25 },
      { "order_type": "limit", "price_percent": 3, "volume_percent": 25 },
      { "order_type": "market", "price_percent": 4, "volume_percent": 25 }
    ]
  },
  
  "stop_loss": { 
    "enabled": true, 
    "order_type": "market", 
    "trigger_price_percent": 1 
  },
  
  "max_lag": 300,
  "timestamp": "{{timenow}}"
}

Note: For limit entry, add "price" or "price_percent" with optional "price_percent_ref_type"


⚡ Quick Reference

Parameter
Purpose
Values

price_percent

TP distance from entry

Integer: 1 = 1%, 2 = 2%

volume_percent

% of position to close

Must sum to 100%

trigger_price_percent

Stop loss distance

Integer: 1 = 1% loss

currency_type

Order size unit

quote, base, margin_percent, position_percent

amount

Position size

Number based on currency_type

max_lag

Reject stale signals

Seconds (300 = 5 min)

timestamp

Signal freshness

Always use {{timenow}}

price_percent_ref_type

Price reference for limit

current_price, base_entry_price, avg_entry_price


🎯 Which Method Should You Use?

Feature
🔄 Reversal Bot
🎯 Clean Exit
⏹️ Panic Stop

Best For

Trending markets

Continuous trading

Emergency stops

Alerts Needed

2 (minimal)

3 (entry/exit/re-entry)

1 (stop all)

Position State

Always in

Flexible gaps

Fully closed

Bot Status

✅ Always active

✅ Always active

❌ Disabled

Re-entry

Automatic

Automatic

Manual required

Ideal Trader

Active/Confident

Flexible/Cautious

Risk-averse

Choose Reversal if you:

  • Trade trending pairs

  • Trust your signals

  • Want set-and-forget

Choose Clean Exit if you:

  • Need position control

  • Trade multiple pairs

  • Want gap periods


🚀 Advanced Features

Up to 8 Take Profit Levels

  • UI supports up to 4 levels

  • JSON supports up to 8 levels

  • Volumes must total 100%

  • Can mix limit & market orders

  • Trailing only on last step

Example: 8-Level TP with Trailing
"take_profit": {
  "enabled": true,
  "steps": [
    { "order_type": "limit", "price_percent": 1, "volume_percent": 20 },
    { "order_type": "limit", "price_percent": 2, "volume_percent": 20 },
    { "order_type": "limit", "price_percent": 3, "volume_percent": 15 },
    { "order_type": "limit", "price_percent": 4, "volume_percent": 15 },
    { "order_type": "limit", "price_percent": 5, "volume_percent": 10 },
    { "order_type": "limit", "price_percent": 6, "volume_percent": 10 },
    { "order_type": "limit", "price_percent": 7, "volume_percent": 5 },
    { "order_type": "market", "price_percent": 8, "volume_percent": 5,
      "trailing": { "enabled": true, "percent": 0.2 }
    }
  ]
}

🛠️ Troubleshooting Checklist

✅ Check
Details

Valid Credentials

JSON must include valid secret and bot_uuid

Required Fields

Always include tv_exchange and tv_instrument in ALL signals

Correct Webhook URL

Must be exactly https://api.3commas.io/signal_bots/webhooks

Alert Timing

Alerts fire Once Per Bar Close (not "Once Per Bar")

One Alert Per Action

Never combine entry & exit in one JSON

Field Names

Use price_percent not price_deviation

Volumes Sum to 100

All volume_percent must total exactly 100

Exit Orders

Exit signals use market execution only - no limit orders

Signal Freshness

Include max_lag and timestamp to prevent stale signals

Bot Re-enabling

If using disable, must manually re-enable bot

Exit Not Working

Check bot's Minimum profit/Deal close conditions


📖 JSON Field Glossary

Field
Purpose
Values & Rules

secret

Private bot token

Required - Copy exactly from Step 2

bot_uuid

Unique Signal Bot ID

Required - Copy from Step 2

action

Bot command

Required - enter_long, enter_short, exit_long, exit_short, disable

tv_exchange

TradingView exchange

Required - Always {{exchange}}

tv_instrument

TradingView pair

Required - Always {{ticker}}

positions_sub_action

When action is disable

market_close → flatten & disable cancel → cancel only

order.amount

Position size

Based on currency_type setting

order.order_type

Entry order type

market or limit (limit needs price or price_percent)

currency_type

Unit for amount

quote, base, margin_percent, position_percent

price

Exact limit price

For limit orders - exact price value

price_percent

TP/limit distance

Integer: 1 = 1%, 2 = 2%

price_percent_ref_type

Reference for percent

current_price, base_entry_price, avg_entry_price

volume_percent

% to close at each TP

1-100 (must sum to 100%)

trigger_price_percent

Stop loss trigger

Integer: 1 = 1% loss

max_lag

Signal age limit

Seconds (300 = 5 minutes)

timestamp

Current time

Always {{timenow}}


📚 Resources

Last updated

Was this helpful?