Documentation

Trading Algorithm Documentation

Complete guide for setting up and using AgaTech trading algorithm

📘 Getting Started Setup

⚙️ Get Your Telegram ID

  1. In Telegram search for @userinfobot
  2. Type /start
  3. @userinfobot will reply with your Telegram ID
  4. Copy and paste your Telegram ID in the "Telegram Chat ID" field

⚙️ Exchange API Setup

After payment verification, a specialist will contact you on Telegram. They will send you the server IP address that needs to be configured in your exchange API management.

Binance

https://www.binance.com/en/my/settings/api-management

  1. Click Create API, then System generated
  2. Enter any name in the "Label API Key to proceed" field
  3. Click Edit restriction
  4. In "Restrict access to trusted IPs only (Recommended)" paste the IP sent by the specialist
  5. Set permissions as shown in the screenshot
  6. Binance API settings

    Binance API permission settings

  7. Send the specialist your API Key and Secret Key
  8. Wait for the Telegram bot link to manage the algorithm

Gate

https://www.gate.com/myaccount/profile/api-key/manage

  1. Click Create API Key, then Trading Account
  2. Enter any name in the "API Key Remark" field
  3. In "IP Permissions" paste the IP sent by the specialist
  4. Enable Permissions: Spot Trade, Wallet, Account
  5. Set permissions as shown in the screenshot
  6. Gate API settings

    Gate API permission settings

  7. Send the specialist your API Key and Secret Key
  8. Wait for the Telegram bot link to manage the algorithm

📘 Trading Algorithm Documentation for Market Makers, Funds, Traders

This strategy is one of several included in your trading algorithm suite, which includes:

  • 💠 Market Making
  • ⚖️ Arbitrage
  • 📈 Directional Trading

Below describes the main strategy - Aroon Oscillator, designed for market makers, funds and professional traders. It uses the Aroon Oscillator indicator to determine trend strength and automatically adapts spreads, volumes and TP levels to market conditions.

Important:

  • If a command has quotes ' ', the value must be enclosed in quotes.
  • If there are no quotes - you can enter the value without quotes.

⚙️ Basic Telegram Bot Commands

▶️ /start

Starts the strategy. After activation, the bot will begin placing orders with current parameters.

/start

⏳ After Starting the Algorithm

After the /start command, the algorithm needs 2-5 minutes for full initialization:

  • During this time the bot connects to the exchange
  • Loads historical candles
  • Calculates the indicator
  • Prepares parameters for placing orders

This is normal behavior - orders will appear automatically after calculations complete. Do not restart or relaunch the strategy during this period.

⏹ /stop

Stops the strategy. All active orders are canceled, positions are preserved.

/stop

🚪 /exit

Ends the current session where the algorithm is running. Used before restarting or deleting the database.

/exit

🔄 /restart

Restarts the process after the /exit command. Used to update the algorithm state and restart after database deletion.

/restart

🗑️ /del

Deletes the algorithm database file. Used when you need to start work from a "clean slate".

/del

⚙️ /setconfig1 <parameter> '<value>'

Changes the value of the first strategy setting (Config1). Used for fine-tuning the algorithm logic.

/setconfig1 minimum_spread '0.005'
/setconfig1 take_profit_long '0.01'
/setconfig1 order_levels 3

⚠️ If the example has quotes ' ', enter exactly like that. If there are no quotes - you can enter without them.

📄 /showconfig1

Shows current parameters of the first strategy (Config1).

/showconfig1

📄 /showconfig2

Shows parameters of the second strategy (Config2) - for example, arbitrage or market making for another pair. You can trade simultaneously on two trading pairs, using /showconfig1 for the first and /showconfig2 for the second.

/showconfig2

💱 Simultaneous Trading on Two Pairs

Your bot supports parallel operation of two strategies. For example:

  • /setconfig1 trading_pair BTC-USDT - first strategy (Config1)
  • /setconfig2 trading_pair ETH-USDT - second strategy (Config2)

Both will work simultaneously, independently of each other. Settings for each can be viewed and changed separately.

🧩 Detailed Parameter Description for /setconfig1

Below are parameters available for modification via the /setconfig1 command. Each is accompanied by a brief and clear explanation.

Parameter Description Example
connector_name Exchange name (e.g. binance, kucoin) /setconfig1 connector_name binance
trading_pair Trading pair the strategy works with. Format: BASE-QUOTE /setconfig1 trading_pair BTC-USDT
candles_interval Candle interval used for analysis (1m, 5m, 1h) /setconfig1 candles_interval 1m
total_amount_quote Total strategy capital in quote currency (in USDT) /setconfig1 total_amount_quote '1000'
order_amount Size of one limit order in USDT. At start, this amount must be in USDT or base currency, otherwise orders won't be placed /setconfig1 order_amount '25'
minimum_spread Minimum spread between buy and sell orders (in fractions). 0.01 = 1% /setconfig1 minimum_spread '0.005'
maximum_spread Maximum spread at which strategy can place orders /setconfig1 maximum_spread '0.008'
aroon_osc_strength_factor Strength of Aroon indicator influence on spread changes. Higher value = stronger reaction to trend /setconfig1 aroon_osc_strength_factor '0.5'
period_length Number of candles used for Aroon Oscillator calculation /setconfig1 period_length 25
minimum_periods Minimum number of candles for correct indicator calculation /setconfig1 minimum_periods -1 (starts calculation without waiting for candle count)
order_levels Number of order levels in grid. 1 - one order per side, 3 - three levels per side /setconfig1 order_levels 3
order_level_amount Fixed volume (in base currency) per order level. If 0, calculated automatically /setconfig1 order_level_amount '0.1'
order_level_spread Additional distance between order levels (in price fractions) /setconfig1 order_level_spread '0.01'
price_ceiling Upper price boundary. If market is above this value - buying is suspended /setconfig1 price_ceiling '1.25'
price_floor Lower price boundary. If market is below - selling is suspended /setconfig1 price_floor '0.75'
recreate_order_interval Minimum time (in seconds) between order recreation /setconfig1 recreate_order_interval 0.01
order_lifetime Limit order lifetime (in seconds). After expiration - order is canceled and recreated /setconfig1 order_lifetime 10.0
take_profit_long Profit target (in fractions, 0.01 = 1%) for closing long positions /setconfig1 take_profit_long '0.01'
take_profit_short Profit target for short positions /setconfig1 take_profit_short '0.015'
take_profit_order_lifetime Take-Profit order lifetime (in seconds) /setconfig1 take_profit_order_lifetime 1800.0
take_profit_respect_limits If true, TP is not placed beyond price_floor and price_ceiling /setconfig1 take_profit_respect_limits true
database_path Path to database (SQLite) where trades and positions are saved /setconfig1 database_path /var/data/trades.sqlite

After changing parameters, it's recommended to execute:

/stop
/start

to apply new settings. The strategy doesn't close positions when stopped - only cancels active orders.

⚙️ Other Strategies

  1. Config1 - Aroon Oscillator strategy (this documentation)
  2. Config2 - can be arbitrage or market making strategy on another pair
    • Management commands: /setconfig2, /showconfig2
    • You can trade simultaneously on two trading pairs

⏱️ Important About Pauses Between Commands

Commands require time to execute. Always pause between clicks - from 10 seconds to several minutes, depending on the current task and data volume. Don't run commands consecutively until the previous operation completes. If the bot is performing a long operation (like closing orders or deleting database), wait for confirmation before entering the next command.

🧩 Database Deletion Rules

Sometimes manual intervention in algorithm operation is necessary to close part of positions through the exchange website. In this case, it's important to synchronize the algorithm state with actual trades. Procedure: /stop → /exit → /del → /restart

After completing these steps, the algorithm will create a new database and start work from scratch.

⚠️ If the algorithm doesn't start after database deletion, repeat the command sequence:
/stop → /exit → /restart

📘 Reminder

Database deletion completely clears trade history and positions. Use this procedure only when manually intervening in operation.

📈 Summary:
The bot allows launching multiple trading strategies, each with its own set of settings. Commands /showconfig1 and /showconfig2 allow controlling parameters of both strategies, and /start and /stop manage their activity.