Bot Import Format Reference
The complete Bot Import file format: define multiple trading bots and their configurations in a single text file, with templates for shared settings. For the import workflow itself, see Clone, Share, and Import Bots.
File structure
The import file is structured in sections. Use templates to define common parameters that can be reused across multiple bots:
[templates]
template_name=my_template
param1=value1
param2=value2
...
[[trade_params]]
bot_name=My Bot
type=ShortCall
symbol=AAPL
...
[[trade_params]]
.......
Bot types
The import utility supports the following bot types:
Single option strategies
ShortCall: short call optionLongCall: long call optionShortPut: short put optionLongPut: long put option
Spread strategies
PutCreditSpread: put credit spreadCallCreditSpread: call credit spreadCallDebitSpread: call debit spreadPutDebitSpread: put debit spread
Multi-leg strategies
ShortStrangle: short strangleLongStrangle: long strangleShortIronCondor: short iron condorLongIronCondor: long iron condor
Required parameters
Basic parameters
name: bot name (can use variables like {symbol} in the name)type: bot type (see above)symbol: trading symboltemplate: template name to use (optional)accountNum: account number to use for this bot (optional, can be set in template)stratCode: Strategy ID to assign the bot to (optional, view available Strategy IDs on the Bot Import page)entry_time: entry time in HHMM or HHMMSS format (e.g., "0933" or "093310")entry_time_end: end of entry window in HHMM or HHMMSS format (e.g., "0935" or "093510")entry_weekday: trading days (1-5, where 1=Monday, 5=Friday)
Position sizing
quantity_type: one of:bpuorbpu-percent: percentage of account balance, entered as a decimal (e.g., 0.5 for 50%)leverage: leverage-based sizingfixed: fixed quantity
quantity_target: target value based on quantity_type
Strike target type
entry_type: one of:delta: delta-based entryprice: price-based entryminimum_premium: minimum premium-based entrypercent: percentage-ITM or OTM based entry, entered as a decimal (e.g., 0.5 for 50%); positive is OTM, negative is ITMpoints: points-ITM or OTM based entry; positive is OTM, negative is ITM
entry_target: target value based on entry_type
Spread parameters (for spread strategies)
spread_type: one of:delta: delta-targeted spread legpercent: percentage-ITM or OTM based spread leg, entered as a decimal (e.g., 0.5 for 50%); positive is OTM, negative is ITMprice: price-targeted spread legpoints: points width from main strike of spreadunderlying_percent_width: Vertical Width-Underlying %; the width between the main strike and wing is a percentage of the underlying's current price
spread_target: target value based on spread_type. Forunderlying_percent_width, enter a decimal such as0.01for a 1% width; a positive value puts the wing further out of the money and a negative value puts it further in the money.spread_max_width: maximum width for price-based spreads
underlying_percent_width applies to the wing of a two-leg spread or both wings of an iron condor; the importer rejects it for other bot types. It needs a live underlying price, so it is unavailable for NDX and RUT on Tradier accounts.
DTE parameters
dte_min: minimum days to expirationdte_max: maximum days to expiration
Entry window configuration
entry_window_length: entry window duration in minutes (can include fractional minutes for seconds precision, e.g., 0.5 for 30 seconds)
Optional parameters
Stop loss (algo stops only)
stoploss_type: one of:priceOffset: price offset stoppercent: percentage-based stop, entered as a decimal (e.g., 0.5 for 50%)delta: delta-based stopnone: no stop loss
stoploss_target: target value based on stoploss_typestop-grouping: one of:single: Each Legvertical: Verticalsshorts-one: Each Shortshorts-shorts: All Shorts on Shortshorts-all: Entire Trade on Shortlongs-all: Entire Trade on Long
Auto conflict resolution
opt#-autoConflict: set to "1" to enable auto conflict resolution for the leg number # (replace # with the leg number)autoConflict-to: set to the maximum points to adjust towards the money to resolve a conflictautoConflict-from: set to the maximum points to adjust away from the money to resolve a conflict
Profit target
profittarget_type: one of:percent: percentage-based target, entered as a decimal (e.g., 0.5 for 50%)price: price-based target
profit_target: target value based on profittarget_type
Price filters
minimum_price(aliasminPrice): minimum price for the entire trade that the bot will attempt to entermaximum_price(aliasmaxPrice): maximum price for the entire trade that the bot will attempt to enter
Timed exit
forceclose_time: force close time (HHMM format)forceclose_day: days before expiration to force close
Event day filter
entry_filter_special_days: a string of 1s and 0s, one digit per day category, where 1 means trade that day and 0 means do not. The string is twenty digits long: digit 0 for ordinary days, then one digit for each of the nineteen event categories.- Digit 0 sets the Filter Behavior. Set it to
1for Do Not Trade Selected Days: the bot trades ordinary days and skips the event days you left at 0. Set it to0for Only Trade Selected Days: the bot trades only the event days you set to 1 and skips everything else, ordinary days included. Note that a set digit always means "trade that day", so the days the bot form shows as selected are the digits left at0under Do Not Trade Selected Days, and the digits set to1under Only Trade Selected Days. - Digit order is:
- 0=All Other Days (the Filter Behavior, see above)
- 1=FOMC Press Conferences, Day Before
- 2=FOMC Press Conferences, Day Of
- 3=FOMC Press Conferences, Day After
- 4=Monthly CPI Report, Day Before
- 5=Monthly CPI Report, Day Of
- 6=Monthly CPI Report, Day After
- 7=Last Trading Day of the Non-Quarter-End Month
- 8=Last Trading Day of the Quarter
- 9=Monthly OPEX, Day Before
- 10=Monthly OPEX, Day Of
- 11=Monthly OPEX, Day After
- 12=Monthly Jobs Report, Day Before
- 13=Monthly Jobs Report, Day Of
- 14=Monthly Jobs Report, Day After
- 15=GDP Release, Day Before
- 16=GDP Release, Day Of
- 17=GDP Release, Day After
- 18=First Trading Day of Month
- 19=Early Close Day
Worked examples:
11001111111111111111: trade every day except the day of and the day after FOMC. Digit 0 is 1, and digits 2 and 3 are the only 0s.00000100000000000000: trade only on the day of the monthly CPI report, and skip every other day. Digit 0 is 0, and digit 5 is the only 1.01111111111111111111: trade only on event days, whichever event it is, and skip ordinary days.11111111111111111111: trade every day. This is the same as leaving the event day filter off.
1-1001111111111111111 imports the same as 11001111111111111111.Twelve-digit strings from older files
The original twelve-digit string is still accepted and still means what it always did. Its digits are 0 through 11 in the list above, covering ordinary days and the first eleven event categories.
A twelve-digit string has no way to name the monthly jobs report, GDP release, first trading day of the month or early close categories, which are digits 12 through 19, so it leaves all eight unselected under either Filter Behavior. Use the twenty-digit form to set them at import time, or set them in the bot form afterward.
110011111111 widens to 11001111111111111111, and 001100000000 widens to 00110000000000000000.Sequential trades management
seq_max_trades: maximum number of tradesseq_max_stops: maximum number of stops per dayseq_reentry_delay: re-entry delay in minutes (supports fractional minutes for seconds precision, e.g., 0.5 for 30 seconds)
User endpoint filter
user_endpoint_filter: custom endpoint filter URL for trade entry conditions
Example
Here is an example of a complete bot import file:
[templates]
template_name=default_template
entry_window_length=30
accountNum=######## <-- replace with the account number you want to use for this bot
[[trade_params]]
name={symbol} Short Put
type=ShortPut
symbol=AAPL
template=default_template
stratCode=STRAT123
entry_time=0930
entry_weekday=12345
quantity_type=bpu
quantity_target=0.1
entry_type=delta
entry_target=-0.3
dte_min=30
dte_max=45
stoploss_type=percent
stoploss_target=0.5
profittarget_type=percent
profit_target=0.3
minimum_price=10
maximum_price=20
entry_filter_special_days=11001111111111111111
[[trade_params]]
name={symbol} Put Credit Spread
type=PutCreditSpread
symbol=AAPL
template=default_template
entry_time=0930
entry_weekday=12345
quantity_type=fixed
quantity_target=1
entry_type=delta
entry_target=-0.3
spread_type=underlying_percent_width
spread_target=0.01
dte_min=30
dte_max=45