Blocks
Building Blocks
Learn about the visual blocks that make up your trading strategies.
AlgoHive strategies are built from four types of blocks that connect together in a visual workflow.
Block Types
Data Sources
Bring market data into your strategy:
- Exchange data — Spot markets (OHLCV)
- Perpetual data — Futures with funding/OI
- Prediction data — Prediction market odds
- Custom data — Your own data sources
Learn more about Data Sources →
Analysis Blocks
Process data and generate signals:
- Value blocks — Constants
- Function blocks — Single indicators
- Compare blocks — Comparisons
- Cross blocks — Crossovers
- Logic blocks — AND/OR/NOT
- Advanced blocks — Multiple outputs
- Code blocks — Custom JavaScript/Python
Learn more about Analysis Blocks →
Entry Rules
Define when to open positions:
- Long entries — Buy expecting price to rise
- Short entries — Sell expecting price to fall
- Prediction entries — YES/NO on prediction markets
Learn more about Entry Rules →
Manage Rules
Control open positions:
- Stop losses — Limit downside
- Take profits — Lock in gains
- Trailing stops — Dynamic protection
- Exits — Signal-based closing
- Position adjustments — Add/reduce
Learn more about Manage Rules →
How Blocks Connect
Blocks connect via edges showing data flow:
Data Source → Analysis → Entry → Manage- Data flows right — From sources through analysis to trading rules
- Signals trigger actions — Boolean outputs from analysis trigger entries
- Rules target entries — Manage rules connect to specific entry rules
Visual Language
Colors indicate data types:
| Color | Meaning |
|---|---|
| Cyan | Numeric values (prices, indicators) |
| Yellow | Boolean signals (true/false) |
| Green | Market/trading connections |
| Orange | Position targeting |
Building Strategies
A complete strategy needs:
- At least one data source — Market data to analyze
- Analysis producing a signal — Boolean output for triggering
- Entry rule using the signal — When condition to enter
- Manage rules — How to exit and protect positions
The simplest strategy might be:
BTC Price Data → RSI Overbought Signal → Short Entry → Stop Loss