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=trueThis 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 pnlTicks ...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=truePOS pnlTicks > 5 THEN stopLoss SET ticks=30, transmit=trueTICK ema WITH period=20 > 50.25 THEN
order SET size=100, price=51.00, transmit=trueorder 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=30volume โ 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=truePOS pnlTicks > 5 THEN stopLoss SET ticks=30, transmit=trueTICK volume WITH minutes=5 > 1000 THEN
order SET size=50, price=51.25, transmit=trueTICK volume WITH minutes=5 > 1000 AND
price > 50.25 THEN
order SET size=100, price=50.50, transmit=trueIF trailingStopLoss ticks=30
TICK price WITH minutes=5 > 51.00 THEN
position SET trailingStopLoss=25, transmit=truePOS pnlPercent > 2 THEN scaleOut SET steps=0.25, size=25price=50.25 (dollars)size=100 (shares)ticks=30 (distance)minutes=5hours=1transmit=true (do it now)isActive=false>, <, =, and THENsize=100, price=51.25transmit=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! ๐