Skip to main content

Advanced Parameters

Advanced and system-level parameters for fine-tuning signal processing.

processing_delay​

  • Type: float
  • Required: No
  • Description: Delay in seconds before processing the signal

Useful for coordinating multiple signals or ensuring specific timing.

Example​

{
"strategy_key": "your_key",
"position_side": "MOVE_STOP_LOSS",
"stop_loss_price": 49000,
"processing_delay": 3.0
}

Use Cases​

  • Coordinate entry and stop loss updates
  • Wait for order fills before next signal
  • Implement specific timing strategies
  • SET_ORDERS automatically adds 3-second delay

Cache Parameters​

leverage_cache_expiry_seconds​

  • Type: integer
  • Required: No
  • Description: Cache expiry time for leverage settings

Reduces API calls to exchange by caching leverage info.

balance_cache_expiry_seconds​

  • Type: integer
  • Required: No
  • Description: Cache expiry time for balance information

Reduces API calls to exchange by caching balance data.

Example​

{
"strategy_key": "your_key",
"position_side": "LONG",
"leverage_cache_expiry_seconds": 300,
"balance_cache_expiry_seconds": 300
}

is_paper_strategy​

  • Type: boolean
  • Required: No
  • Do not send this field.

Paper or live is a setting of the bot, chosen in the app. Signals for a paper bot are always executed on paper. Create the bot as a paper bot to test, and switch it to live in the app when you are ready.

Paper trading:

  • No real orders are placed on the exchange
  • Execution and P&L are simulated on real market data
  • No exchange connection is required
  • There are no exchange-side stop-loss or take-profit orders: send a CLOSE when your stop or target is hit

pinescript_code_version​

  • Type: string
  • Required: No
  • Description: Version of TradingView PineScript code

Current Versions​

  • opt_v6
  • plus_v178
  • v108

Example​

{
"strategy_key": "your_key",
"pinescript_code_version": "opt_v6"
}

Purpose​

  • Tracks which PineScript version user is using
  • System warns if newer version available
  • Helps with backward compatibility
  • Useful for support and debugging

beta_params​

  • Type: dictionary
  • Required: No
  • Description: Experimental parameters for testing new features

Example​

{
"strategy_key": "your_key",
"position_side": "LONG",
"beta_params": {
"feature_flag": "new_order_type",
"param1": "value1"
}
}

Details​

  • Used for testing unreleased features
  • Structure varies by feature
  • Contact support for available beta features
  • Not recommended for production use

received_at​

  • Type: float (timestamp)
  • Required: No (automatically set by server)
  • Description: Unix timestamp when signal was received

Details​

  • Automatically set by OptAlgo system
  • Don't include in your signals
  • Used for internal tracking and logging
  • Appears in logs and analytics

Complete Advanced Example​

{
"strategy_key": "your_key",
"exchange": "BINANCE",
"ticker": "BTCUSDT.P",
"position_side": "LONG",
"action": "BUY",
"entry_price": 50000,
"is_paper_strategy": true,
"processing_delay": 2.0,
"leverage_cache_expiry_seconds": 300,
"balance_cache_expiry_seconds": 300,
"pinescript_code_version": "opt_v6"
}

Best Practices​

1. Use Paper Trading for Testing​

{
"is_paper_strategy": true
// Test without risk
}

2. Add Delays for Complex Workflows​

// Step 1: Open position
{
"position_side": "LONG"
}

// Step 2: Update with delay (separate signal)
{
"position_side": "MOVE_STOP_LOSS",
"processing_delay": 5.0
}

3. Optimize Cache for High-Frequency​

{
"leverage_cache_expiry_seconds": 60,
"balance_cache_expiry_seconds": 60
}

4. Track PineScript Versions​

Always include version in TradingView signals:

{
"pinescript_code_version": "opt_v6"
}

Next Steps​