Home MarketXLS
Dashboard MarketXLS
Screener MarketXLS
Options Profit Calculator MarketXLS
Stock Ranks MarketXLS
Spreadsheet Builder MarketXLS
Documentation MarketXLS
Logout MarketXLS

TradeSingleLegOrion: Streamlined Single-Leg Orion Trading in Excel

The TradeSingleLegOrion function allows you to place single-leg trades on Orion directly from Excel using MarketXLS. By integrating real-time calculations and trades, this function helps you act on market opportunities quickly without leaving Excel. It supports various order sides and order types—giving you a versatile tool for everyday trading scenarios.

Why Use This Function?

  • Execute Single-Leg Orders Efficiently
    Quickly place single-leg orders for equities or options on the Orion platform from your Excel spreadsheet.
  • Flexible Order Parameters
    Supports multiple order sides (BUY, SELL, BUYTOOPEN, SELLTOOPEN) and order types (MARKET, LIMIT, STOP), letting you tailor your trades.
  • Seamless Workflow
    No need to toggle between platforms; plan, calculate, and execute trades right where you organize your financial data.
  • Real-Time Integration
    Automatically uses your validated credentials and seamlessly integrates with MarketXLS for streamlined execution.
  • Reduced Errors
    Customizable validation messages help ensure you pass correct parameters and avoid order rejections.
  • Applies to Multiple Use Cases
    Ideal for both basic equity trades and more advanced options strategies (e.g., buying or selling to open positions).

How to Use in Excel

TradeSingleLegOrion(Symbol, Quantity, Price, OrderSide, OrderType, [Exchange], [TriggerPrice])
  1. Open Excel with MarketXLS installed.
  2. Enter the formula in a cell, providing valid values for each required parameter.
  3. Optional parameters (Exchange, TriggerPrice) can be left blank with an empty string ("") if they are not needed.
  4. If all inputs are valid, the function attempts to connect to the Orion platform and execute your order. The result or a status message is returned in the cell.

Parameters Explained

Parameter Description Example Values Notes
Symbol The ticker symbol or option symbol. Must follow standard formats recognized by Orion or MarketXLS. "AAPL" / "@AAPL240120C150" If the symbol is invalid (doesn’t match certain formats), you will get an error.
Quantity Number of shares or contracts to trade. 10 / 100 / 1 Must be a positive integer. If the function cannot parse this properly, an error is returned.
Price The price at which to trade, used primarily for LIMIT or STOP orders. 125.50 / 0.00 / 5.75 For MARKET orders, you can pass any value, but it will be ignored (set to 0 internally).
OrderSide Specifies the side of the trade. Accepted values: BUY, SELL, BUYTOOPEN, SELLTOOPEN. "BUY" / "SELLTOOPEN" Wrong values result in an invalid order side message. BUYTOOPEN translates to “BUY TO OPEN” internally.
OrderType Specifies the type of order. Accepted values: MARKET, LIMIT, STOP. "MARKET" / "LIMIT" / "STOP" If you choose MARKET, Price is effectively 0.00.
Exchange (Opt) The exchange where you want the order directed. Not always required. "NYSE" / "" Can be left blank if not needed.
TriggerPrice (Opt) A potential secondary or trigger price for advanced order configurations (e.g., certain STOP orders). "120.00" / "" Currently optional. If blank, the API may ignore it.

Example Usage

Below are illustrative examples showing how you might use TradeSingleLegOrion in real-world trading scenarios. Adjust values to match your own strategy or preferences.

Basic Examples

  1. Market Order for an Equity: » Cell A1:
    =TradeSingleLegOrion("AAPL", 10, 150, "BUY", "MARKET")
    Explanation: This places a BUY MARKET order for 10 shares of AAPL. The 150 price value is ignored in a MARKET order.

  2. Limit Order for an Equity: » Cell A2:
    =TradeSingleLegOrion("MSFT", 50, 250.25, "SELL", "LIMIT")
    Explanation: This places a SELL LIMIT order for 50 shares of MSFT at a limit price of $250.25.

  3. Buying to Open Options with a Limit: » Cell A3:
    =TradeSingleLegOrion("@AAPL240120C150", 1, 3.50, "BUYTOOPEN", "LIMIT", "OCC")
    Explanation: This instructs a BUY TO OPEN LIMIT order for 1 contract of the specified Apple call option at a price of $3.50. The "OCC" exchange is provided.

Advanced Scenarios

  1. Stop Order for an Equity: » Cell B1:
    =TradeSingleLegOrion("TSLA", 20, 700.00, "SELL", "STOP", "", 695.00)
    Explanation: This places a STOP order on TSLA to sell 20 shares if the stop price is reached. The function might reference 695.00 as a trigger in advanced workflows.

  2. Buying Options to Open with a Stop: » Cell B2:
    =TradeSingleLegOrion("@TSLA240120C800", 2, 10, "BUYTOOPEN", "STOP", "OCC", 9.50)
    Explanation: Attempts to create a BUY TO OPEN STOP order on 2 TSLA call contracts, using 9.50 as the potential additional reference.

  3. SELLTOOPEN for Option Premium Strategies: » Cell B3:
    =TradeSingleLegOrion("@SPY240120P400", 5, 2.10, "SELLTOOPEN", "LIMIT", "OCC")
    Explanation: This is a SELL TO OPEN LIMIT order on 5 SPY put contracts. Ideal for premium-collection strategies.

Common Questions and Troubleshooting

  1. “Symbol has an invalid format. Please check your inputs.”
    – Ensure your symbol follows recognized naming conventions. For equities, use standard ticker symbols like AAPL. For options, use the correct option format recognized by Orion or MarketXLS.

  2. “Quantity has an invalid format. Please check your inputs.”
    – Verify that the Quantity parameter is a valid integer. For example, 10 (shares/contracts) is acceptable, but decimals or text produce an error.

  3. “Price has an invalid format. Please check your inputs.”
    – Make sure Price is numeric (e.g., 150.00). Non-numeric characters or empty strings in required spots can trigger this error.

  4. “Order side is invalid. Please check your inputs.”
    – Use only BUY, SELL, BUYTOOPEN, or SELLTOOPEN. Other variations or incorrect spellings return an error.

  5. “Order type is invalid. Please check your inputs.”
    – Accepted types are MARKET, LIMIT, STOP. If you type anything else, you will receive this message.

  6. “Refreshing” Status
    – If the data is temporarily locked or refreshing, the function may return “Refreshing.” Wait a moment and retry if needed.

  7. “NA” Error
    – A general fallback message. Typically indicates the operation could not be completed for an unexpected reason (e.g., internal connection issue).

By carefully setting each parameter and double-checking your inputs, you can initiate Orion trades directly from Excel with minimal fuss. Whether you’re placing simple equity orders or structuring advanced options strategies, the TradeSingleLegOrion function ensures a smooth and streamlined workflow, helping you focus on your trading goals.

Get Access to 1 Billion Usable Market data points IN YOUR EXCEL SHEETS WITH EASY TO USE EXCEL FUNCTIONS

Get started today
MarketXLS Excel Add-in Tutorial - How to Use Trade Single Leg Orion and Other Financial Formulas
How does MarketXLS work?