Welcome! ๐ This guide shows you how to tell your trading bot what to watch for and what to do, using a simple rule language that looks a bit like SQL. Imagine you're giving your bot step-by-step instructions, like teaching a friend how to play a game! ๐น๏ธ
You write rules to tell your bot:
Think of your bot as a security guard:
Every rule is like a recipe:
Example:
IF stopLoss ticks=30
TICK volume WITH minutes=3 > 50 THEN
order SET size=100, price=51.25, transmit=true
This means:
๐ The bot sets a stop loss of 30 ticks, watches the volume for the last 3 minutes, and if it's above 50, it places an order for 100 shares at $51.25.
IF stopLoss ticks=30
(The bot puts a stop loss of 30 ticks in place, before anything else.)TICK volume ...
POS calculatePosition ...
WITH minutes=3
(Look at the last 3 minutes)THEN order SET ...
Metaphor:
It's like:
IF
(put on helmet) THEN
TICK
(watch the road WITH sunglasses) > 50
THEN
(pedal faster!)
TICK volume WITH minutes=3 > 50 THEN
order SET size=100, price=51.25, transmit=true
POS calculatePosition size=100, entryPrice=50.25 > 51.00 THEN
position SET stopLoss=50.75, transmit=true
TICK ema WITH period=20 > 50.25 THEN
order SET size=100, price=51.00, transmit=true
order SET size=100, price=51.25, transmit=true
stopLoss
โ Put a stop loss on your tradetakeProfit
โ Set a target for taking profittrailingStopLoss
โ Make your stop loss follow the priceIF stopLoss ticks=30
volume
โ How many shares tradedema
โ Exponential moving averagevolatility
โ How much price jumps aroundrsi
โ Relative Strength IndexTICK ema WITH period=20 > 50.25 THEN ...
IF stopLoss ticks=30
TICK volume WITH minutes=3 > 50 THEN
order SET size=100, price=51.25, transmit=true
POS calculatePosition size=100, entryPrice=50.25 > 51.00 THEN
position SET stopLoss=50.75, transmit=true
TICK volume WITH minutes=5 > 1000 THEN
order SET size=50, price=51.25, transmit=true
TICK volume WITH minutes=5 > 1000 AND
price > 50.25 THEN
order SET size=100, price=50.50, transmit=true
IF trailingStopLoss ticks=30
TICK price WITH minutes=5 > 51.00 THEN
position SET trailingStopLoss=25, transmit=true
POS calculatePosition size=100, entryPrice=50.25 > 51.00 THEN
order SET size=50, price=51.25, transmit=true
price=50.25
(dollars)size=100
(shares)ticks=30
(distance)minutes=5
hours=1
transmit=true
(do it now)isActive=false
>
, <
, =
, and THEN
size=100, price=51.25
transmit=true
if you want the bot to act right awayStart with a tiny rule, see what the bot does, then add more!
Every part of your rule tells the bot what to watch and what to doโjust like giving instructions to a smart assistant.
Happy trading! ๐