OPEN-SOURCE SCRIPT
已更新 Strategy Builder

use external indicators on the chart as a source for a strategy. use 5 different triggers with drop down conditions. you can use any indicator that plots.
I will amend info when I get more time. improvement suggestions or indicator combinations would be appreciated.
I will amend info when I get more time. improvement suggestions or indicator combinations would be appreciated.
版本注释
⚙️ Strategy Builder — Customizable Multi-Condition Trading FrameworkThe Strategy Builder is a modular, no-code trading framework designed for traders who want full control over their entry and exit logic — without writing new code each time. With up to five configurable Buy and Sell conditions, dynamic combination modes, and built-in trade management, it’s the ultimate toolkit for building and testing strategies directly in Pine Script.
🧠 How It Works
This strategy lets you stack and combine multiple logic slots to define custom entry and exit rules. Each slot can compare two data sources (or a value) using a variety of conditions — from simple crossovers to relational comparisons.
You can then control how those conditions must align using the “Combine” settings:
Any – triggers when any enabled slot is true.
All – same bar – requires all active conditions to occur simultaneously.
All – within bars – allows signals to confirm within a specified lookback window.
Each side (Buy/Sell) is independently configurable, allowing endless flexibility for strategy design and testing.
⚡ Key Features
🧩 5 Fully Customizable Buy & Sell Slots – Define crossovers, thresholds, comparisons, and more.
🧠 Advanced Combine Logic – Mix conditions using Any, All, or Within Bars modes.
🔄 One-Trade-at-a-Time Control – Prevent overlapping entries and manage re-entry timing.
💰 Built-In Stop Loss & Take Profit – Automatically exit trades based on fixed percentages.
💤 Sideways Market Detection – Optionally close positions if the market remains stagnant.
🪄 Visual Trade Zones – Plots entry, stop, and take-profit lines with transparent fill zones.
🧮 Risk & Trade Management
Parameter Description
Initial Capital / Position Size Defined in percent of equity (default: 100%)
Commission Adjustable percentage cost per trade
Fixed SL/TP Set your stop loss and take profit in percent
Sideways Close Automatically closes trades after X bars of minimal movement
Wait Between Trades Enforces cooldown periods for better control
🧠 Combine Logic Modes
Mode Description
Any Trigger on any valid condition
All - same bar Require all active slots to confirm on the same bar
All - within bars Allow flexibility within a lookback period
🎯 Trading Applications
Build and test multi-condition strategies visually.
Compare indicator-based signals (RSI crossovers, MA crossovers, etc.) without coding.
Combine different sources or values for flexible backtesting setups.
Add this as a foundation layer to prototype complex logic or strategy blends.
🧩 Included Controls
✅ Enable/Disable individual buy or sell slots
⚙️ Custom “Combine” logic configuration
⏱️ Wait periods and trade sequencing control
📉 Dynamic SL/TP visualization and overlays
🧠 Usage Tip
Start by enabling a few Buy/Sell slots and testing different conditions (like crossover of RSI and MA). Once your rules generate reliable entries, layer in stop-loss, take-profit, and sideways-close logic to refine risk management.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。