Trade Multi-Leg Options on Tradier from Excel with MarketXLS

With the TradeMultiLegTradier function, you can seamlessly place multi-leg options trades through Tradier, all without leaving Excel. This function streamlines advanced options strategies—like vertical spreads, iron condors, and other multi-leg configurations—by enabling you to specify up to four individual legs in a single formula. Enjoy a convenient, efficient trading workflow directly in Excel with MarketXLS.

Why Use This Function?

  • Automate advanced multi-leg trades: Configure up to four option legs in one go.
  • Simplify complex option strategies: Ideal for spreads, straddles, strangles, condors, and more.
  • Live hyperlink generation: When your trade URL is successfully generated, it’s added as a hyperlink within your Excel cell.
  • Real-time trade validation: The function checks parameters, ensuring no invalid order types, sides, or missing inputs.
  • Centralized portfolio management: Keep your trading and analysis in the same Excel workbook with MarketXLS.

How to Use in Excel

TradeMultiLegTradier(
  OrderType, 
  Duration, 
  Price, 
  SymbolOption1, 
  Quantity1, 
  OrderSide1, 
  [SymbolOption2], 
  [Quantity2], 
  [OrderSide2], 
  [SymbolOption3], 
  [Quantity3], 
  [OrderSide3], 
  [SymbolOption4], 
  [Quantity4], 
  [OrderSide4]
)
  1. In an Excel worksheet, select the cell where you want the result.
  2. Type the formula =TradeMultiLegTradier(...) with the required arguments.
  3. Press Enter. The formula validates your inputs, optionally returns a Tradier link, or returns an error message if something is incorrect.

If multiple legs are included, the function ensures the underlying symbol (extracted from each option symbol) is the same across all legs.
If you omit arguments for additional legs (2 through 4), those legs are ignored in the final trade URL.

Parameters Explained

Parameter Description Example Values Notes
OrderType The type of multi-leg trade. "market", "debit", "credit", "even" "debit" or "credit" requires a Price > 0.
Duration The duration for which the order remains active. "day", "gtc", "pre", "post" If left blank, defaults to "day".
Price Limit or entry price when OrderType is "debit" or "credit". 3.50, 1.25 For "market" or "even", set this to 0 or leave it as a placeholder.
SymbolOption1 Option symbol for the first leg. Must be a valid format recognized by the Tradier integration. "@AAPL220617C00125000" Required. If invalid or empty, the function returns an error.
Quantity1 Number of contracts for the first leg. 1, 2, 5 Cannot be 0 if you want to include this leg.
OrderSide1 Order side for the first leg. "buytoopen", "buytoclose", "selltoopen", "selltoclose" Required for the first leg. Must be a valid side.
SymbolOption2 Option symbol for the second leg (optional). "@AAPL220617P00125000" Only validated if Quantity2 > 0 and OrderSide2 is specified. Otherwise defaults to "default" in the trade URL.
Quantity2 Number of contracts for the second leg (optional). 1, 2, 5 Must match the side you choose if you want to include this leg.
OrderSide2 Order side for the second leg (optional). "selltoopen", "buytoclose" Must be valid only if SymbolOption2 & Quantity2 are provided.
SymbolOption3 Option symbol for the third leg (optional). "@AAPL220617C00130000" Same logic as second leg.
Quantity3 Number of contracts for the third leg (optional). 1, 2, 5
OrderSide3 Order side for the third leg (optional). "buytoopen", "selltoclose"
SymbolOption4 Option symbol for the fourth leg (optional). "@AAPL220617C00120000" Same logic as second leg.
Quantity4 Number of contracts for the fourth leg (optional). 1, 2, 5
OrderSide4 Order side for the fourth leg (optional). "selltoopen", "buytoclose"

Example Usage

Basic Examples

  1. Single-Leg Debit Trade
    =TradeMultiLegTradier("debit", "day", 2.5, "@AAPL220617C00125000", 1, "buytoopen")
    • This will place a single-leg order to buy to open 1 contract at a limit price of 2.50.
    • Returns a hyperlink to the Tradier interface if successful.

  2. Multi-Leg Credit Spread
    =TradeMultiLegTradier("credit", "day", 1.25, "@AAPL220617C00130000", 1, "selltoopen", "@AAPL220617C00135000", 1, "buytoopen")
    • First leg: Sell to open 1 contract @ 1.30 strike.
    • Second leg: Buy to open 1 contract @ 1.35 strike.
    • This sets a net credit limit of 1.25.

  3. Market Order with One Leg (Ignoring Others)
    =TradeMultiLegTradier("market", "gtc", 0, "@AAPL220617C00125000", 2, "buytoopen")
    • Because Price is 0 and Type is "market," no limit price is required.
    • The function ignores legs 2-4 since you didn’t specify them.

  4. Two-Leg Debit Spread (Day Order)
    =TradeMultiLegTradier("debit", "day", 4.75, "@AAPL220617P00125000", 1, "buytoopen", "@AAPL220617P00125000", 1, "selltoopen")
    • Hypothetical example: same strike or near strike for demonstration.
    • The function calculates a net limit price of 4.75 for both legs combined.

Advanced Scenarios

  1. Four-Leg Iron Condor
    =TradeMultiLegTradier("credit", "day", 2.65, "@AAPL220617C00130000", 1, "selltoopen", "@AAPL220617C00135000", 1, "buytoopen", "@AAPL220617P00120000", 1, "selltoopen", "@AAPL220617P00115000", 1, "buytoopen")
    • Creates a four-leg iron condor with calls at 130/135 and puts at 120/115.
    • Ensures all legs share the same underlying (AAPL).
    • Uses a net credit limit of 2.65.

  2. Rolling Positions
    • Suppose you want to buy to close an existing short call and simultaneously sell to open a new call at a different strike.
    • You can specify different legs (one “buytoclose” and one “selltoopen”) to roll your position, combining it into a single multi-leg trade in Excel.

  3. Integrating with Additional Excel Functions
    • For dynamic trading, cells can reference real-time data from MarketXLS.
    • Example: =TradeMultiLegTradier("debit", "day", A1, B1, C1, D1, B2, C2, D2)
    • Where A1 might be your desired limit price, B1 is your SymbolOption, C1 is your quantity, and D1 is your side.

Common Questions and Troubleshooting

• Why do I get "Symbol option is required?"
– You may have left a required SymbolOption1 blank or used an invalid format. Ensure each option symbol follows the required conventions.

• What if my second or third leg is incomplete?
– The function checks Quantity > 0, a non-empty side, and a valid symbol. If these aren’t present, that leg is skipped or returns an error if improperly specified.

• Why am I seeing "Please enter limit price when the type is credit or debit?"
– For credit or debit trades, you must provide a non-zero Price.

• Can I trade different underlyings in a single function call?
– No. All legs must share the same underlying. The backend enforces that requirement and returns an error if it detects otherwise.

• My formulas sometimes return "NA" or "Refreshing." What does that mean?
– "NA" signifies an unexpected error. "Refreshing" indicates data caching or synchronization. In either case, check your inputs and try again.

Remember:

  • Always confirm the option symbols match the Tradier-supported format.
  • Double-check the order side (e.g., "buytoopen" vs. "buytoclose") and quantity before placing trades.
  • Use MarketXLS real-time data in your Excel cells to feed dynamic parameters into your multi-leg trade.

With TradeMultiLegTradier, you can manage advanced options strategies directly in Excel. This powerful capability ensures efficient, accurate, and streamlined workflow for multi-leg orders on Tradier. Start experimenting with different combinations and enjoy the smooth trading experience within your favorite spreadsheet interface!

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 Multi Leg Tradier and Other Financial Formulas
How does MarketXLS work?