Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+17 more

    Trading Bot Script Architect

    2

    Designs, writes, audits, debugs, and improves rule-based trading bot scripts for indicators, strategies, alerts, backtests, paper trading, webhooks, and authorized execution workflows.

    Secure checkout via Stripe

    0 installsSecurity scanned

    See it in action

    You say

    Platform: TradingView Pine Script

    Asset class: Cryptocurrency

    Symbol or market: BTCUSDT

    Timeframe: 15 minutes

    Strategy type: Trend and momentum strategy

    Long, short, or both: Both

    Entry rules: Long when EMA 20 crosses above EMA 50 and RSI is above 55. Short when EMA 20 crosses below EMA 50 and RSI is below 45. Signals must be confirmed at bar close.

    Exit rules: Exit at stop loss or take profit. Close the position if an opposite confirmed signal appears. Do not reverse immediately unless the current position has been closed first.

    Stop-loss rule: 1.5 times ATR from the entry reference price

    Take-profit rule: 2:1 reward-to-risk ratio based on the initial stop distance

    Position sizing: Percent equity risk

    Maximum risk per trade: 1% of strategy equity

    Maximum daily loss: 3%

    Maximum open positions: 1

    Pyramiding: Not allowed

    Reversal behavior: Close the current position first, then allow a new opposite entry on a later confirmed signal

    Session and timezone: Configurable session input Default timezone should follow the exchange timezone

    Indicator parameters: EMA fast length: 20 EMA slow length: 50 RSI length: 14 ATR length: 14 ATR multiplier: 1.5

    Multi-timeframe inputs: Optional higher-timeframe EMA 200 filter Use only confirmed higher-timeframe values

    Order type: Market simulation in the TradingView strategy tester

    Commission assumption: 0.1% per order

    Slippage assumption: User-configurable input

    Spread assumption: Not directly modeled unless approximated through slippage

    Alert or webhook requirements: Create alert conditions for long entry, short entry, long exit, and short exit. Include symbol, timeframe, action, reference price, stop loss, take profit, timestamp, and signal reason. Do not include credentials.

    Backtest date range: User-configurable start and end date

    Need output: Complete Pine Script strategy, configuration guide, backtest notes, non-repainting notes, alert payload examples, test cases, and paper-trading checklist

    Special constraints: No repainting Bar-close confirmation only No future data No lookahead No pyramiding Clear comments Safe defaults Do not guarantee profitability

    Your agent does

    === TRADING BOT SCRIPT SPECIFICATION ===

    Platform: TradingView Pine Script

    Strategy Name: EMA Trend and RSI Momentum Bot

    Market: BTCUSDT

    Timeframe: 15 minutes

    Direction: Long and short

    Execution Timing: Confirmed bar close only

    Pyramiding: Disabled

    Maximum Open Positions: One

    === STRATEGY LOGIC ===

    Long Entry:

    1. EMA 20 crosses above EMA 50.
    2. RSI is greater than 55.
    3. The configured trading session is active.
    4. The optional higher-timeframe filter is satisfied.
    5. The signal is confirmed at bar close.
    6. No position is currently open.
    7. The maximum daily loss guard has not been triggered.

    Short Entry:

    1. EMA 20 crosses below EMA 50.
    2. RSI is less than 45.
    3. The configured trading session is active.
    4. The optional higher-timeframe filter is satisfied.
    5. The signal is confirmed at bar close.
    6. No position is currently open.
    7. The maximum daily loss guard has not been triggered.

    Long Stop Loss: Entry reference price minus 1.5 times ATR.

    Long Take Profit: Entry reference price plus two times the initial stop distance.

    Short Stop Loss: Entry reference price plus 1.5 times ATR.

    Short Take Profit: Entry reference price minus two times the initial stop distance.

    Opposite Signal Behavior: Close the current position first. Do not reverse on the same signal event. A new opposite entry may occur only on a later confirmed signal.

    === RISK MANAGEMENT ===

    Risk Per Trade: 1% of strategy equity

    Maximum Daily Loss: 3%

    Maximum Open Positions: One

    Invalid Trade Guard: Reject the trade if ATR, stop distance, or calculated quantity is zero, negative, or unavailable.

    Pyramiding: Not allowed

    Daily Guard Behavior: Stop submitting new entries after the daily loss threshold is reached.

    === NON-REPAINTING RULES ===

    • Evaluate signals only on confirmed bars.
    • Do not use future-looking pivots.
    • Do not use lookahead.
    • Use only confirmed higher-timeframe values.
    • Do not generate entries from incomplete higher-timeframe candles.
    • Trigger alerts only on new signal transitions.
    • Keep historical and real-time signal logic consistent.

    === SCRIPT ARCHITECTURE ===

    1. Strategy declaration
    2. Grouped user inputs
    3. Session and date filters
    4. EMA, RSI, and ATR calculations
    5. Optional higher-timeframe filter
    6. Confirmed long and short signals
    7. Risk and quantity calculations
    8. Entry logic
    9. Stop and target management
    10. Daily loss guard
    11. Alert conditions
    12. Visual plots and diagnostics

    === ALERT PAYLOAD EXAMPLE ===

    { "event_id": "EMA_RSI_BTCUSDT_15M_LONG_{{time}}", "strategy_id": "EMA_RSI_TREND_BOT", "symbol": "{{ticker}}", "timeframe": "{{interval}}", "action": "buy", "order_type": "market", "reference_price": "{{close}}", "stop_loss": "calculated_long_stop", "take_profit": "calculated_long_target", "timestamp": "{{time}}", "bar_confirmed": true, "reason": "EMA20 crossed above EMA50 and RSI exceeded 55" }

    Security Note: Do not include API keys, exchange secrets, passwords, seed phrases, or unrestricted credentials in the webhook payload.

    === TEST CASES ===

    Test 1 — Valid Long Signal: EMA 20 crosses above EMA 50, RSI is above 55, session is active, and no position is open. Expected result: One long entry.

    Test 2 — Repeated Long Condition: The long condition remains true for multiple bars. Expected result: No duplicate entries.

    Test 3 — Invalid Session: A valid crossover occurs outside the configured session. Expected result: No entry.

    Test 4 — Invalid Stop Distance: ATR is unavailable or zero. Expected result: Trade rejected.

    Test 5 — Opposite Signal While Long: A confirmed short signal appears while a long position is open. Expected result: Close the long position. Do not open a short position during the same event.

    Test 6 — Daily Loss Limit: The daily loss threshold is reached. Expected result: No new entries until the daily guard resets.

    Test 7 — Higher-Timeframe Filter: The higher-timeframe EMA condition is not satisfied. Expected result: Entry blocked.

    Test 8 — Real-Time Bar: The current bar has not closed. Expected result: No confirmed signal or alert.

    === BACKTEST GUIDANCE ===

    • Use realistic commission.
    • Add a conservative slippage assumption.
    • Test multiple date ranges.
    • Test bullish, bearish, and sideways regimes.
    • Compare results across more than one symbol.
    • Test parameter stability rather than one optimized setting.
    • Use an out-of-sample period.
    • Review trade count and maximum drawdown.
    • Compare long and short performance separately.
    • Do not interpret historical performance as a guarantee.

    === PAPER-TRADING CHECKLIST ===

    • Confirm the script compiles.
    • Confirm all inputs work.
    • Confirm session filtering.
    • Confirm date filtering.
    • Confirm plotted stops and targets.
    • Confirm quantity calculations.
    • Confirm no duplicate entries.
    • Confirm no duplicate alerts.
    • Compare alerts with chart signals.
    • Test webhook payload formatting.
    • Validate timestamp freshness.
    • Validate symbol and action fields.
    • Run in paper trading before any live consideration.
    • Record discrepancies between historical and live behavior.

    === KNOWN LIMITATIONS ===

    • TradingView strategy fills are simulated.
    • Real broker fills may differ.
    • Spread is not directly modeled unless approximated.
    • Slippage may vary substantially.
    • Percent-risk sizing may require broker-specific adjustment.
    • Higher-timeframe confirmation introduces delay.
    • Market conditions can change.
    • Historical performance does not guarantee future results.

    === FINANCIAL RISK NOTICE ===

    This script is for research, education, backtesting, and authorized automation. It does not guarantee profitability. Test with realistic costs, out-of-sample data, replay, and paper trading before considering live deployment.

    What you get

    Automate discretionary rules into formal trading scripts.Identify and fix lookahead bias in backtesting code.Build multi-timeframe indicators that don't repaint.Generate webhook payloads for third-party execution bridges.Implement equity-based position sizing and daily loss guards.

    About this skill

    Trading Bot Script Architect helps traders, strategy developers, TradingView users, MetaTrader users, Python developers, funded-account traders, educators, agencies, and technical teams turn trading ideas into explicit, testable, maintainable, and risk-controlled scripts.

    The skill creates TradingView indicators and strategies, Pine Script alerts, MQL4 and MQL5 Expert Advisor specifications, Python strategy modules, backtesting logic, signal engines, webhook schemas, position-sizing systems, stop-loss and take-profit modules, trailing stops, breakeven rules, partial exits, time-based exits, session filters, volatility filters, trend filters, multi-timeframe systems, maximum-loss controls, strategy dashboards, code audits, debugging reports, repainting audits, and backtest-integrity reviews.

    It is designed for users who need more than a basic code generator. The agent formalizes strategy rules before coding, separates signal logic from execution and risk logic, defines bar timing, prevents duplicate entries and alerts, documents pyramiding and reversal behavior, and makes all assumptions visible.

    The skill supports rule-based trend, breakout, momentum, mean-reversion, market-structure, intraday, swing, scalping, volatility, and session-based systems. It can also convert indicators into strategies, convert strategies into indicators, create webhook payloads, review historical versus live behavior, and produce paper-trading test plans.

    It emphasizes non-repainting logic, lookahead-bias prevention, realistic commission and slippage assumptions, bounded position sizing, symbol-specific constraints, code readability, credential safety, out-of-sample testing, and transparent limitations.

    The agent does not guarantee profitability. Its purpose is to help users create safer, clearer, more testable, and more professionally structured trading scripts.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • One-time purchase, yours forever

    Listed1 month ago

    Frequently Asked Questions