Manual Entry, Automatic Exit: Using XQ Semi-Automated Trading to Free Up Office Workers

TL;DR: Pick more precise entry points by hand and let an XQ script exit automatically under preset conditions, so office workers don't have to watch the market and can focus on improving entry quality.

Key ideas

  • XQ's full automated trading covers stock selection, entry and exit, but some people feel its entry points can only be described in a fairly generic way and are not precise enough, so they enter manually and leave the exit to XQ.
  • For the script to detect manually placed orders, the key is to specify the inventory and the monitored account in the automated trading settings and check "automatically add to execution when inventory changes"; the execution frequency depends on the trading cycle, for example 1 minute for day trading.
  • The exit conditions are written entirely in the script: the simplest is that while holding a position, it exits when the closing price exceeds the average entry price by a set percentage; the advanced version can add take-profit, stop-loss, moving average crossover, point change, holding time, and the stock version can also set a final exit time to avoid holding positions overnight.
  • In a live test with a simulated long order, once it filled the script found the position and exited automatically when the condition of crossing below the moving average was met, confirming that manual entry combined with automatic exit works.
  • Handing the exit to the script saves the effort of watching both entry and exit at once, and removes the worry of a short squeeze or a long position hitting limit-down, so entry quality can improve.
量化交易科學園區 - 江加宏Length 11:42Quant Trading Science Park
Episodes
  1. Mon, Nov 28Custom SwingHighBar: Finding Perfect Peaks with Rising Left Side and Falling Right Side
  2. Sat, Dec 31Automatically Detecting an M-Top with XScript: Swing Highs, Neckline and Multiple Filter Conditions
  3. Thu, Mar 16Detecting Volume-Price Divergence with Code: Comparing Price and Volume at Two Swing Highs
  4. Wed, Mar 29Recreating the Day-Trading Three Lines and a Short Alert for Breakouts That Fall Back, Using XS
  5. Tue, Apr 11RSI Bearish Divergence Algorithm and Tolerant Sampling: Syncing Price Highs with Indicator Highs
  6. Thu, Apr 20Measuring Bullish Strength from a Single Candlestick
  7. Fri, Apr 28Manual Entry, Automatic Exit: Using XQ Semi-Automated Trading to Free Up Office Workers
  8. Sun, May 14Automated Trading Without Coding Skills: Split a Strategy into Four Building Blocks of Stock Selection, Entry, Exit and Position Control
  9. Mon, Jun 5Is a High-Volume Long Upper Shadow a Reversal or a Bullish Shakeout? A 3-Year Backtest
  10. Sat, Jun 17Picking Stocks at the Second-Wave Breakout: Big Prior Rally, Low-Volume Consolidation, Then a High-Volume Long Red Candle
  11. Wed, Sep 23Disposition stocks no longer pull back under the new rules: buy those that close strong on day 1 and sell on day 5
  12. Wed, Oct 7A Live Trading Strategy Under the New Disposition Stock Rules: Buy on Day 1, Sell on the Last Day, and Use Stop-Losses
  13. Wed, Oct 21Foreign Capital Rotates Into Defensive Stocks, and a Review of Live Disposition Stock Trades
  14. Wed, Oct 28SDT Shared Variables: Fixed Memory That Saves Resources and Lets Instruments in the Same Strategy Pass Data to Each Other
  15. Wed, Nov 4Disposition Stock Strategy Flips From Bull to Bear: Why It Is Paused When the Market Weakens
  16. Wed, Nov 18Auditing Online Course Strategies with AI: Out-of-Sample Backtesting and Building Your Own XQ Minute-Bar Database
  17. Wed, Nov 25Options Long Straddle Backtest: Trading It Every Day Loses Over the Long Run, With Chances to Profit Only in High-Volatility Periods
▶ Watch the original on YouTube
Ask AI about this episode

Copy the prompt, paste it into an AI service, and add the question. The AI reads the notes on this site and links to the page and the video timestamps.

Or open directly:ChatGPTClaudeGrokPerplexity

Section summaries

  1. 0:05The Idea of Manual Entry with XQ Automatic Exit

    XQ automated trading covers stock selection, entry and exit, but some people think its entry points are not precise enough. The speaker proposes entering manually and letting XQ exit automatically, and first demonstrates adding an automatic exit script to the trading functions.

    ▶ Watch from here
    Slide: The Idea of Manual Entry with XQ Automatic Exit
  2. 2:05Writing the Simplest Percentage Exit Script

    This demonstrates the most basic exit logic: when the position is not 0, exit if the closing price is above the average entry price by the set percentage. Once the code is compiled, the script is added to automated trading and selected.

    ▶ Watch from here
    Slide: Writing the Simplest Percentage Exit Script
  3. 3:05Automated Trading Settings and Inventory-Change Triggering

    In the settings you must specify the inventory and the monitored account, and the execution frequency depends on the trading cycle; a day trading program can use 1 minute. The key is to check automatically adding to execution when inventory changes, so the script can detect manually placed orders and exit on your behalf.

    ▶ Watch from here
  4. 4:35Order Types and Conditions in the Futures Exit-Assist Script

    The self-made futures exit-assist script lets you choose the order type: for limit orders, the price is tied to the trigger price, with buys at 2 ticks higher and sells at 2 ticks lower; futures use range market orders, while stocks simply use market orders. You can also set exit conditions such as take-profit, stop-loss, candlestick size, moving average crossover, point change and holding time.

    ▶ Watch from here
    Slide 1/2: Order Types and Conditions in the Futures Exit-Assist ScriptSlide 2/2: Order Types and Conditions in the Futures Exit-Assist Script
  5. 7:35Simulated Long Order Test and the Stock Version Script

    After a simulated long order filled, the script detected the position and exited automatically when price broke below the moving average, confirming it works. The stock version can also set take-profit, stop-loss, holding time and a final exit before the close, letting traders focus on improving entry quality.

    ▶ Watch from here
    Slide: Simulated Long Order Test and the Stock Version Script

This page summarizes the video; it is not an official transcript. Original video: Manual Entry, Automatic Exit: Using XQ Semi-Automated Trading to Free Up Office Workers (量化交易科學園區 - 江加宏), copyright belongs to the original creator.