Strategy language reference
How to write strategy descriptions that the AI parser handles well — syntax, timeframes, operators, and tips.
Coinrule uses natural language as its primary input format. There is no formal DSL — you describe your strategy in plain English (or plain code) and the AI interprets it.
Which candle intervals are supported?
1m5m15m30m1h4h1dHow do you describe entry and exit conditions?
Describe conditions using indicator names and comparison operators:
RSI(14) is below 30EMA(20) crosses above EMA(50)price breaks above Bollinger upper bandATR(14) is greater than 0.5% of price
Multiple conditions joined with "and" are ANDed together. The AI translates these into Python evaluate() logic.
How do you describe exits?
You can describe exits as conditions or time-based:
close when RSI(14) is above 70close after 48 hoursstop loss at 3%take profit at 8%trailing stop 2%
Multiple exit conditions can coexist — the engine fires whichever triggers first.
How do you specify position sizing?
buy 10% of balancebuy $500 worthbuy $200 per signal
How do you limit concurrent positions?
Use max_open_positions to cap how many concurrent positions a strategy (especially a scan strategy) can hold simultaneously. For example: max 5 positions at once. Setting this to null or not specifying it means the strategy will open positions for every signal independently.
max_open_positions: 0 blocks the strategy from opening any new positions immediately. To remove the cap, set it to null (or leave it unspecified).
Scan (multi-market) strategies
For scan strategies, you can describe the universe:
scan top 50 coins by volumescan BTC, ETH, SOL
See Scan and multi-market strategies.
What are tips for better parses?
- Be specific about indicator periods:
RSI(14)not justRSI - Specify the candle interval:
on 1h candles - Mention the asset:
for BTC/USDT on Binance - Describe the position direction:
long onlyorboth long and short