📊 Data Blocks Reference

Access market data and price information for your trading algorithms

Overview

Data blocks provide access to market data and price information. These blocks are the foundation of your trading strategy, allowing you to retrieve current and historical price data for any ticker symbol.

Data: Ticker

REQUIRED

Defines the ticker symbol(s) your algorithm will trade. This is a required block that must be included at the beginning of every algorithm.

What it does
  • Sets the ticker symbol(s) to trade (e.g., AAPL, TSLA)
  • Retrieves current price data for the symbol
  • Selects price value (latest price, close, open, high, low)
  • Selects timeframe (1s, 1m, 5m, 1h, 1d)
  • Selects price timing (event-driven ticks or completed bars only)
  • Provides access to OHLCV (Open, High, Low, Close, Volume) data
  • Works with both single symbols and multiple symbols
When to use
  • Every algorithm - This block is mandatory
  • Single-symbol strategies (e.g., trade only AAPL)
  • Multi-symbol strategies (e.g., pairs trading)
  • Sector rotation strategies
📋 Example: Basic Price Access
Strategy: Buy when price dips below a realistic level (example: $225), sell above $235
1. source1 = Data: Ticker (AAPL, 1m, latest price)
2. lt1 = Condition: A < B (source1_price, 225)
3. gt1 = Condition: A > B (source1_price, 235)
4. buy1 = Action: Buy (symbol=AAPL, 10 shares, Market, when=lt1)
5. sell1 = Action: Sell (sell_all_from=buy1, Market, when=gt1)
📋 Example: Multi-Symbol Trading
Strategy: Relative strength rotation - buy the stronger symbol
1. source1 = Data: Ticker (AAPL, 1m)
2. source2 = Data: Ticker (MSFT, 1m)
3. gt1 = Condition: A > B (source1_price, source2_price)
4. lt1 = Condition: A < B (source1_price, source2_price)
5. buy1 = Action: Buy (symbol=AAPL, cash=$10,000, when=gt1)
6. buy2 = Action: Buy (symbol=MSFT, cash=$10,000, when=lt1)
💡 Pro Tip: Configure the ticker block to control what the rest of your strategy sees:
  • Price Value - latest price, close, open, high, low
  • Timeframe - 1s, 1m, 5m, 1h, 1d
  • Price Timing - event-driven ticks or completed bars only (match backtest)
  • Multiple symbols - add additional Data: Ticker blocks to drive multi-symbol logic

Quick Reference

Block Description Use Case Required
Data: Ticker Sets the ticker symbol(s) to trade and provides access to price data All strategies - retrieve current/historical price data ✅ Yes

Common Data Access Patterns

1. Simple Price-Based Strategy

source1 = Data: Ticker (SPY, 1m)
lt1 = Condition: A < B (source1_price, 400)
gt1 = Condition: A > B (source1_price, 450)
buy1 = Action: Buy (symbol=SPY, 10 shares, when=lt1)
sell1 = Action: Sell (sell_all_from=buy1, when=gt1)

Use when you need basic price information for buy/sell decisions

2. Multi-Timeframe Filter

source1 = Data: Ticker (TSLA, 1m)
source2 = Data: Ticker (TSLA, 1h)
sma1 = Indicator: SMA (source2, length=50)
gt1 = Condition: A > B (source1_price, sma1)
buy1 = Action: Buy (symbol=TSLA, cash=$10,000, when=gt1)

Use a higher timeframe trend filter before taking lower timeframe entries

3. Range-Based Trading

source1 = Data: Ticker (AAPL, 1m, high)
source2 = Data: Ticker (AAPL, 1m, low)
source3 = Data: Ticker (AAPL, 1m, latest price)
lt1 = Condition: A < B (source3_price, source2_price)
gt1 = Condition: A > B (source3_price, source1_price)
buy1 = Action: Buy (symbol=AAPL, 10 shares, when=lt1)
sell1 = Action: Sell (sell_all_from=buy1, when=gt1)

Use for support/resistance or mean reversion strategies

4. Relative Strength Rotation

source1 = Data: Ticker (GLD, 1d)
source2 = Data: Ticker (SLV, 1d)
crossover1 = Condition: Cross Over (source1_price, source2_price)
crossover2 = Condition: Cross Over (source2_price, source1_price)
buy1 = Action: Buy (symbol=GLD, cash=$10,000, when=crossover1)
buy2 = Action: Buy (symbol=SLV, cash=$10,000, when=crossover2)

Use for relative strength rotation between correlated assets

Best Practices

✅ Do:
  • Always include a Data: Ticker block at the start of your algorithm
  • Use meaningful ticker symbols (e.g., "AAPL", "SPY", "TSLA")
  • Verify ticker symbols are valid before running live
  • Use multi-symbol strategies for diversification
  • Cache price data when possible to reduce API calls
❌ Don't:
  • Use invalid or delisted ticker symbols
  • Trade illiquid symbols with wide bid-ask spreads
  • Forget to handle missing data (e.g., market closed, symbol not found)
  • Hardcode prices - always retrieve current data
  • Make excessive API calls - use appropriate refresh intervals

📊 Tier-Based Data Access

Data refresh rates vary by account tier and SIP subscription:

Tier SIP Status Refresh Rate Feed
Standard / Elite Eligible No SIP 1 minute IEX (free)
Standard / Elite Eligible With SIP ($9/mo) 1 second SIP (real-time)
Elite ($100K+) SIP Included 1 second SIP (free)
Institutional SIP Included 500ms SIP (custom limits)

💡 Tip: For day trading and scalping strategies, real-time data (1-second refresh) is essential. Consider SIP for Standard/Elite Eligible tiers or Elite for included SIP.