Skip to main content

Capitalise.ai Strategy Syntax & Reference Guide

Learn how to build trading strategies in Capitalise.ai with clear syntax, examples, and a conceptual entry → exit flowchart.

Josh avatar
Written by Josh
Updated over a week ago

1. General Rules

  • Boolean types are not available.

  • You can chain as many ANDs as you want, or as many ORs as you want, but cannot mix AND and OR in the same sentence.

  • Asset placement: Asset names can appear before or after the condition for readability.

Example:

if EURUSD is above EURUSD MA(200, Day, Close)and if EURUSD is above 50-day MA of EURUSD

Entry structure:

IF ... and if ... and if ... then buy/sell ... 
OR
IF ... or if ... or if ... then buy/sell ...

Exit structure:

Close position if ... (conditions) or at profit/loss ...
OR
Close position if ... (conditions) and at profit/loss ...
  • All conditions are checked simultaneously, regardless of the order they are written in.


2. Building Blocks

Category

Examples

Notes

Asset

TSLA, NVDA, EURUSD, BTCUSDT

Can appear before or after conditions

Indicators

MA, EMA, RSI, MACD, Stochastic, StochasticRSI, Pivot Points, Bollinger Bands

Timeframe can be 5m, 1h, 1d, etc.

Operators

crosses above, crosses below, is above, is below, <, >, <=, >=

"=" by itself is not available

Price / Change Conditions

daily change is positive/negative, price rises/falls X%, price moves X pips

Actions

buy/sell [amount] USD / EUR / CAD / USDT WORTH of [asset], or [quantity] units of [asset]

Entry

Exits

close position at profit of X% or loss of Y%, close position if [condition]

Exit

Connectors

and if, or if

Cannot mix AND and OR in the same sentence

Values

numeric values, % values, pips

e.g., 10,000 USD, 0.35%, 10, 5 pips


3. Syntax / Grammar Tree

<strategy> ::= <entry> | <exit> 

<entry> ::= "IF" <condition> { "and if" <condition> } "then" <action>
| "IF" <condition> { "or if" <condition> } "then" <action>

<exit> ::= "Close position if" <condition> { "or if" <condition> } [ "or at profit of" <percent/amount/pips> ] [ "or loss is at" <percent/amount/pips> ]

<condition> ::= <asset> <indicator_or_price> <operator> <value_or_indicator>
| <asset> <daily_change> <operator> <value>
| <asset> <price_change_in_pips> <operator> <value>

<action> ::= "buy" <amount> (USD | EUR | CAD | USDT ) "WORTH of" <asset>
| "sell" <amount> (USD | EUR | CAD | USDT ) "WORTH of" <asset>
| "buy" <quantity> "units of" <asset>
| "sell" <quantity> "units of" <asset>

4. Examples

Entries

if TSLA MACD Line(12, 26, 9, 5m, Close) crosses above the signal line and if TSLA MACD Line(12, 26, 9, 5m, Close) is below 0 then buy 10 TSLA 

if NVDA MA(10, 1h, Close) crosses above NVDA MA(30, 1h, Close) and the NVDA daily change is positive then buy 2,000 USD WORTH of NVDA

if EURUSD is above EURUSD MA(200, Day, Close) and if EURUSD is above 50-day MA of EURUSD then buy 1000 EURUSD

if BTCUSDT(Binance) price rises by 0.5% from BTC/USDT(Binance) 1 hour close and if BTCUSDT(Binance) RSI(14, 1h, Close) < 70 then buy 0.1 BTCUSDT(Binance)

Exits

close position at profit of 1.5% or loss is at 2.7% 

close position if the MA(10, 1h, Close) of NVDA crosses below NVDA MA(50, 1h, Close) or at profit above $500

close position if BTCUSDT(Binance) RSI(14, 1h, Close) is above 80 and if profit is above 5%

5. Notes / Best Practices

  • Asset name can appear before or after conditions.

  • Choose either all ANDs or all ORs per entry/exit sentence.

  • Multiple simultaneous positions are not allowed; each strategy completes one entry → exit cycle before re-entering.

  • Percent-based or pip-based moves should reference a clear baseline: e.g., previous 1m bar close, current 1m bar open, or current hour open.


6. Conceptual Visual Flow / Diagram

Entry Strategy

       IF 

┌───────┴───────┐
│ Condition 1 │
│(BTC price ↑0.5%)│
└───────┬───────┘
│ AND/OR
┌───────┴───────┐
│ Condition 2 │
│ (RSI < 70) │
└───────┬───────┘

Execute(Then) Buy 0.1 BTC

[Cycle]

Exit Strategy

   Close position 

┌───────┴───────┐
│ Condition 1 │
│ (RSI > 80) │
└───────┬───────┘
│ AND/OR
┌───────┴───────┐
│ Condition 2 │
│ (Profit > 5%) │
└───────┬───────┘

[End]


Notes:

  • All conditions are evaluated simultaneously.

  • Entry actions trigger Buy/Sell.

  • Exit actions trigger closing the position and realizing profit/loss.

  • Strategy completes one full cycle before re-entering.


Note: All screenshots and examples are for technical demonstration purposes only. They should not be considered as recommendations for any specific trading strategy, nor do they constitute any form of advice. Please click here for further explanation

Did this answer your question?