[GYTS-Pro] Order Orchestrator

๐ธ Part of GoemonYae Trading System (GYTS) ๐ธ
๐ธ --------- INTRODUCTION --------- ๐ธ
๐ฎ What is the Order Orchestrator?
The Order Orchestrator is a exhaustive trading strategy framework that acts as the central command center for your automated trading operations. It coordinates entries, exits, and position management based on signals from other GYTS and third party indicators, while offering flexibility in trade setup and risk management. Unlike traditional strategies that apply a one-size-fits-all approach, the ๐ผ Order Orchestrator lets you build sophisticated, multi-layered trading systems that adapt to specific market conditions.
๐ฎ Key Features at a Glance
โข Signal integration - Connect up to 5 independent signal sources with customisable mapping
โข Multi-level take profits - Deploy up to 5 dynamic take profit levels with percentage allocation
โข Adaptive position sizing - Implement anti/martingale position sizing based on win/loss streaks
โข Market regime filtering - Trade selectively in trending or cyclic market conditions
โข SuperTrend exit system - Utilise dynamic trailing stops that activate after specific TP levels
โข Numerous entry/exit methods - Utilise percentage, ATR, higher-high-lower-low-based entries and exits
โข Risk/reward-based TPs - Automatically place take profits based on risk-to-reward ratios
โข Third-party integration - Compatibility with PineConnector and custom API webhooks
โข Advanced signal consolidation - Require multiple signals within a window for trade confirmation
โข Visualisation options - Comprehensive visual feedback system for all aspect of your trades
๐ธ --------- TRADE ORCHESTRATION SYSTEM --------- ๐ธ
๐ฎ The Multi-Signal Engine
At its core, the Order Orchestrator processes signals from multiple sources and integrates them to make intelligent trading decisions:
โข Signal sources - Connect up to 5 independent signal generators, including GYTS indicators like ๐งฌ Flux Composer or a ๐ก Signal Provider like WaveTrend 4D directly
โข Signal Mapping - Flexibly map integer values from signal streams to specific actions (entry long, exit short, etc.)
โข Signal Consolidation - As an alternative to using GYTS Flux Composer, you can set to require multiple confirmations within a specified bar window for stronger trade conviction.
โข Market Regime Filtering - Selectively enable signals based on the current market regime (trending or cyclic). Works with the GYTS Market Regime Detector out-of-the-box.
This multi-layered approach drastically reduces false signals while ensuring you don't miss genuine trading opportunities.
๐ฎ Dynamic Entry System
The Order Orchestrator provides flexible entry methods to suit different trading styles:
โข Percentage-based - Enter at a fixed percentage away from the close price
โข ATR-based - Scale your entry distance based on current market volatility
โข HHLL-based - Enter at recent swing highs/lows for breakout or pullback trading
โข Limit or market orders - Choose between immediate execution or better price entries
โข Auto-cancellation - Automatically cancel pending limit orders after a specified number of bars
โข Cooldown period - Add a cooldown period between trades to limit persistent signals
๐ฎ Adaptive Position Sizing
The Order Orchestrator includes a sophisticated position sizing system that can adapt to your recent trading results:
โข Win streak scaling - Increase position size during favourable market conditions (anti-martingale)
โข Loss streak management - Apply classic martingale strategy to recover from drawdowns
โข Customisable progression - Set minimum streak threshold and maximum multiplier to control risk
โข Multiplicative scaling - Position size grows geometrically with each consecutive win or loss
This approach allows you to capitalise on "hot streaks" while implementing a systematic recovery strategy during challenging periods.
๐ฎ Multi-Level Exit Strategy
Take full control of your exit strategy with a sophisticated multi-tiered approach:
โข Percentage Allocation - Divide your position across up to 5 take profit levels with precise allocation control
โข Dynamic Take Profits - Set TPs using percentage, ATR, or HHLL-based methods
โข Risk/Reward Ratios - Automatically calculate TPs based on your desired risk-to-reward profile
โข Sequential SL Movement - Automatically move your stop loss when earlier TPs are hit
โข SuperTrend Exit Integration - Activate trailing stops after specific TPs are reached
โข Signal-Based Exits - Configure whether exit signals close positions or move stops to breakeven
This granular exit control allows you to lock in profits early while letting winners run with appropriate protection.
๐ธ --------- CONFIGURATION GUIDE --------- ๐ธ
๐ฎ Time Settings
Control when your strategy is active:
โข Training Period Filter - Restrict strategy operation to specific date ranges for testing or scheduled trading
๐ฎ Entry Settings
Configure how the strategy enters trades:
โข Order type - Choose between market orders (immediate execution) or limit orders (better price)
โข Limit order expiration - Set the number of bars after which pending limit orders are cancelled
โข Global cooldown - Specify a waiting period after trade exit before allowing new entries
โข Entry price calculation - Select from percentage-based, ATR-based, or HHLL-based methods
๐ฎ Martingale Settings
Configure position sizing based on consecutive wins or losses:
โข Win/loss multipliers - Set the factor by which position size increases after wins or losses
โข Min/max streak - Define the minimum streak required and maximum application of multipliers
โข Example progression - With multiplier=2, min_streak=1, max_streak=4, sizes would follow: 1-2-4-8-16-16...
๐ฎ Stop Loss Settings
Configure the initial stop loss placement:
โข Distance method - Choose from percentage-based, ATR-based, or HHLL-based methods
โข Parameters - Customise value and lookback periods depending on the selected method
๐ฎ Take Profit Settings
Configure up to 5 take profit levels:
โข Allocation - Set what percentage of your position closes at each level
โข Distance method - Choose from percentage-based, ATR-based, HHLL-based, or R:R-based methods
โข SL movement - Determine how stops move when each TP hits (none, breakeven, to a previous TP)
โข SuperTrend activation - Enable trailing stops after specific TP levels are reached
๐ฎ Signal Generation Settings
Connect external indicators as signal sources:
โข Signal sources - Connect up to 5 independent indicators, with automatic parsing of GYTS ๐งฌ Flux Composer & ๐ก Signal Providers. Also with a built-in EMA crossover for testing.
โข Signal mapping - When using custom sources, define which values from data streams correspond to entry/exit signals
โข Regime Activity - Specify whether signals are active in trending markets, cyclic markets, or both.
Note that the GYTS ๐งฌ Flux Composer already consolidates multiple ๐ก Signal Providers, and therefore should be the only source in the Order Orchestrator when following the GYTS methods. However, you could also configure two or three ๐งฌ Flux Composers, one for each regime.
๐ฎ Signal Consolidation Settings
Configure how multiple signals are processed:
โข Window size - Set the number of bars over which to consolidate signals
โข Minimum signals - Require a minimum number of signals within the window for entry/exit
โข Exit strategy - Choose how exit signals are handled (market close, move SL, or reverse trade)
Note that the GYTS ๐งฌ Flux Composer does this in a more sophisticated manner, and this section is unnecessary when using the ๐งฌ Flux Composer.
๐ธ --------- AUTOMATED TRADING --------- ๐ธ
Configure alerts for external execution platforms:
โข PineConnector - Format alerts compatible with MT4/MT5 through PineConnector
โข Custom API - Create webhooks for platforms like 3Commas, Cornix, CryptoHopper, etc.
๐ฎ Automation with PineConnector
When using PineConnector, after having it set up following the official documentation, it is important to use the following settings:
(1) In TradingView, the Condition of the Alert should be "alert() function calls only". Also don't forget to use the correct webhook address and enable it.
(2) In this strategyโs Properties tab: use โ% of equityโ for the Order size as is also the metric that will be communicated with PineConnector/MetaTrader for each trade.
(3) In PineConnectorโs Input tab in Syntax section:
- Target Type (sl= and tp=): "Pips"
- Volume Type (risk=): "% of Balance, Margin" (or based on "Loss", but that is not how this strategy is calculating the order sizes)
- Pending Order Entry (price=): "Pips from Current Market Price"
Note that due to the (current) limitations of PineConnector, (partial) take-profits (TPs) are triggered on bar close as market orders even though in TradingView they are limit-order TPs. Therefore, exit prices will vary. The only exception is when only using TP1 (with 100% allocation), then it is a limit order in PineConnector as well. Stoplosses are also always limit orders.
๐ฎ Automation with Custom API
Background how the custom API alerts are computed:
- There are four alerts: long/short entry and long/short close. This means that positions are fully closed. Therefore, make sure to disable TP2 and if you wish to use TP1, set it to 100% allocation. There are also validation steps implemented to ensure correct usage.
- We calculate whether limit orders โ i.e. entry (when "limit order" is selected), SL and TP1 โ are hit, by checking whether the price reached the value of these orders. If so, the alert is triggered. The moment of triggering depends on the settings in โPropertiesโ > โRecalculateโ.
๐ธ --------- PRACTICAL USAGE GUIDE --------- ๐ธ
๐ฎ Setting Up Signal Sources
The Order Orchestrator is designed to work with external signal sources from the GYTS suite or custom indicators:
1. GYTS ๐งฌ Flux Composer & ๐ก Signal Providers:
โข Set Signal Source to "๐ STREAM-int" of the relevant GYTS indicators
โข In case of multiple outputs, e.g. with WaveTrend 4D (Pro), you should set two streams:
โข Primary: "๐ STREAM-int WT4D ๐ก Gradient Divergence Measure"
โข Secondary: "๐ STREAM-int WT4D ๐ก Quantile Median Cross"
2. Market Regime Detector Integration:
โข Enable Market Regime filter
โข Connect to "๐ STREAM-int - ๐ง Market Regime"
โข Note that this is a pretty straightforward filter -- "trade only longs", "only shorts", "both directions (cyclic)" and you could use other indicators for this as well.
โข Configure which signals are active in trending vs. cyclic regimes
3. Testing with Built-in Signals:
โข As a default, the test signal option (EMA crossover) is enabled
โข This ensures that the indicator works out-of-the-box, but you should probably use more sophisticated signals
โข You can also use this EMA strategy to validate your exit strategy, position sizing, and overall configuration
๐ฎ Crafting a Multi-Tier Take Profit Strategy
A well-designed take profit strategy is crucial for maximising profitability:
1. Conservative Approach:
โข TP1: 50% allocation at 1:1 R:R ratio
โข TP2: 30% allocation at 2:1 R:R ratio, move SL to breakeven
โข TP3: 20% allocation at 3:1 R:R ratio, move SL to TP1
โข Great for higher timeframe trades with considerable volatility
2. Aggressive Scaling:
โข TP1: 30% allocation at 0.5:1 R:R ratio
โข TP2: 30% allocation at 1:1 R:R ratio, move SL to breakeven
โข TP3: 20% allocation at 2:1 R:R ratio, move SL to TP1
โข TP4: 10% allocation at 3:1 R:R ratio, move SL to TP2
โข TP5: 10% allocation at 5:1 R:R ratio, activate SuperTrend
โข Perfect for trending markets with strong momentum (good combination with certain settings of the GYTS ๐ง Market Regime Detector)
3. Activating SuperTrend Exit:
โข Enable SuperTrend exit at later TPs (e.g., TP3 or TP5)
โข This creates a trailing stop for the remaining position
โข Connect a compatible SuperTrend indicator for dynamic stops
๐ฎ Optimising for Different Market Regimes
The ๐ผ Order Orchestrator truly shines when customised for specific market conditions:
1. Trending Market Configuration:
โข Connect to ๐ง Market Regime Detector
โข Enable trend-specific signals (e.g., WaveTrend 4D QMC)
โข Use R:R-based take profits with trailing stops
โข Consider anti-martingale position sizing to capitalise on momentum
2. Cyclic, Range-Bound Market Configuration:
โข Enable cycle-specific signals (e.g., WaveTrend 4D GDM)
โข Use percentage or ATR-based entries/exits
โข Consider tighter take profits with smaller allocations
โข Keep stop losses relatively tight
3. Hybrid Approach:
โข Let Market Regime Detector automatically switch between configurations
โข Use different signal sources for different regimes
โข Adapt position sizing based on market predictability
๐ธ --------- CONCLUSION --------- ๐ธ
The ๐ผ Order Orchestrator represents the culmination of hundreds of hours of development, testing, and refinement. By providing an incredibly flexible framework for trade execution, it addresses the fundamental challenge: how to systematically enter and exit positions while managing risk effectively across different market conditions.
What sets the ๐ผ Order Orchestrator apart is its ability to act as the central nervous system of your trading operation, intelligently processing inputs from various signal sources and executing a sophisticated trading plan with precision. When combined with other components of the GYTS suite, it forms a complete trading ecosystem that can adapt to virtually any market condition.
โข ๐ง Market Regime Detector for environment analysis
โข ๐งฌ Flux Composer(s), which consolidate ๐ก Signal Providers, for signal generation
โข ๐ผ Order Orchestrator as the execution framework
We encourage you to start with conservative settings and gradually customize the configuration to match your trading style, risk tolerance, and objectives. The combination of robust entry methods, multi-level take profits, adaptive position sizing, and regime-specific behaviour provides almost limitless possibilities for optimisation.
Your feedback is very valuable in our ongoing quest to create the most effective trading tools possible. Note that this is pushing the limits of TradingView's runtime, a higher-tier TradingView plan may be helpful. As you discover new applications and configurations for the ๐ผ Order Orchestrator, please share your experiences to help the entire GYTS community grow and succeed.
- Fixed bug where profit (and thus order sizing) was not calculated correctly due to TV's decimal precision
- Disable PineConnector messages where risk=0.000
- Changed SL messages/identifiers to be more descriptive
- Some refactoring of order size calculation and more comments
- Fixed bug where SuperTrend would still be drawn when it wasn't enabled
- Improved UI with more and clearer grouping
- Removed redundant settings and added more user input validation
- Significantly altered storage of variables, especially of TPs
- Updated tracking of consecutive trade statistics
- Changed Martingale logic to reset when the maximum multiplier is reached, except when that trade ends on break-even
- Solved bug when using testing strategy (EMA crosses)
- Updated several calculations to be more efficient, so script should become slightly faster
- Solved bug of not updating to correct initial entry size in some Martingale scenarios
- Simplified and corrected martingale order sizing logic
- Getting empty price from the open position rather than calculated price (solves potential issues with gaps)
- Slightly more efficient order statistics calculations
- Added drawdown & runup statistics in table
- Refactored code for more consistency
- Added tooltips for Signals section regarding the mapping
- Fixed SuperTrend display bug
- Increased trade ID from 3 numbers to 4, to account for strategies with more than 999 trades.
- Migrated to Pine Script v6 + refactoring
- SuperTrend implementation completely rewritten
- Changed independent TP variables to arrays
- Fixed small bugs
- Major refactoring completed -- improved code, but managing almost 3000 lines in Pine Script is a hassle
- Compatible with Market Regime Detector
- Extended to 5 sets of external signals
- Each signal can be traded during trending and/or cyclic markets
- Lots of bug fixes
- Better and more tooltip documentation
- New: Flux Composer, WT4D, manual input signals
- New: Cooldown period between trades
- Better statistics tracking
- Various bug fixes on different combinations of parameters
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact GoemonYae directly.
Note that this private, invite-only script has not been reviewed by script moderators, and its compliance with House Rules is undetermined. TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Author's instructions
๐ Website: goemonyae.com
๐ Documentation: goemonyae.com/docs
๐ฌ Discord server (including YaeBot): discord.gg/ef6Tu4kha3
๐ personal LinkedIn: linkedin.com/in/arthur-nazarian
Disclaimer
Invite-only script
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact GoemonYae directly.
Note that this private, invite-only script has not been reviewed by script moderators, and its compliance with House Rules is undetermined. TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Author's instructions
๐ Website: goemonyae.com
๐ Documentation: goemonyae.com/docs
๐ฌ Discord server (including YaeBot): discord.gg/ef6Tu4kha3
๐ personal LinkedIn: linkedin.com/in/arthur-nazarian