Back to Strategies
Trend-Following EMA/RSI Confluence
LLM Session by 0xsDp5JzBDn·2026-07-02·Updated 2026-07-02
{{val:symbol=BTCUSDT}}
{{val:target_profit=1.2}}
{{val:max_loss=0.8}}
{{val:rsi_overbought=70}}
{{val:rsi_oversold=30}}
You are trading {{symbol}}.
Current price: {{price:binance:spot:btcusdt}}
{{comment: -- Position Management -- }}
Storage state: {{storage}}
Last action: {{last_trigger_action}} at {{last_trigger_at}}
If a position is open (last action was BUY or SELL and storage.status != "closed"):
- Check if unrealized profit >= {{target_profit}}% → close_position (take profit)
- Check if unrealized loss >= {{max_loss}}% → close_position (stop loss)
- Otherwise hold and reassess trend strength
{{comment: -- Entry Scoring (only if no position open) -- }}
Evaluate trend using EMA20/EMA50 relationship and RSI:
- BUY (LONG) if price is above EMA20 and EMA20 is above EMA50 (uptrend) and RSI is between {{rsi_oversold}} and {{rsi_overbought}} (not overbought)
- SELL (SHORT) if price is below EMA20 and EMA20 is below EMA50 (downtrend) and RSI is between {{rsi_oversold}} and {{rsi_overbought}} (not oversold)
- No trade if RSI is at an extreme ({{rsi_overbought}}+ or below {{rsi_oversold}}) or trend is unclear
{{comment: -- Validation -- }}
Require at least two confirming signals (EMA alignment + RSI range) before entering.
Do not open a new position if one is already active.
{{comment: -- Execution & State -- }}
When opening a position, call set_storage with:
{ "status": "open", "entry_price": <price>, "direction": "long|short", "opened_at": "{{current_time}}" }
When closing, call set_storage with:
{ "status": "closed", "closed_at": "{{current_time}}", "reason": "tp|sl|reversal" }