# Table of Contents - [Welcome | Option Alpha](#welcome-option-alpha) - [Intro to Option Alpha | Option Alpha](#intro-to-option-alpha-option-alpha) - [Create custom watchlists | Option Alpha](#create-custom-watchlists-option-alpha) - [Connecting your brokerage account | Option Alpha](#connecting-your-brokerage-account-option-alpha) - [Make your first trade | Option Alpha](#make-your-first-trade-option-alpha) - [Creating a bot | Option Alpha](#creating-a-bot-option-alpha) - [Getting Started | Option Alpha](#getting-started-option-alpha) - [Bots | Option Alpha](#bots-option-alpha) - [Managing Positions | Option Alpha](#managing-positions-option-alpha) - [Finding Trades | Option Alpha](#finding-trades-option-alpha) - [Clone Bot Templates | Option Alpha](#clone-bot-templates-option-alpha) - [Monitor Automations | Option Alpha](#monitor-automations-option-alpha) - [Creating a backtest | Option Alpha](#creating-a-backtest-option-alpha) - [Backtesting | Option Alpha](#backtesting-option-alpha) - [Automate your strategy | Option Alpha](#automate-your-strategy-option-alpha) - [Comparing and combining backtests | Option Alpha](#comparing-and-combining-backtests-option-alpha) - [Earnings Edge | Option Alpha](#earnings-edge-option-alpha) - [Automation logs | Option Alpha](#automation-logs-option-alpha) - [0DTE Oracle | Option Alpha](#0dte-oracle-option-alpha) - [Exit Options | Option Alpha](#exit-options-option-alpha) - [Best practices | Option Alpha](#best-practices-option-alpha) - [Tags | Option Alpha](#tags-option-alpha) - [Loops | Option Alpha](#loops-option-alpha) - [Backtesting Metrics | Option Alpha](#backtesting-metrics-option-alpha) - [Automations | Option Alpha](#automations-option-alpha) - [Scanners | Option Alpha](#scanners-option-alpha) - [Webhooks | Option Alpha](#webhooks-option-alpha) - [Safeguards | Option Alpha](#safeguards-option-alpha) - [SmartPricing | Option Alpha](#smartpricing-option-alpha) - [Decision actions | Option Alpha](#decision-actions-option-alpha) - [Platform | Option Alpha](#platform-option-alpha) - [Infrastructure & Security | Option Alpha](#infrastructure-security-option-alpha) - [Parameter Selection | Option Alpha](#parameter-selection-option-alpha) - [Calculations | Option Alpha](#calculations-option-alpha) - [Supported Ticker Symbols | Option Alpha](#supported-ticker-symbols-option-alpha) - [Ex Dividend & Earnings Dates | Option Alpha](#ex-dividend-earnings-dates-option-alpha) - [Inputs | Option Alpha](#inputs-option-alpha) - [Order Handling | Option Alpha](#order-handling-option-alpha) - [Supported Browsers | Option Alpha](#supported-browsers-option-alpha) - [Automations | Option Alpha](#automations-option-alpha) - [Data Feeds | Option Alpha](#data-feeds-option-alpha) - [Bot Limitations | Option Alpha](#bot-limitations-option-alpha) - [Trade Ideas | Option Alpha](#trade-ideas-option-alpha) - [Automation Behavior | Option Alpha](#automation-behavior-option-alpha) - [Options Expiration Protocol | Option Alpha](#options-expiration-protocol-option-alpha) - [Decision Calculations | Option Alpha](#decision-calculations-option-alpha) - [Autotrading Best Practices | Option Alpha](#autotrading-best-practices-option-alpha) - [Understanding Alpha and Expected Value | Option Alpha](#understanding-alpha-and-expected-value-option-alpha) - [Testing Automations | Option Alpha](#testing-automations-option-alpha) - [Probability | Option Alpha](#probability-option-alpha) - [Day Trading | Option Alpha](#day-trading-option-alpha) - [FAQs | Option Alpha](#faqs-option-alpha) - [Probability Theory | Option Alpha](#probability-theory-option-alpha) - [Troubleshooting | Option Alpha](#troubleshooting-option-alpha) - [Position Limit Warnings | Option Alpha](#position-limit-warnings-option-alpha) - [Decision Properties | Option Alpha](#decision-properties-option-alpha) - [Pricing Anomaly Warning | Option Alpha](#pricing-anomaly-warning-option-alpha) - [Supported Countries | Option Alpha](#supported-countries-option-alpha) - [Broker Rejection Errors | Option Alpha](#broker-rejection-errors-option-alpha) - [Excessive Errors Failsafe | Option Alpha](#excessive-errors-failsafe-option-alpha) - [Daily Symbol Limit Error | Option Alpha](#daily-symbol-limit-error-option-alpha) - [Overlapping Strikes Failsafe | Option Alpha](#overlapping-strikes-failsafe-option-alpha) - [Price Exceeds Strike-Difference Error | Option Alpha](#price-exceeds-strike-difference-error-option-alpha) - [Duplicate Orders Error | Option Alpha](#duplicate-orders-error-option-alpha) - [Option & Expiration Availability | Option Alpha](#option-expiration-availability-option-alpha) - [Profit and Loss | Option Alpha](#profit-and-loss-option-alpha) - [Bot Event Loops | Option Alpha](#bot-event-loops-option-alpha) - [Capital Warnings | Option Alpha](#capital-warnings-option-alpha) - [Missing or Invalid Input | Option Alpha](#missing-or-invalid-input-option-alpha) - [Invalid Authorization Error | Option Alpha](#invalid-authorization-error-option-alpha) - [Trade Enforcements | Option Alpha](#trade-enforcements-option-alpha) - [ATR | Option Alpha](#atr-option-alpha) - [EMA | Option Alpha](#ema-option-alpha) - [ROC | Option Alpha](#roc-option-alpha) - [CCI | Option Alpha](#cci-option-alpha) - [CMO | Option Alpha](#cmo-option-alpha) - [MACD | Option Alpha](#macd-option-alpha) - [MFI | Option Alpha](#mfi-option-alpha) - [RSI | Option Alpha](#rsi-option-alpha) - [ADX | Option Alpha](#adx-option-alpha) - [KAMA | Option Alpha](#kama-option-alpha) - [SMA | Option Alpha](#sma-option-alpha) - [STOCH | Option Alpha](#stoch-option-alpha) - [WILLIAMS %R | Option Alpha](#williams-r-option-alpha) - [STOCH RSI | Option Alpha](#stoch-rsi-option-alpha) - [DX | Option Alpha](#dx-option-alpha) - [GEX | Option Alpha](#gex-option-alpha) - [ULTIMATE OSCILLATOR | Option Alpha](#ultimate-oscillator-option-alpha) - [TRIMA | Option Alpha](#trima-option-alpha) - [Indicators | Option Alpha](#indicators-option-alpha) - [BOP | Option Alpha](#bop-option-alpha) - [MOM | Option Alpha](#mom-option-alpha) - [BOLLINGER BANDS | Option Alpha](#bollinger-bands-option-alpha) --- # Welcome | Option Alpha We've tailored all our resources to help traders like you. Whether you're new to trading and need in-depth guides or you're an automation pro and have a technical question, we've got everything you need right here. Pick a topic below to get started. play Don't have an Option Alpha account yet? Start your 30-day FREE trial: [Start Free Trial](https://app.optionalpha.com/login) [](https://docs.optionalpha.com/option-alpha-intro) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FcfUOYQUIxIOKv22TAWwi%252FOA-Icon-Thumbnail-Intro%2520to%2520Option%2520Alpha.png%3Falt%3Dmedia%26token%3Dfe1d1766-4083-4518-afb2-a878637e9d2f&width=752&dpr=3&quality=100&sign=a203d23b&sv=2) **Intro to Option Alpha** [](https://docs.optionalpha.com/getting-started) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FSQhSJ6YwuSPuMJxOFu7I%252FOA-Icon-Thumbnail-Getting%2520Started.png%3Falt%3Dmedia%26token%3D8d035726-b184-4d58-81c8-f69696fa2f5a&width=752&dpr=3&quality=100&sign=746832bf&sv=2) **Getting Started** [](https://docs.optionalpha.com/tools/bots) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F34mpFXWw4adM1eSseFhb%252FOA-Icon-Thumbnail-Bots.png%3Falt%3Dmedia%26token%3D82654085-bbf5-421f-ac47-795058aa0962&width=752&dpr=3&quality=100&sign=304d27e9&sv=2) **Bots** [](https://docs.optionalpha.com/tools/finding-trades) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FpBYVpPqAqHfh71lLWeRE%252FOA-Icon-Thumbnail-Finding%2520Trades.png%3Falt%3Dmedia%26token%3D928afd85-a6b9-4b82-825d-67f97024a306&width=752&dpr=3&quality=100&sign=fa3bc45d&sv=2) **Finding Trades** [](https://docs.optionalpha.com/tools/backtesting) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fbriz8ETboQUFDR52rKus%252FOA-Icon-Thumbnail-Backtesting.png%3Falt%3Dmedia%26token%3D6c60858b-62b3-4bfa-864e-a5f6d231da1f&width=752&dpr=3&quality=100&sign=36f0fbf5&sv=2) **Backtesting** [](https://docs.optionalpha.com/tools/managing-positions) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FCAkX4tKIsEmXN6fH69Fj%252FOA-Icon-Thumbnail-Managing%2520Positions.png%3Falt%3Dmedia%26token%3D4f324a37-e522-4001-a28c-04763b98f368&width=752&dpr=3&quality=100&sign=91e47671&sv=2) **Managing Positions** [](https://docs.optionalpha.com/tools/clone-bot-templates) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fdz4hxKs58uqUI80H1d9e%252FOA-Icon-Thumbnail-Clone%2520Bot%2520Templates.png%3Falt%3Dmedia%26token%3D8cb8f5a9-d999-42bb-a3de-59df7bc3c8aa&width=752&dpr=3&quality=100&sign=1501b2b1&sv=2) **Clone Bot Templates** [](https://docs.optionalpha.com/technical-documentation/platform) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FkeUl3Npu4XvMGC8D6iTx%252FOA-Icon-Thumbnail-Platform.png%3Falt%3Dmedia%26token%3D0427a223-fabb-403b-ad7f-63acdd0de9d8&width=752&dpr=3&quality=100&sign=37867628&sv=2) Platform Tech Docs [](https://docs.optionalpha.com/technical-documentation/calculations) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fov0TxZSCibuBH1mznZZC%252FOA-Icon-Thumbnail-Calculations.png%3Falt%3Dmedia%26token%3Dc1757425-8faf-41fb-a5e0-5b5846ab402a&width=752&dpr=3&quality=100&sign=4f36bb55&sv=2) Calculations [](https://docs.optionalpha.com/technical-documentation/indicators) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FZVEPhJznvJtRSQaYr1PZ%252FOA-Icon-Thumbnail-Indicators.png%3Falt%3Dmedia%26token%3D1cd868ba-e228-4e3f-acee-f51a2d768faf&width=752&dpr=3&quality=100&sign=b24b3e2b&sv=2) Platform Indicators Last updated 1 month ago Was this helpful? --- # Intro to Option Alpha | Option Alpha [hashtag](https://docs.optionalpha.com/option-alpha-intro#our-mission-trade-with-discipline-and-consistency) Our Mission: Trade with discipline and consistency -------------------------------------------------------------------------------------------------------------------------------------------------------------------- We believe automation can help traders trade with more discipline and consistency. That is why we build tools for finding better opportunities, backtesting ideas, and automating strategies so traders can trade with conviction. ### [hashtag](https://docs.optionalpha.com/option-alpha-intro#find-opportunities.-backtest-ideas.-automate-strategies) Find Opportunities. Backtest Ideas. Automate Strategies. #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#find-trades) Find Trades * Use [Trade Ideasarrow-up-right](https://app.optionalpha.com/tradeideas) to "shop" for trades with a positive expected value (EV) * Scan for [0DTE tradesarrow-up-right](https://app.optionalpha.com/zdte) by backtesting position metrics against historical price movements * [Screenarrow-up-right](https://app.optionalpha.com/screener) for new symbols by options liquidity, technical indicators, momentum and more * Innovative [Research Reportsarrow-up-right](https://app.optionalpha.com/research) updated nightly * Find backtested earnings trades with [Earnings Edgearrow-up-right](https://app.optionalpha.com/earnedge) #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#backtesting) Backtesting * [Backtestarrow-up-right](https://app.optionalpha.com/zdte/backtester) a strategy to fine tune for maximum profits * Search [Top Backtestsarrow-up-right](https://app.optionalpha.com/zdte/backtester/toptests) to find a new strategy #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#automation) Automation * Use bot [automations](https://docs.optionalpha.com/tools/bots/automations) to find, open, and manage positions that match your entry criteria * Use [Exit Options](https://docs.optionalpha.com/tools/managing-positions/exit-options) to monitor and close positions when your exit criteria are met * Leverage [SmartPricing](https://docs.optionalpha.com/tools/bots/smartpricing) to get trades filled at the best available price #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#learn-from-other-traders) Learn From Other Traders * Explore the [Top Bot Templatesarrow-up-right](https://app.optionalpha.com/community/toptpls) in the OA community * See the [Top Strategiesarrow-up-right](https://app.optionalpha.com/topstrategies) other traders are using to find success * Get help and learn from the collective knowledge of the [OA communityarrow-up-right](https://app.optionalpha.com/community) [hashtag](https://docs.optionalpha.com/option-alpha-intro#why-bots) Why Bots --------------------------------------------------------------------------------- Bots are like a trading assistants that perform trading tasks for you. Bots are consistent, emotionless and systematic. Bots can do many things including: * Scan for new positions that match your entry criteria * Initiate trades to open positions when they are available * Place multiple orders between the bid/ask spread to get trades filled at the best possible price * Monitor positions waiting for predefined exit conditions Combine all of these to execute a fully automated trading strategy. #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#automations) Automations Your bot can use market data and indicators to make decisions, open and close positions, send you notifications and much more. Automations are the instructions you add to your bot that define the actions you want it to perform: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F7Kyq7jv58dpq6AlVyqtq%252Faddautofull.png%3Falt%3Dmedia%26token%3D8a570bb6-904f-40ad-9194-d249a0590571&width=768&dpr=3&quality=100&sign=3f44f4cd&sv=2) Automations can be scheduled to run continuously every 1 minute, based on a repeating schedule, when you click a button, and many more options: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FlFkOgVNXQ2MNE6UIrVFh%252Fsched.png%3Falt%3Dmedia%26token%3D60a02b45-a329-4842-982d-636407e31290&width=768&dpr=3&quality=100&sign=daebc62f&sv=2) #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#scanning-for-positions) Scanning for Positions For example, add a scanner automation to your bot to watch for specific entry conditions and automatically open a position when it's available: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FYT0toSZmkCMsgn1Vl5Ta%252Fautotree.png%3Falt%3Dmedia%26token%3D5b60e54b-407c-4023-8e51-ff383e1f6e62&width=768&dpr=3&quality=100&sign=e8f9826f&sv=2) #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#monitoring-and-exiting-positions) Monitoring and Exiting Positions After your bot opens a position, it will monitor the position every 1 minute checking for your predefined exit criteria: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FhAXjtPJ8s5HA2bU2BqsT%252Fexits.png%3Falt%3Dmedia%26token%3D3ce0b6d3-be07-45c3-9d0e-428d04f7bd16&width=768&dpr=3&quality=100&sign=a85d8219&sv=2) You can also add a monitor automation to your bot that checks for more specific exit conditions: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F9XmyZSoHqWmcSd1o6byz%252Fmonitor.png%3Falt%3Dmedia%26token%3Db8e7e515-0df7-4c12-91ce-8b6fa21d881e&width=768&dpr=3&quality=100&sign=43e9b62a&sv=2) #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#transparency) Transparency Everything the bot does is logged with full transparency. No black box here! Your bot's log has details of what happened each time an automation runs: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FYWFolUl0oi1Mo3Qro3zu%252Fbotlog.png%3Falt%3Dmedia%26token%3D935ae4ef-ef9f-4fba-a06b-2ed668eaabb9&width=768&dpr=3&quality=100&sign=65c47e40&sv=2) Including the actions executed in the automation: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FVMWVpGj298IW8NH7JcTj%252Fautolog.png%3Falt%3Dmedia%26token%3Daeed7b92-5329-493d-8b30-c6781e66a857&width=768&dpr=3&quality=100&sign=aa7f04af&sv=2) You can even inspect the exact data the bot used when making decisions: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FFDkwKZSZxKITeF2RYeHU%252Fdecisionlog.png%3Falt%3Dmedia%26token%3D75276f71-ecce-48f5-b757-2929fa027b0f&width=768&dpr=3&quality=100&sign=b8194cc5&sv=2) and opening positions: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FpzxKZttVePlhaxsLx4wp%252Fposlog.png%3Falt%3Dmedia%26token%3Dd6cadb80-ea41-4b0b-af15-996de8b84f30&width=768&dpr=3&quality=100&sign=6ed27fe3&sv=2) #### [hashtag](https://docs.optionalpha.com/option-alpha-intro#profit-and-loss) Profit and Loss Your bot logs the profit and loss for all of its positions so you can keep track of it's profitability: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F6c8tcb8SBK6BLpeJpysu%252Fbotdash.png%3Falt%3Dmedia%26token%3D198c7014-9608-4a5f-ba56-fd48e59765b7&width=768&dpr=3&quality=100&sign=88ccfac7&sv=2) [hashtag](https://docs.optionalpha.com/option-alpha-intro#fully-automated-example-bots) Fully Automated Example Bots ------------------------------------------------------------------------------------------------------------------------- The bot templates below include a step-by-step video showing how to set up a bot from scratch to find, open and manage positions automatically: [](https://app.optionalpha.com/community/member/jackslocum/post/wifly-1dte-60-wide) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fh5jWQWVXm75LysbKAYkZ%252FWiFly%25201DTE%2520%252460%2520Wide.png%3Falt%3Dmedia%26token%3Dd5795b2f-00dd-4623-b30c-438f95a448d7&width=752&dpr=3&quality=100&sign=410c457d&sv=2) **WiFly 1DTE $60 Wide** Daily SPX 1DTE iron butterfly managed at 15% [](https://app.optionalpha.com/community/member/jackslocum/post/auto-ideas-etfs) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FQQs7DECmK0GQ5j9rnii1%252FAuto%2520Ideas%2520-%2520ETFs.png%3Falt%3Dmedia%26token%3D95a9dc6e-1db3-4810-9ada-bb4c40a5657d&width=752&dpr=3&quality=100&sign=a86ff21&sv=2) **Auto Ideas - ETFs** Cherry picks credit spreads with favorable metrics from Trade Ideas [](https://app.optionalpha.com/community/member/jackslocum/post/peggie-bank) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FPebcF8SCtpF1dWD5Hluf%252FPeggie%2520Bank.png%3Falt%3Dmedia%26token%3D0e0145ec-c8ff-42db-aeb0-13cad6e1a158&width=752&dpr=3&quality=100&sign=82367927&sv=2) **Peggie Bank** SPX 0DTE bot based on intraday price "pegging" research located in OA Labs [](https://app.optionalpha.com/community/member/jackslocum/post/rev-ninja-etfs) ![Cover](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F98YkwVJLsVUZRJIn7E4M%252FRev%2520Ninja%2520ETFs.png%3Falt%3Dmedia%26token%3D3ce70961-3b63-4898-b648-faba9140bf9f&width=752&dpr=3&quality=100&sign=7d7a2b7b&sv=2) **Rev Ninja ETFs** Simple RSI based mean reversion strategy + Trade Ideas [hashtag](https://docs.optionalpha.com/option-alpha-intro#new-ways-to-find-trading-opportunities) New Ways To Find Trading Opportunities --------------------------------------------------------------------------------------------------------------------------------------------- Option Alpha provides several innovative ways for finding new trades, each tool designed to provide insights for a specific trading opportunity available to options traders... ### [hashtag](https://docs.optionalpha.com/option-alpha-intro#trade-ideas) Trade Ideas Finds trades with an edge based on EV and probabilities. The Trade Ideas backend scans continuously during market hours (9:35 am - 3:55 pm) and finds trade ideas in 3 ways: * Analyzes the top-performing position setups used by all traders in the platform. * Analyzes every option series expiring in 45 days or less that falls on a Friday and matches up every possible combination of legs at common delta values. * It examines all current open positions in the platform that are looking for opportunities. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FlWFFUYCfXj5ulgzJdFPJ%252Ftideas.png%3Falt%3Dmedia%26token%3D93c899eb-2105-4f04-9248-50d0d7a8f38f&width=768&dpr=3&quality=100&sign=e5be98da&sv=2) ### [hashtag](https://docs.optionalpha.com/option-alpha-intro#id-0dte-oracle) 0DTE Oracle Find and analyze 0DTE and next-day trading opportunities. It aims to solve the problem of probabilities and expected value (EV) being less accurate for 0DTE trades by providing backtest results to help us identify quality trades instead of relying on probabilities. Each trade's metrics are backtested against the underlying's previous 1 year of intraday minute data to see how trading a similar position daily would have performed over that time. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F7gL7VU3u5EZUXxWIlKgE%252Fzdte.png%3Falt%3Dmedia%26token%3Db61051b7-0527-480e-b32c-bdd111317b83&width=768&dpr=3&quality=100&sign=6f8cfd01&sv=2) Last updated 20 days ago Was this helpful? * [Our Mission: Trade with discipline and consistency](https://docs.optionalpha.com/option-alpha-intro#our-mission-trade-with-discipline-and-consistency) * [Find Opportunities. Backtest Ideas. Automate Strategies.](https://docs.optionalpha.com/option-alpha-intro#find-opportunities.-backtest-ideas.-automate-strategies) * [Why Bots](https://docs.optionalpha.com/option-alpha-intro#why-bots) * [Fully Automated Example Bots](https://docs.optionalpha.com/option-alpha-intro#fully-automated-example-bots) * [New Ways To Find Trading Opportunities](https://docs.optionalpha.com/option-alpha-intro#new-ways-to-find-trading-opportunities) * [Trade Ideas](https://docs.optionalpha.com/option-alpha-intro#trade-ideas) * [0DTE Oracle](https://docs.optionalpha.com/option-alpha-intro#id-0dte-oracle) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Create custom watchlists | Option Alpha Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Connecting your brokerage account | Option Alpha You can easily connect and manage your trading accounts inside the platform. Go to [Settings --> Trading Accountsarrow-up-right](https://app.optionalpha.com/settings/accounts) to connect your brokerage account and manage all account types, including any paper trading accounts. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FV5jGrDBW3v26gEeYe5GS%252Fimage.png%3Falt%3Dmedia%26token%3D5d73a339-6935-4e8e-a64e-30648cbd0ea6&width=768&dpr=3&quality=100&sign=cc2c4f05&sv=2) To connect a brokerage account, select the "Authorize" button. This sends you to your broker's secure log-in page. Input your account information and select "Log in." You will immediately be re-directed to the trading accounts page. All your connected and compatible accounts available for autotrading are displayed with their options approval levels. You can always delete and remove connected accounts from the platform. You can also rename an account, which will only be visible within the Option Alpha platform. You can connect your Option Alpha account to multiple brokerages, and each broker can have multiple connected accounts. However, you can only use one log-in per broker. Once your brokerage account(s) are connected to the autotrading platform, you are ready to begin trading. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Make your first trade | Option Alpha While automation offers powerful tools for streamlining your trading strategies, many traders prefer to take a more hands-on approach. Option Alpha’s platform provides robust capabilities for manual trading, giving you the flexibility to open and close positions directly from various sections of the platform. Whether you prefer to trade manually or blend manual and automated strategies, the platform offers the tools you need to succeed. ### [hashtag](https://docs.optionalpha.com/getting-started/make-your-first-trade#flexibility-in-manual-trading) Flexibility in Manual Trading One of the key advantages of manual trading on Option Alpha is the flexibility it offers. You can initiate manual trades from multiple areas within the platform, allowing you to choose the most convenient location for entering your trades. This adaptability means you can act quickly on market opportunities without being confined to a single method or section of the platform. ### [hashtag](https://docs.optionalpha.com/getting-started/make-your-first-trade#the-new-position-window) The ‘New Position’ Window At the heart of manual trading on Option Alpha is the universal **New Position** window. This window is designed to streamline the process of opening new positions, providing a consistent and user-friendly interface no matter where you access it from within the platform. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F66c8b700472d2315dc9cd697_66c8b6e44cf3426c09e43284_new-position-window.png&width=768&dpr=3&quality=100&sign=f222ff78&sv=2) #### [hashtag](https://docs.optionalpha.com/getting-started/make-your-first-trade#key-features-of-the-new-position-window) Key Features of the New Position Window * **Symbol Selector**: Quickly choose the ticker symbol for the security you wish to trade. * **Strategy Type Selector**: Select from a variety of trading strategies to tailor your position to your market outlook. * **Expiration Selector**: Easily choose the expiration date for your options, helping you align your trade with your time horizon. * **Access to Visual Charts**: The New Position window also provides access to several visual charts, offering deeper insights into market conditions:some text * **Main Pain Theory**: Analyze the potential pain point for options sellers. * **Open Interest**: View where traders are most heavily positioned in the options market. * **Daily Option Volume**: Track the daily trading volume for options. * **Implied Volatility Skew**: Examine the skew of implied volatility across different strikes. * **Historical vs. Implied Probability of Expiring ITM**: Compare historical probabilities with current implied probabilities to make informed decisions. * **Quantity Control**: You have full control over the number of contracts or shares you wish to trade, allowing you to scale your position size according to your strategy. * **Final Price Setting**: The final price is the amount you are willing to accept when selling an option or the maximum you are willing to pay when buying. This price is determined by SmartPricing and defaults to 100% of the bid/ask spread if not specified. You can adjust this to suit your trading preferences, ensuring you’re comfortable with the terms of your order. * **SmartPricing Preferences**: Option Alpha’s SmartPricing feature lets you choose the speed at which your order is executed. You can select from:some text * **Normal**: A balanced approach to pricing. * **Fast**: Prioritizes speed over price. * **Patient**: Focuses on getting the best price, even if it takes longer. * **Market Order**: Executes the order immediately at the current market price. * **Turn Off SmartPricing**: Submit a single limit price without SmartPricing’s intervention. * **Bot Assignment**: Every manual position must be assigned to a bot. This is because a bot acts as the container or “home” for the position, providing the necessary services to monitor and manage it effectively. This requirement ensures that even manually entered positions benefit from the same robust management features as automated ones. * **Exit Options**: The New Position window allows you to set exit options for your trade from the start. Once set, these options are assigned to the position for its entire lifecycle, reducing the need for further management and making the process more convenient. Manual trading on Option Alpha is designed to give you full control over your trades while still benefiting from the platform’s powerful automation tools. The universal New Position window centralizes all the features you need to make informed decisions and manage your trades effectively. By combining manual trade entry with automated position management, you can create hybrid strategies that leverage the best of both worlds, allowing you to respond to market conditions with precision and confidence. Last updated 2 months ago Was this helpful? * [Flexibility in Manual Trading](https://docs.optionalpha.com/getting-started/make-your-first-trade#flexibility-in-manual-trading) * [The ‘New Position’ Window](https://docs.optionalpha.com/getting-started/make-your-first-trade#the-new-position-window) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Creating a bot | Option Alpha To create a new bot, select “Create Bot" in the bot dashboard. Customize the bot with a name and icon, select a brokerage or paper trading account, give the bot an allocation, and input position limits in the bot's global settings. Global settings can be edited anytime but must be entered when a bot is created. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#name) Name Give your bot a name. Naming the bot makes it easy to remember the bot’s purpose, inputs, and strategy. As you add more bots to your portfolio, it is important for the name to be easily identifiable to help keep you organized. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#icon) Icon You can customize your bot with a colored icon to help identify your strategies and organize your portfolio. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#account) Account Link the bot to a connected brokerage account or paper trading account. You cannot change the bot's account after you create the bot (you'll need to [clone the botarrow-up-right](https://optionalpha.com/help/templates-and-cloning) to change accounts). You do not need to have a connected brokerage account to use the Option Alpha paper trading account. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#allocation) Allocation Allocation is the total capital available for the bot to open positions. The bot will not enter new positions if it exceeds the allocation limit. Bot allocation limits are calculated at position entry. Allocation is different than risk or position limits. Allocation is the total purchasing power the bot has to open new positions. Risk defines the maximum amount that can be lost on a single position and can be set as a dollar or percentage amount in the automation editor. Market conditions at position closing may cause increased capital allocations beyond the calculated maximum risk at position entry. If the market is illiquid or bid-ask spreads are wide, bots have the potential to risk more capital when the position is closed than was allocated at entry. For example, if there is a wide bid-ask spread for a credit spread position, the ask price to close the spread may exceed the spread’s width. As always, you have the ability to [override positionsarrow-up-right](https://optionalpha.com/help/managing-positions) , or [SmartPricingarrow-up-right](https://optionalpha.com/help/smartpricing) settings, exit criteria, and orders at any time. If you manually override a position, the Option Alpha platform no longer communicates with the position The position will not count against position limits or capital allocation limits. You may need to re-consider your bot’s capital allocation limit if you manually override positions. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#position-limits-daily) Position Limits - Daily You must also set daily and total position limits when creating a bot. Bot scanners and other entry automations automatically turn off when a position limit is reached. The daily limit is the maximum number of positions the bot can open in one day. For example, a bot with a daily limit of three positions will stop scanning for new positions if three positions have been opened in one trading day. Position limits are for opening positions only; you can close as many positions as you want. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#position-limits-total) Position Limits - Total The total limit is the maximum number of open positions available for a bot. The bot will not open new positions if the total position limit is reached. For example, a bot with a total limit of six positions will stop scanning for new positions if there are six positions open inside the bot. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#create-bot) Create Bot Select “Create Bot” after you enter the global settings. You may edit the bot settings later if you want to make changes. Your new bot is added to your portfolio. The Positions tab, Automations tab, and Bot Log are blank and ready for you to add automations. New bots are automatically "Off" by default when created. To turn on the bot, simply toggle the switch to "On" in the top right corner of the dashboard. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#converting-a-paper-bot-to-a-live-bot) Converting a paper bot to a live bot A bot's account connection cannot be changed. To make a paper bot live, you'll need to [clone the bot](https://docs.optionalpha.com/tools/clone-bot-templates) and change the account type to connect it to a live brokerage account. Click the ••• in the bot's top right corner and select 'Clone bot.' ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FhoKsh4lM2vpAlQ58hUcA%252FCleanShot%25202026-03-21%2520at%252014.15.32%25402x.png%3Falt%3Dmedia%26token%3Decceaf68-fdc5-43b1-bded-526c1305a096&width=768&dpr=3&quality=100&sign=644b4669&sv=2) ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#deleting-a-bot) Deleting a bot To delete a bot, click on the three dots on the top right of the bot's dashboard and select 'Delete.' Deleting a bot will remove it from your account and all position stats will no longer be accessible. You can always save your bot as a template. There is no limit to the number of templates you can have. ### [hashtag](https://docs.optionalpha.com/getting-started/creating-a-bot#using-the-bot-wizard) Using the Bot Wizard Meet the bot wizard, our latest, groundbreaking technology to help you create bots. The bot wizard is the quickest and easiest way to build a bot and start your autotrading journey. The bot wizard builds an entire bot automatically for you, using your entry and exit criteria for a particular strategy. To build a new bot with the bot wizard, click the button at the top of your Bots homepage and select Bot Wizard. Like creating any new bot, you’ll name the bot, choose an icon, select a paper trading or live account you’ve connected from our list of integrated brokers, and give the bot an allocation limit. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FYO16MMRmGBvpA8AeKc15%252Fimage.png%3Falt%3Dmedia%26token%3D5a78b3d1-d510-4730-b07c-64007e9b297d&width=768&dpr=3&quality=100&sign=c6be3831&sv=2) The bot wizard asks you to input position details such as trade frequency, ticker symbol, strategy type, days until expiration, strike prices, and contract/risk amount. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FPcFlbpU3DFvrCpfavPeM%252Fimage.png%3Falt%3Dmedia%26token%3D3b02e8b2-dbe8-4e16-8e07-3f847b5b37ac&width=768&dpr=3&quality=100&sign=5251431c&sv=2) You can use any of the prefilled recipes we offer inside the platform, and this is a great way to introduce new traders to our easy-to-use, natural language logic. The wizard gives you a lot of flexibility to target specific position types. Plus, you can always modify any of your bot’s settings after it is created. Next, you’ll set up the strategy’s entry criteria using our extensive list of [decision recipesarrow-up-right](https://optionalpha.com/help/decisions) . This is fun because you can use as many decision recipes as you want, and once you’re ready, the bot is created automatically for you inside your account. For example, this bot will only open new positions in SPY if the price is above 500,The VIX rank is between 0-25, and the SPY RSI 14 Indicator is below 30. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FVZIenh0yqYgAi0fkXSlh%252Fimage.png%3Falt%3Dmedia%26token%3Ddbd56668-11e1-4a39-94e2-54614a772539&width=768&dpr=3&quality=100&sign=b9b2d593&sv=2) You simply tell the bot wizard what you want the bot to filter before it opens new positions. You can make your automations as simple or complex as you like. You also have complete control of the exit criteria to manage and close positions exactly how you want. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FDx5NRrjuOegvQ0Wbum4h%252Fimage.png%3Falt%3Dmedia%26token%3D9f34e430-8f1c-497c-b165-af6a64080c0a&width=768&dpr=3&quality=100&sign=a656502b&sv=2) For example, this bot will automatically exit a position if the short put spread has a 50% profit or the position expires in less than two days. Once you’ve completed filling out the wizard and your new strategy is ready, simply click the button to create your bot. Your bot is automatically created on the back end using all the criteria and settings you put into the simple bot wizard. Yep, it’s that easy! You can view your bot immediately and you see your automations. The entry scanner automation automates all criteria that would open a new position. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F9hVCtyBSg386p2WyXFEA%252Fimage.png%3Falt%3Dmedia%26token%3De5ece4ae-bd9e-45b2-8ceb-1615dc753759&width=768&dpr=3&quality=100&sign=218532eb&sv=2) Remember, you can always modify and edit any of the automation’s fields inside the automation editor. Let’s say you want to change the IV rank to be above 75. Well, you simply make that change and then hit save, and you’re good to go with your new entry criteria. You can save all your changes, and the new entry criteria are reflected in the automation editor. We created the bot wizard to streamline the process of creating your first bot and automating your favorite strategies. Remember, you create the bot with your ideas and criteria; the bot wizard makes it simple with easy-to-use natural language recipes. You can always add, remove, or modify any settings before and after turning on the bot. You are in control! Last updated 23 days ago Was this helpful? * [Name](https://docs.optionalpha.com/getting-started/creating-a-bot#name) * [Icon](https://docs.optionalpha.com/getting-started/creating-a-bot#icon) * [Account](https://docs.optionalpha.com/getting-started/creating-a-bot#account) * [Allocation](https://docs.optionalpha.com/getting-started/creating-a-bot#allocation) * [Position Limits - Daily](https://docs.optionalpha.com/getting-started/creating-a-bot#position-limits-daily) * [Position Limits - Total](https://docs.optionalpha.com/getting-started/creating-a-bot#position-limits-total) * [Create Bot](https://docs.optionalpha.com/getting-started/creating-a-bot#create-bot) * [Converting a paper bot to a live bot](https://docs.optionalpha.com/getting-started/creating-a-bot#converting-a-paper-bot-to-a-live-bot) * [Deleting a bot](https://docs.optionalpha.com/getting-started/creating-a-bot#deleting-a-bot) * [Using the Bot Wizard](https://docs.optionalpha.com/getting-started/creating-a-bot#using-the-bot-wizard) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Getting Started | Option Alpha ### [hashtag](https://docs.optionalpha.com/getting-started#what-is-a-bot) What is a bot? A bot - short for “robot” - is simply a tool that executes and manages a trading strategy inside a portfolio. When trading, I tend to repeat activities. First, I start scanning**,** looking for trading opportunities. When I find a potential trade, I analyze data, make a series of decisions, and start opening new positions. Next, I start monitoring my positions, checking for profit and loss targets, watching for changes in indicators, trends, or momentum, and dozens of other things as I manage my trades. These are activities traders do over and over. Option Alpha’s bots follow my instructions using recipes, do exactly what I tell them to do, automate all the decisions, and take the necessary actions of my trading plan that I would otherwise have to perform manually. This means instead of being forced to remember (and have the time to make) all the decisions, bots can run entire trading strategies for me, from start to finish, with consistency, speed, and efficiency. ### [hashtag](https://docs.optionalpha.com/getting-started#how-bots-work) How Bots Work So you’re interested in bots, and they sound pretty cool? Seeing is believing, so let’s walk through how they work. As we mentioned above, bots are an automated version of what you do now, just better. Let’s assume you want to use a simple trend indicator to automate a trend following strategy. Say you want to sell a put credit spread when the market is in an uptrend and avoid selling them when the market is in a downtrend. You can easily automate this strategy with bots. Is this all you can do with bots? No way! We’re just starting with a simple example to show you how it works. We’ll show you a lot more examples later to get your creative juices flowing! ### [hashtag](https://docs.optionalpha.com/getting-started#setting-up-your-bot) Setting up your bot To create a new bot, select “Create Bot” from the Bots homepage. Then, define the bot’s settings and safeguards. * Bot Name and Icon - The name and custom icon you give it (have fun). * Choose an account - Your paper trading account uses live market data, so you can run your bots risk-free. When you're ready, connect a brokerage account to send your orders to your broker for execution. * Allocation - Tells the bot how much of your trading capital it can use to open positions. * Position Limits - The maximum number of positions a bot can open in a day and in total. Defining capital and position limits lets you safely allocate capital between different trading strategies.​ ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F4GH1RWkOH1vwXhZuJbaN%252Fimage.png%3Falt%3Dmedia%26token%3D71bc3c82-cdae-47cb-a0c6-0142d6b8eb5c&width=768&dpr=3&quality=100&sign=8145252e&sv=2) ### [hashtag](https://docs.optionalpha.com/getting-started#adding-automations) Adding automations Trading involves countless repetitive tasks done over and over. Automations efficiently execute those activities for me.​Automations are the instruction manual for a bot that tell it what to do and when. Bot automations move through a framework of decision criteria in a logical progression. You can build automations to run continuously, on a defined schedule, or at the push of a button. There are two automation types: * Scanners - scan for new opportunities * Monitors - manage existing positions Automations include decision recipes. Decision recipes are the set of instructions a bot follows to determine yes and no answers. For example, the bot can check if a ticker symbol is above or below a moving average, what the IV rank is, when expiration is, and much more. There are dozens of recipes to choose from.​ ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FmYfmcDog18YIQmHVHBru%252Fimage.png%3Falt%3Dmedia%26token%3D42fd3f74-8f33-4a39-a2c8-e039ae2e3620&width=768&dpr=3&quality=100&sign=7a8fa431&sv=2) Automations can be as simple or complex as you like. They can be saved and organized with folders in your Automation Library. You can reuse an automation in as many bots as you want. Reusing an automation saves you the time of recreating the entire strategy. You can edit automations at any time. Changing an automation applies the changes to every bot using the automation. You can copy an automation if you want to make changes but preserve the original. Copies let you modify the automation’s actions without affecting the original automation. Reusing automations is a time saver that significantly increases the scalability of autotrading. Many traders use different tickers with different criteria. No problem. Enter custom inputs. Inputs are dynamic tools used in decision recipes across different bots and automations to give you added flexibility. Custom inputs allow you to manually input variable fields, such as the ticker symbol or numerical values, and link fields together within an automation. ### [hashtag](https://docs.optionalpha.com/getting-started#scanning-for-trades) Scanning for trades Trading used to involve scanning watchlists for opportunities, analyzing data, making decisions, and then opening new positions. Now, I use scanner automations to offload those tasks so that I can focus on strategic thinking. Scanner automations run on defined time intervals and look for opportunities to enter new positions based on the decision recipes I choose. For example, if a bot’s objective is to sell a put credit spread when a security is above a long-term moving average, a scanner can do just that. Scanners look for opportunities as long as there is room within the bot’s allocation and position limits. Select the “Settings” tab in your bot's dashboard and choose the “+ Add Automation” to create a new automation and access the automation editor. To start adding instructions to our automation, we’ll select the “+” icon at the top of the editor. The automation editor is where you tell the bot what decision to make and/or what actions to take. It follows “Yes” and “No” paths in a step-by-step format as it moves through your bot’s decisions or takes actions. To start adding instructions to the automation, select the “+” icon. * Create a New Scanner Automation - Name the automation, and save it to the library. * Use a symbol loop to create your custom watchlist. * Add Decisions - There are dozens of different decision actions available with limitless customization options. Decisions are often used at the beginning of a scanner automation so the bot can filter through specific market data before entering a position. You can add as many decisions as you like down both the “Yes” and “No” paths of the automation editor. * Add an Open Position Action - Select a position type, customize the position to fit the strategy, define your position sizing, and set the SmartPricing criteria. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fhs5aHE1MRWu6PoOctjba%252Fimage.png%3Falt%3Dmedia%26token%3Db41c4a10-ecc5-425c-83b0-bda2bc7525fd&width=768&dpr=3&quality=100&sign=481fd67b&sv=2) ### [hashtag](https://docs.optionalpha.com/getting-started#customize-smartpricing) Customize SmartPricing Option Alpha’s proprietary SmartPricing technology places timed limit orders in a sequence, starting near the mid-price, and traverses the bid-ask spread until you reach your final price. You can even customize how far you'll let SmartPricing work beyond the mid-price to avoid costly slippage. Simply said: it finds the best possible price for your order so you don't have to cancel and replace orders manually. SmartPricing orders automatically cancel after two minutes if not filled. By default, order pricing is set to Normal SmartPricing and 100% of the bid/ask spread. There are four different SmartPricing settings that you can customize: * Normal - Works through up to 4 prices, 10 seconds each.‍ * Fast - Works through up to 3 prices, 5 seconds each.‍ * Patient - Works through up to 5 prices, 20 seconds each.‍ * Off - You can always turn off SmartPricing and a limit order will be sent to your broker at 100% of the bid/ask spread or a final price you set. ‍ * Market - Send a market order for immediate execution. Be aware that market orders can fill at a price well beyond the listed bid-ask spread. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FJ2uzTR60m9OQNy0tXSw7%252Fimage.png%3Falt%3Dmedia%26token%3D1d133eda-7e86-4827-9095-a6697d22f87e&width=768&dpr=3&quality=100&sign=e5e5328b&sv=2) Remember, you are in complete control of your bots. You tell the bot when to turn on, what to look for, when to open positions, when to exit positions, and much more. Next, we’ll tell the bot how to exit positions. ### [hashtag](https://docs.optionalpha.com/getting-started#monitoring-positions) Monitoring positions Once you've opened a new position, you have to manage it! Different traders manage positions using different management styles. Sometimes, even the same trader manages different types of strategies with different management styles. Before autotrading, I would set profit and loss targets or create alerts to help manage positions. Or, sometimes, I would sit in front of the screens watching the price action and looking for the right time to get out of the position. With bots, the process is much simpler. Monitor automations manage positions. An army of bots could watch 200 different positions (or more!) with ease. Monitors continuously watch open positions and look to exit or adjust them based on my decision criteria. Like scanner automations, monitors run on defined time intervals. To create a new monitor automation, select “+ Add Automation” in the bot's Settings. * Create a New Monitor Automation - Name the automation, and save it to the library. * Add a Position Loop- These tell the monitor to loop through the same actions for all positions of a certain type. Loops make it incredibly efficient to manage multiple positions. * Add Decisions - Remember, there are dozens of different decisions available, so the sky is the limit for what you can create!SmartStopsis just one example of a decision you can use in a Monitor Automation. SmartStops trail a position once a profit target is hit, and could help you get more out of your positions. * Add a Close Position Action - Set your SmartPricing criteria and exit the trade. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FcdbWd2Fq6E8tx7LIiikn%252Fimage.png%3Falt%3Dmedia%26token%3D42dc7aaf-1cad-46c7-8184-1bfddccaa2e6&width=768&dpr=3&quality=100&sign=5f3ba278&sv=2) Monitors only run if there’s an open position. Monitor automations can be as simple or complex as you like and designed to monitor different position types, multiple underlying securities, or all positions within a bot. With Exit Options, you can pre-set your exit parameters and automate position management every minute of the trading day. Exit Options monitor your positions every minute and will automatically close the position when your criteria are met. Plus, you can use 1-minute trailing stops for ultimate control (including custom safeguards to combat price fluctuations and protect against slippage). We know it's overwhelming to manage all your positions, tracking returns, expiration, earnings, and manually inputting orders over and over. You can customize each position's Exit Options management with five triggers: * Profit * TakingTrailing * StopStop Loss * Before Expiration * Before Earnings ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FFyuJeBJmCfn6zArKEAS5%252Fimage.png%3Falt%3Dmedia%26token%3D16569aba-f35a-44ec-88a2-0042018d6e2d&width=768&dpr=3&quality=100&sign=cc59e7f7&sv=2) ### [hashtag](https://docs.optionalpha.com/getting-started#event-based-automation-triggers) Event-based automation triggers Events convert scheduled, predetermined tasks we already do manually into automated actions. Whether it is dollar-cost averaging, laddering entries, or opening and closing positions at specific times each week, I repeat a lot of activities on a regular basis. Event automations take those repetitive actions and systemically implement them for me. Unlike scanner and monitor automations, which continuously manage positions at defined intervals, you can trigger events for specific dates and times, run as a contingency when another position is opened or closed, or run immediately at the click of a button. There are multiple triggers you can use to schedule automations: * On a Specific Date - You can run an event on a specific date or time in the future. For example, if you wanted to enter a position on the first trading day of every month, you could schedule it with an event automation. * On a Repeating Schedule - You can run an automation on a repeating schedule. For example, you can schedule an automation to run every Monday and Friday at 3:00 p.m. * Open New Position and Close Position - An automation is triggered to run one time if a new position is opened or an existing position is closed. * At Market Open or Market Close - Automatically run an automation 10 minutes after the market opens or 10 minutes before the market closes. Perfect for checking market conditions, re-setting bot tags, or checking for profits at the end of the day. * Buttons - Buttons are events that run an automation at the click of a button. Any time the button is clicked, it will immediately run the automation. Customized buttons can be created for any scanner or monitor automation and added to the bot dashboard. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Ff8PMHql7YgTjYjZlsins%252Fimage.png%3Falt%3Dmedia%26token%3D4f4f7366-247f-4fca-80f9-ff4b0c7267c1&width=768&dpr=3&quality=100&sign=94ab53f5&sv=2) Event automations add flexibility to a bot. The list of potential use cases is long! Traders can check for profits, automatically open positions, and more. ### [hashtag](https://docs.optionalpha.com/getting-started#trade-ideas--manual-trading) Trade Ideas + Manual trading You can always trade manually with Option Alpha. We LOVE automation, but also know you want to have the control to open (or close) your trades exactly when and how you want. The best part is that when you open a position manually, you can still leverage powerful automated tools such as SmartPricing and Exit Options. With Trade Ideas, you can remove the hard work of searching for trading opportunities. Trade Ideas automatically ranks millions of potential positions using multiple filters to sort trades by their ticker, expiration, directional bias, reward-to-risk, and probabilities. Once you find your trade, the position details are set for you automatically. You can always modify any of the settings before sending your order. It’s never been easier to find and place options trades! ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FUTNLkXrInmORXCpPd5yP%252Fimage.png%3Falt%3Dmedia%26token%3D4848e9f8-3fe3-4bca-b3c1-a17cf348ac1f&width=768&dpr=3&quality=100&sign=c13a45c9&sv=2) Last updated 2 months ago Was this helpful? * [What is a bot?](https://docs.optionalpha.com/getting-started#what-is-a-bot) * [How Bots Work](https://docs.optionalpha.com/getting-started#how-bots-work) * [Setting up your bot](https://docs.optionalpha.com/getting-started#setting-up-your-bot) * [Adding automations](https://docs.optionalpha.com/getting-started#adding-automations) * [Scanning for trades](https://docs.optionalpha.com/getting-started#scanning-for-trades) * [Customize SmartPricing](https://docs.optionalpha.com/getting-started#customize-smartpricing) * [Monitoring positions](https://docs.optionalpha.com/getting-started#monitoring-positions) * [Event-based automation triggers](https://docs.optionalpha.com/getting-started#event-based-automation-triggers) * [Trade Ideas + Manual trading](https://docs.optionalpha.com/getting-started#trade-ideas--manual-trading) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Bots | Option Alpha Together we'll walk through the basics of bots so you'll have the confidence to automate all your trading activities, saving you hours of time, adding control and precision to your strategies, and giving you the power to finally scale your portfolio. Run fully automated strategies for options or stocks with no coding required. Stop trading your time and start optimizing your portfolio with bots. ### [hashtag](https://docs.optionalpha.com/tools/bots#create-your-bots) Create your bots Start with pre-built bot templates you can customize or build your own custom bots from scratch. ### [hashtag](https://docs.optionalpha.com/tools/bots#add-automations) Add automations Automations tell the bot when to take action, what to look for, when to open positions, when to exit positions, and much more. ### [hashtag](https://docs.optionalpha.com/tools/bots#customize-your-decisions) Customize your decisions Add actions and decisions using natural language recipes to the automation editor making it easy and fun to build your strategies. ### [hashtag](https://docs.optionalpha.com/tools/bots#leverage-smartpricing) Leverage SmartPricing Our proprietary technology uses timed intervals and adjusts pricing dynamically to optimize entries and exits. ### [hashtag](https://docs.optionalpha.com/tools/bots#monitor-bot-activity) Monitor bot activity You’ll always have complete visibility and absolute control over everything happening inside your bot at all times. ### [hashtag](https://docs.optionalpha.com/tools/bots#scale-your-portfolio) Scale your portfolio Run multiple systems and strategies all at the same time without the headache of watching every market tick by tick. Last updated 2 months ago Was this helpful? * [Create your bots](https://docs.optionalpha.com/tools/bots#create-your-bots) * [Add automations](https://docs.optionalpha.com/tools/bots#add-automations) * [Customize your decisions](https://docs.optionalpha.com/tools/bots#customize-your-decisions) * [Leverage SmartPricing](https://docs.optionalpha.com/tools/bots#leverage-smartpricing) * [Monitor bot activity](https://docs.optionalpha.com/tools/bots#monitor-bot-activity) * [Scale your portfolio](https://docs.optionalpha.com/tools/bots#scale-your-portfolio) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Managing Positions | Option Alpha [Exit Optionschevron-right](https://docs.optionalpha.com/tools/managing-positions/exit-options) [Monitor Automationschevron-right](https://docs.optionalpha.com/tools/managing-positions/monitor-automations) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Finding Trades | Option Alpha [Scannerschevron-right](https://docs.optionalpha.com/tools/finding-trades/scanners) [Trade Ideaschevron-right](https://docs.optionalpha.com/tools/finding-trades/trade-ideas) [0DTE Oraclechevron-right](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle) [Earnings Edgechevron-right](https://docs.optionalpha.com/tools/finding-trades/earnings-edge) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Clone Bot Templates | Option Alpha One of the most powerful features supporting the process of discovering, sharing, and implementing trading strategies is the use of bot templates and cloning. These tools allow you to easily replicate successful strategies, collaborate with other traders, and expand your trading portfolio with minimal effort. #### [hashtag](https://docs.optionalpha.com/tools/clone-bot-templates#cloning-quickly-add-bots-to-your-portfolio) **Cloning: Quickly Add Bots to Your Portfolio** Option Alpha makes it easy to clone bots directly from templates or from other bots. With a single click, you can add a cloned bot to your portfolio, complete with all the settings and strategies of the original bot. This functionality allows you to quickly and efficiently expand your portfolio of bots and build variations of one bot or another. #### [hashtag](https://docs.optionalpha.com/tools/clone-bot-templates#creating-and-using-templates) **Creating and Using Templates** Any bot you create on Option Alpha can be saved as a template. This feature allows you to store your strategies indefinitely, making it easy to revisit and reuse them as needed. Whether you’ve developed a unique trading approach or simply want to keep a record of a successful bot setup, saving it as a template ensures that your hard work is preserved. #### [hashtag](https://docs.optionalpha.com/tools/clone-bot-templates#sharing-templates-public-vs.-private) **Sharing Templates: Public vs. Private** Templates offer flexibility not just in how you use them, but also in how you share them. You have the option to: * **Share Publicly**: If you choose to share your template with the community, other traders can view, clone, and implement your strategy. This collaborative approach fosters a dynamic environment where traders can learn from each other and experiment with new ideas. * **Keep Private**: Alternatively, you can keep your templates private, stored securely in your personal library. This option is perfect if you want to maintain control over your strategies or use them exclusively within your own portfolio. #### [hashtag](https://docs.optionalpha.com/tools/clone-bot-templates#the-community-and-public-templates) **The Community and Public Templates** Within this community, you’ll find a wide variety of templates created by other traders. These public templates offer valuable insights into different trading approaches and can be a great resource for finding new ideas to incorporate into your own bots. In addition to community-shared templates, members of the Option Alpha team also contribute public templates. These templates are typically educational in nature, representing experimental ideas or collaborations that invite feedback and participation from the broader trading community. It’s important to note that while these templates can be highly informative, they are often intended for educational purposes and should be forward-tested thoroughly before being applied to live accounts. #### [hashtag](https://docs.optionalpha.com/tools/clone-bot-templates#the-leaderboard-tracking-template-performance) **The Leaderboard: Tracking Template Performance** For those interested in seeing how different templates perform, the community features a leaderboard that ranks publicly shared templates based on their performance in both paper trading and live accounts. The '[Top Bot Templatearrow-up-right](https://app.optionalpha.com/community/toptpls) ' leaderboard is a valuable tool for identifying successful strategies and gaining insights into what’s working in real trading environments. By exploring top-performing templates, you can find inspiration and ideas to enhance your own trading activities. Templates and cloning on Option Alpha provide a powerful way to streamline your trading activities, whether you’re looking to develop new strategies, collaborate with others, or simply expand your portfolio. By taking advantage of the platform’s template features, you can easily save, share, and replicate successful bots, ensuring that your trading strategies are always at your fingertips. Explore the community, experiment with public templates, and use the leaderboard to guide your decisions—trading has never been more accessible or collaborative. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FbmXdlRCu2TCFLPL6XBFt%252FTop%2520Bot%2520Templates.png%3Falt%3Dmedia%26token%3D00c5a187-43d7-44cb-8096-79f78f8c7214&width=768&dpr=3&quality=100&sign=c9c7b70a&sv=2) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Monitor Automations | Option Alpha Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Creating a backtest | Option Alpha Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Backtesting | Option Alpha ### [hashtag](https://docs.optionalpha.com/tools/backtesting#backtest-0dte-and-next-day-options-strategies) Backtest 0DTE and next-day options strategies Run a backtest using multiple entry and exit criteria, position settings, and technical indicators to analyze detailed performance history for all your ideas. ### [hashtag](https://docs.optionalpha.com/tools/backtesting#compare-and-combine-multiple-backtests) Compare and combine multiple backtests Quickly add multiple variations to stress-test different variations and variables to improve performance. Then, combine the results of multiple strategies into one portfolio curve. ### [hashtag](https://docs.optionalpha.com/tools/backtesting#detailed-logs-of-every-trade-for-full-transparency) Detailed logs of every trade for full transparency Extensive logging gives you confidence in the backtest your running before going live with a strategy. Every backtest includes detailed trade logs in case you want to dive into historical data. ### [hashtag](https://docs.optionalpha.com/tools/backtesting#create-a-bot-to-automatically-trade-your-new-strategy) Create a bot to automatically trade your new strategy Once you've found a backtest you love, instantly turn that backtest into an automated bot that trades the exact same strategy you backtested. Then, let your new bot find and manage trades for you. Last updated 2 months ago Was this helpful? * [Backtest 0DTE and next-day options strategies](https://docs.optionalpha.com/tools/backtesting#backtest-0dte-and-next-day-options-strategies) * [Compare and combine multiple backtests](https://docs.optionalpha.com/tools/backtesting#compare-and-combine-multiple-backtests) * [Detailed logs of every trade for full transparency](https://docs.optionalpha.com/tools/backtesting#detailed-logs-of-every-trade-for-full-transparency) * [Create a bot to automatically trade your new strategy](https://docs.optionalpha.com/tools/backtesting#create-a-bot-to-automatically-trade-your-new-strategy) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Automate your strategy | Option Alpha Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Comparing and combining backtests | Option Alpha Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Earnings Edge | Option Alpha [hashtag](https://docs.optionalpha.com/tools/finding-trades/earnings-edge#earnings-edge) Earnings Edge ----------------------------------------------------------------------------------------------------------- Earnings announcements give us a cyclical opportunity to take advantage of inflated volatility. However, finding a trade with good mathematical metrics is challenging since probabilities, EV and alpha are not accurate across earnings reports. The earnings backtester was created to help solve this problem and provide us with a way to make a calculated decision instead of guessing. ### [hashtag](https://docs.optionalpha.com/tools/finding-trades/earnings-edge#earnings-backtesting-overview) Earnings backtesting overview The earnings backtester analyzes the selected trade's metrics across the previous 5 years of earnings reports, using the out-the-money percentage of the position's strike prices (OTM%), the credit or debit, the spread width, and/or the max loss. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FaF7bN0pUtMbu7qSxq9km%252Fimage.png%3Falt%3Dmedia%26token%3D36c00c9e-e9cf-4c28-ad52-ec40ac34d8b1&width=768&dpr=3&quality=100&sign=e74bb06c&sv=2) The backtester simulates opening a position with the same metrics right before each earnings report and holding it until the next end-of-week (EOW) expiration. Each position's backtest displays key data from the previous 20 earnings reports, including the win rate, average return, and best win. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fpuj8BMc7Bq3V9kcxr2ik%252Fimage.png%3Falt%3Dmedia%26token%3D804e226d-b0c0-4f0f-ad17-6fea6f19b094&width=768&dpr=3&quality=100&sign=8ea91d0e&sv=2) The P/L and ROR for each simulated position is calculated based on the symbol's closing price at the EOW expiration. For example, if a short call spread with a strike price 3% OTM and a $1 spread width is selected, then the backtester will simulate opening a short call spread with a strike price 3% OTM and a $1 spread width across each of the earnings reports in the past 5 years with the same opening credit and max loss. We can visualize the backtested earnings trades to see exactly how the selected strategy performed in the past, as well as the stock's price move post-earnings. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F2wfH7bWfMz1x3GfjYoGO%252Fimage.png%3Falt%3Dmedia%26token%3De762aa7c-20e5-44b2-8697-c54360403b0d&width=768&dpr=3&quality=100&sign=d79cd5ee&sv=2) ### [hashtag](https://docs.optionalpha.com/tools/finding-trades/earnings-edge#backtest-any-earnings-trade) Backtest any earnings trade To backtest any trade that crosses an earnings report, select the position in the “New Position” screen and then click the “Backtest” button that appears in the top right. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FS96O3arJZr8JZTHAiUGb%252Fimage.png%3Falt%3Dmedia%26token%3D2cc5a48f-b7ce-4bf8-8463-871518be8e56&width=768&dpr=3&quality=100&sign=2310ca65&sv=2) Last updated 2 months ago Was this helpful? * [Earnings Edge](https://docs.optionalpha.com/tools/finding-trades/earnings-edge#earnings-edge) * [Earnings backtesting overview](https://docs.optionalpha.com/tools/finding-trades/earnings-edge#earnings-backtesting-overview) * [Backtest any earnings trade](https://docs.optionalpha.com/tools/finding-trades/earnings-edge#backtest-any-earnings-trade) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Automation logs | Option Alpha [hashtag](https://docs.optionalpha.com/tools/bots/automation-logs#bot-logs) Bot Logs ----------------------------------------------------------------------------------------- Bot logs are an essential tool in the Option Alpha trading platform, providing a comprehensive record of every action your bot has taken. Whether you’re looking to troubleshoot an issue, or simply monitor your bot’s activity, the bot log is the fastest and most efficient way to gain insights into your bot’s behavior. Bot logs offer a detailed automation history, allowing you to see exactly what actions your bot has taken—or not taken—during each automation run. This level of transparency is invaluable for both new and experienced traders, as it provides the information needed to refine strategies, ensure everything is functioning as expected, and quickly identify any issues that may arise. #### [hashtag](https://docs.optionalpha.com/tools/bots/automation-logs#filtering-bot-logs) Filtering Bot Logs Given the potentially large volume of data within a bot’s log, Option Alpha provides several filtering options to help you quickly find the information you need. Here’s how you can make the most of these filters: 1\. By Date: If you’re interested in reviewing your bot’s activity on a specific day, you can filter the log by date. This allows you to focus on the automation runs that occurred on that particular date, making it easier to investigate specific events or performance. 2\. By Type: Automation types such as Scanner, Monitor, Event, and Button can be individually filtered in the log. This is especially useful if you want to isolate the actions taken by a specific type of automation, allowing for more targeted analysis. 3\. By Errors or Warnings: One of the most powerful features of the bot log is the ability to filter by errors or warnings. This filter enables you to quickly identify any automation runs that encountered issues, allowing you to diagnose and resolve problems more efficiently. #### [hashtag](https://docs.optionalpha.com/tools/bots/automation-logs#using-bot-logs-to-improve-your-trading) Using Bot Logs to Improve Your Trading Regularly reviewing your bot logs can provide valuable insights into your bot’s performance and help you make informed decisions about your trading strategies. By understanding which actions your bot is taking and identifying any errors or warnings, you can feel confident knowing how your bot is behaving. Bot logs are a vital resource for anyone using Option Alpha’s trading platform. They offer a clear and detailed record of your bot’s activities, making it easy to monitor performance, troubleshoot issues, and optimize your trading strategies. By taking advantage of the filtering options available, you can quickly find the information you need to ensure your bots are operating smoothly and efficiently. Regularly reviewing your bot logs will help you stay on top of your trading activities and maintain control over your strategies. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # 0DTE Oracle | Option Alpha [hashtag](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#id-0dte-oracle) 0DTE Oracle -------------------------------------------------------------------------------------------------------- 0DTE Oracle is a new tool that helps us find and analyze [0DTEarrow-up-right](https://optionalpha.com/learn/0dte) and next day trading opportunities. It aims to solve the problem of probabilities and expected value (EV) being less accurate for 0DTE trades by providing backtest results to help identify quality trades instead of relying on probabilities. Each trade's metrics are backtested against the underlying's previous 1 year of intraday minute data to see how trading a similar position daily would have performed over that time. Similar to Trade Ideas, it analyzes the trades currently available in the market to produce a list of actionable trade opportunities. ### [hashtag](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#why-we-love-it) Why We Love It We have been testing this tool internally and the team is hooked. The ability to quickly find and place quality 0DTE trades empowers us with the confidence to trade daily. We hope you will feel empowered as well. Here are some of the things we like about it: * Quickly choose between 0DTE and next day trades ranked by backrest results * Time consuming analysis done in advance - including the ability view and rank many different leg combinations at a glance * New positions available every day based on time of day and current market opportunities * Backtest results give new insight into how 0DTE trades perform over time * SPX available with cash settlement to avoid assignments and favorable tax treatment * Run custom backtests to see how positions perform in specific market conditions ### [hashtag](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#why-we-created-it) Why We Created It As part of our [internal researcharrow-up-right](https://optionalpha.com/category/research-insights) we discovered the probabilities for shorter duration trades, particularly 0DTE and next day trades, are less accurate than longer duration trades. We believe this is because the time component of the [Black-Sholes model arrow-up-right](https://optionalpha.com/blog/black-scholes-model-option-alpha-uses-historical-volatility-to-calculate-expected-value) used to calculate the probabilities is too short. The inaccuracy of probabilities causes other metrics that depend on it, e.g. expected value (EV) and alpha, to be less accurate as well. Since pre-calculated math and probabilities are a fundamental part of removing bias and quick decision making in Options Trading 2.0, the inaccuracy of probabilities makes finding quality 0DTE and next day trading opportunities challenging. A recent addition to the platform, Earnings Edge, solved a similar issue for earnings reports by backtesting the trades currently available in the market across the previous 5 years of earnings reports. This sparked the idea for the 0DTE Oracle. It analyzes the 0DTE trades currently available in the market and backtests them against the previous 1 year of intraday minute pricing data to see what would have happened if you traded this position every day, with the exact same metrics, at this time of day, and held to expiration. It presents the best opportunities in an actionable list to sort and filter to find a quality trade based on your criteria. You can also run custom backtests on up to 3 years of minute data and apply entry conditions and filters to see how it would have performed under custom market conditions. #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#key-assumptions-and-considerations) Key Assumptions and Considerations * Probabilities, EV and Alpha are less accurate for 0DTE and next day trades because the time component of the Black-Scholes model is too short * Different position entry metrics (OTM %, spread width, max loss, max profit, etc) alter backtest results * Each day the available position metrics are different and need to be retested * Time of day alters available position metrics and changes backtest results ### [hashtag](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#how-it-works) How It Works * Look up every available position from at-the-money (ATM) to 3% out-the-money (OTM) in 0.1% increments with each possible spread width ($5, $10, $15, $20, $25 for SPX and $0.50, $1, $2, $2.50, $5 for SPY, XSP and QQQ) from 9:31AM to 3:55PM EST * Backtest the live position metrics currently available based on opening at that time of day and holding until expiration * Legs are simulated at the same OTM % + spread width without rounding to test the current metrics consistently This is different from backtesters based on a predetermined position entry strategy which test strike prices at varying OTM % and alternate premium and risk values available in the past - which produces completely different position metrics for each trade in the backtest. We believe the metrics at the time of position entry (reward/risk, OTM %, spread width, max loss, max profit, etc) are THE most important part of getting into favorable trading opportunities so we decided to backtest the exact metrics available today against historical underlying price data instead of looking up completely different position metrics from the past. Here is an example of backtest results for a 0DTE SPX Iron Butterfly opened at 12:26pm: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FHin2JlWuMfc9CgU0P1tq%252Fimage.png%3Falt%3Dmedia%26token%3D14a88481-f545-47a1-a5e6-82c4f4548935&width=768&dpr=3&quality=100&sign=1edad640&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#creating-custom-backtests) Creating Custom Backtests Custom backtests allow you to filter the days the backtest opens positions based on market conditions, underlying metrics, technical indicators, FOMC events and day of week. For underlying metrics and technical indicators, the current value is displayed and you can specify a range to allow. For example, if RSI is currently 66 you can elect to allow a range of 60-90. Here’s a screenshot of the custom backtest options: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FdijmeRkKRcgKuKJIhQqY%252Fimage.png%3Falt%3Dmedia%26token%3Debc5b135-afe0-40c4-948f-a85353582544&width=768&dpr=3&quality=100&sign=f0bb90e6&sv=2) Last updated 2 months ago Was this helpful? * [0DTE Oracle](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#id-0dte-oracle) * [Why We Love It](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#why-we-love-it) * [Why We Created It](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#why-we-created-it) * [How It Works](https://docs.optionalpha.com/tools/finding-trades/0dte-oracle#how-it-works) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Exit Options | Option Alpha [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#exit-options) Exit Options ------------------------------------------------------------------------------------------------------------ Exit Options enable us to pre-set exit criteria, so bots can manage our positions automatically throughout the day. Plus, orders are only sent to the broker when your criteria is met, so you no longer need to worry about having resting orders exploited while sitting in an order book (say goodbye to stop-hunting market makers). #### [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#id-1-minute-auto-position-management) 1-minute auto position management Exit Options check your position every minute and send a closing order if your exit criteria are met. #### [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#instant-exit-options) Instant Exit Options Live bots can enable Instant Exit Options, which continuously monitor and update position returns and respond to changes in the leg and underlying pricing. #### [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#scheduling-exit-options) Scheduling Exit Options Exit Options can run from 9:31 am ET until 1 minute before the market close. You can customize the Exit Options schedule in your [Settingsarrow-up-right](https://app.optionalpha.com/settings#schedule) . ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FTr8KCpksMb6xvP6BSPO6%252Fimage.png%3Falt%3Dmedia%26token%3De8c71dc9-b58a-4b0d-860b-229daa4c7d1b&width=768&dpr=3&quality=100&sign=c4f85076&sv=2) Exit Options always run, even if your automations inside a bot are turned off, so your positions are always managed, unless you turn off Exit Options in your bot (see below). Exit Options use a position's mid-price when evaluating returns. (**Note**: you can use a [bid-ask guardarrow-up-right](https://optionalpha.com/workshops/trailing-stops) to disable Exit Options from closing a position or tracking the high % or low % of the position if the bid-ask spread is wide). #### [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#exit-option-management-criteria) Exit Option Management Criteria You can customize each position's Exit Options for specific management using six triggers: * Profit Taking * [Profit Targetarrow-up-right](https://app.optionalpha.com/community/updates/post/opening-range-breakout-profit-target-e-2025061610005) * [Price Targetarrow-up-right](https://app.optionalpha.com/community/updates/post/opening-range-breakout-profit-target-e-2025061610005) * Stop Loss[‍arrow-up-right](https://optionalpha.com/blog/trailing-stop-exit-options) * [Trailing Stoparrow-up-right](https://optionalpha.com/blog/trailing-stop-exit-options) [‍arrow-up-right](https://optionalpha.com/blog/new-exit-option-for-itm-price-touches) * [Toucharrow-up-right](https://optionalpha.com/blog/new-exit-option-for-itm-price-touches) ‍ * Expiration * Earnings ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FxJBDq8VYqYJMWN2MfoYL%252Fimage.png%3Falt%3Dmedia%26token%3D76c99408-e3d5-4da1-b498-6499a8b5b486&width=768&dpr=3&quality=100&sign=34465ad6&sv=2) > **Note:** There is no guarantee that an order will fill in a live market. It is possible that a position won't close when an order is sent to your broker for execution. Markets move fast, and bid-ask spreads can be volatile. Orders triggered by an exit option will remain active for two minutes; during that time, no additional orders will be sent to your broker. If the order is not filled, exit options will resume checking the position at the next 1-minute interval. When using the 'Expiration' setting, the bot will continue sending orders for the remainder of the trading day if the order does not fill at the specified time. > > Also note that there is no guranatee that a stop loss or trailing stop value will be the exact closing value. A closing order is triggered when the position's mid-price is at or beyond the stop loss value, but it is possible that the realized loss will exceed the expected value. #### [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#exit-option-closing-orders) Exit Option closing orders You can use [SmartPricingarrow-up-right](https://optionalpha.com/help/smartpricing) when closing a position, turn off SmartPricing, or use a market order. Exit Option orders are automatically canceled after two minutes. If an order is not filled, Exit Options will check your position at the next interval and, if necessary, re-start the process of sending orders to your broker if the exit criteria are still met. circle-info Profit Taking Exit Options are a special scenario. Profit-taking Exit Options set the final price to your profit-taking level to ensure your minimum profit target is received if the order fills. You don't need to set a "Final Price" because the final price is automatically set by the bot to a price that locks in the profit you specified. It won't try a worse price that would result in profit less than your specified amount. The Before Expiration and Before Earnings triggers operate based on calendar days in the same way 'days to expiration' is calculated and will execute at 3:29 pm ET if using a day-based selection. For example, if today is Friday, a position expiring on Monday is considered 3DTE. When using an exit trigger for Before Expiration or Before Earnings, it's the traders responsibility to be aware of how weekends and market holidays will affect the contract's days to expiration value. If you check the PDT box, the bot will wait at least one day to close a position to avoid [pattern day tradingarrow-up-right](https://optionalpha.com/learn/day-trading-rules) . We can also use the [bid/ask guardarrow-up-right](https://optionalpha.com/blog/expanded-smartpricing-settings-control-slippage) to protect from temporary price fluctuations. You set the maximum width of the position's bid/ask spread you are comfortable with, and if the position exceeds this value, it will disable Exit Options from closing a position or tracking the high % or low % of the position until the bid/ask spread is below your setting. [Save your Exit Option criteria as a Presetarrow-up-right](https://optionalpha.com/blog/exit-options-presets) to be reused for similar position types. You can name your presets for easy identification. All Exit Options will automatically populate when you use a Preset. #### [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#using-exit-options) Using Exit Options You can set your Exit Options for any trade when opening positions manually or in an automation's Open Position action. When using Exit Options in an Open Position action, all positions opened in the automation will have the same entry criteria. Once opened, Exit Options are specific to each position. You can always edit each position's Exit Options at any time after it is opened. Additionally, you can enable and disable Exit Options from the main Bots page, inside of the bot as shown below, or individually within each position. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F66c89d06f0d19a8e0191ba88_66c89c8b1a28b9803f225de3_automation-toggles.png&width=768&dpr=3&quality=100&sign=80493063&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/managing-positions/exit-options#using-automations-to-update-exit-options) Using Automations to Update Exit Options Update Exit Options inside an automation for added flexibility and complete control, all while still enjoying 1-minute automated position management. This video demonstrates how to use automation actions to set (and re-set) Exit Options whenever and however you want. Modify profit targets and stops for different market conditions, position returns, days in trade, days until expiration, market events, and much more. Last updated 15 days ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Best practices | Option Alpha [hashtag](https://docs.optionalpha.com/tools/backtesting/best-practices#backtesting-best-practices) Backtesting Best Practices ----------------------------------------------------------------------------------------------------------------------------------- These articles were provided by Option Alpha Community member "[Robert DiNeroarrow-up-right](https://app.optionalpha.com/community/member/pachiraaquatica) " in [this postarrow-up-right](https://app.optionalpha.com/community/all/post/i-wrote-the-occ-regarding-qqq-heres-wh-2025072818250) and [this postarrow-up-right](https://optionalpha.com/community/posts/i-tried-the-spx-02-delta-iron-butterfl-2025112113443) . circle-info For more information on pin risk and the differences of trading index options vs. equity options, with specific examples for a position expiring partially ITM and being assigned on the short leg as the long leg expires, you can review this article: [0DTE Partial ITM Assignment Pin Riskarrow-up-right](https://optionalpha.com/learn/0dte-partial-in-the-money-assignment) . There have been several posts about QQQ expirations as well as the backtester. After spending a considerable amount of time reading I wrote a lengthy [comment back in Mayarrow-up-right](https://app.optionalpha.com/community/all/post/flawed-qqq-0dte-paper-trade-result-2025050116395) in response to a post. Since this topic continues to come up, I thought I'd go to the source for clarification. For the most part, this confirmed my understanding of how QQQ settlement works. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/best-practices#main-points) Main points * SPY/QQQ/IWM/GLD/TLT settlement time is stamped at 4:00 pm EST. * SPY/QQQ/IWM/GLD/TLT trades until 4:15 pm EST even on expiration day. * A long option holder can exercise their contract until 5:30 pm EST. * If your short options are ITM at 4:00 pm EST they will be auto-assigned. * If your long options are ITM at 4:00 pm EST they will be auto-exercised unless you file a contrary assignment notice. * As the seller of an option contract, you collect the premium upfront to take on the obligation of that contract and keep that premium regardless of the expiration price. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/best-practices#how-does-this-impact-risk) How does this impact risk? If you hold until expiration, then you have risk of [assignmentarrow-up-right](https://optionalpha.com/topics/options-settlement) even if it expires OTM (i.e. pin risk: see [my comment arrow-up-right](https://app.optionalpha.com/community/all/post/tos-iron-condor-resolution-procedures-202411257575) here). That risk exists regardless of whether options stop trading at 4pm or 4:15pm since long contract holders can exercise options **until 5:30**. If QQQ were to close OTM but QQQ moves past your short strikes after-hours, then **you will not know** whether you will be assigned until the next morning leaving you open to unmitigated risk. If you were assigned on a short call, then you would be short 100 shares for every contract assigned, which in turn means that a $1 move up will reduce your profits by $100 per contract (i.e. 200 contracts with a $3 move up is a -600 loss). That loss can be **greater** than the max loss defined by the spread since you no longer have the long option contract as protection (unless you call your broker and exercise it, which is a whole other discussion). Another risk is that your broker closes the position before 4:15pm. They may submit an order that is not in your favor in order to reduce their risk, which could result in a loss greater than the max risk you thought you had. In addition, this would count as a daytrade. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/best-practices#will-option-alpha-know-whether-im-assigned-or-whether-my-broker-sold-the-position) Will Option Alpha know whether I'm assigned or whether my broker sold the position? OA will not receive data via the API regarding the assignment or the sold position. This means that you could have shares of stock that have been affected by overnight moves. It also means that your account may be assigned positions you either do not have enough buying power for, or aren't approved to hold (i.e. short shares). This in turn means that you could have a margin call and be unable to open positions until the margin call is resolved. It also means that you will need to edit your closing order in OA to reflect the gain or loss on assignment/sale. Kirk has a video on [how to handle assignments in OAarrow-up-right](https://app.optionalpha.com/community/all/post/kirk-posted-new-video-thu-1221-short-p-2023122213105) . (Kirk has a [bolt on early options assignment risk automationarrow-up-right](https://app.optionalpha.com/community/member/kirk/post/early-options-assignment-risk-manageme-2025050812380) that can help with early assignment risk. See also posts [herearrow-up-right](https://app.optionalpha.com/community/all/post/handling-an-assignment-with-tradier-2023092113342) and [herearrow-up-right](https://app.optionalpha.com/community/all/post/mitigating-risk-of-early-assignment-2023052414244) ). #### [hashtag](https://docs.optionalpha.com/tools/backtesting/best-practices#how-does-this-impact-the-backtester-and-results) How does this impact the backtester and results? In my opinion, it doesn't. No backtester can determine whether a long contract holder will exercise their rights after 4pm. Only a subset of long contract holders will exercise their rights and even then the OCC will randomly assign the contract to a broker, who will randomly assign it to a contract holder. **Then are the closing prices of the backtester wrong for ETFs?** The PL shown in the backtester is correct in the sense that it reflects the price at 4pm, which is when the QQQ settlement time is stamped and when the bots stop running. However, you have a significant risk of assignment that cannot be accounted for in the backtester, which in turn affects your own specific results and how you individually may handle the assignments. For example, at 4pm the position either expires ITM or OTM. If it closes OTM, then the PL correctly reflects premium received. However, **you could still be assigned** and end up with a different gain/loss if the underlying price (not the contract price) moves against you. If it closes ITM, then the PL shows what would be the cash settled price. If it closes ITM between the short and long strikes then you would be assigned and you could end up _better off or worse off_ depending on whether QQQ moves in your favor overnight. If it closes ITM beyond your long strike, then you would most likely end up with your max loss at expiration. However, you could still end up buying 100s of shares of QQQ if enough long holders file contrary assignment notices (now I imagine this would be extraordinarily rare, but it is still a risk nonetheless especially if QQQ falls overnight). It's possible that OA could calculate the gain or loss based off of selling your assigned QQQ position the next day at 9:35am, but that assumes that you must close your position at that time. However, you might close your position at 7am or 8am. Or you might hold the assigned stock. Or you might exercise your longs as Otto notes on [this threadarrow-up-right](https://app.optionalpha.com/community/all/post/flawed-qqq-0dte-paper-trade-result-2025050116395). Or maybe you buy the underlying at 7:45pm. As you can see, there are several ways to handle an after-hours move that the backtester and bots cannot account for. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/best-practices#final-thoughts) Final thoughts If you are holding QQQ to expiration (or any physically-settled contract) then you need to know **exactly what the risks are**. The backtester is an important tool in assessing whether your strategy has any merit, but the backtester cannot account for risk of assignment. You should use the data the backtester provides as a starting point, not an ending point. In other words, once you've run your backtest, review the expired positions to determine whether you'd be assigned. Or better yet, consider closing physically-settled tickers before expiration and use cash-settled tickers for holding through expiration. Please let me know if you have questions or if anything I said needs to be clarified or corrected. ### [hashtag](https://docs.optionalpha.com/tools/backtesting/best-practices#validating-unrealistic-strategy-backtest-results) Validating unrealistic strategy backtest results Many backtests can look good on paper but, in reality, have no realistic chance of working in a live market environment. Ultimately, it is always up to us as traders to apply critical thinking skills when analyzing backtet results and assessing a strategy's validity. Backtesting and paper trading operate under the assumption of an order being filled, either at or near the mid price or using whatever slippage settings you may have. In a live market, there is no guarantee an order will fill, and no objective way to accurately model what may or may not happen live, so it is the trader's responsibility to assess the backtest settings and analyze the potential validity. The most common unrealistic backtest is the far out-of-the-money iron butterfly, and similar strategies that essentially rely on capitalizing on erratic bid/ask spread fluctuations. See Robert's post [herearrow-up-right](https://optionalpha.com/community/posts/i-tried-the-spx-02-delta-iron-butterfl-2025112113443) for a great breakdown. Here is a visual image of the strategy in question: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FJCdJK1nPEhU4uyfxePCy%252Fimage.png%3Falt%3Dmedia%26token%3Ddecd8ce1-84ea-4d75-b01e-655520afa612&width=768&dpr=3&quality=100&sign=7cfd35e6&sv=2) This video guides you through validating backtest results: This video highlights key considerations for taking a strategy live: Last updated 22 days ago Was this helpful? * [Backtesting Best Practices](https://docs.optionalpha.com/tools/backtesting/best-practices#backtesting-best-practices) * [Validating unrealistic strategy backtest results](https://docs.optionalpha.com/tools/backtesting/best-practices#validating-unrealistic-strategy-backtest-results) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Tags | Option Alpha [hashtag](https://docs.optionalpha.com/tools/bots/tags#using-tags) Using Tags ---------------------------------------------------------------------------------- The tagging system is a powerful tool that allows you to add data to your bots, positions, and symbols. This data can be used to track information, categorize items, and make decisions within your automations. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FOf3KQd8S0MsaFCGsgsA3%252Fimage.png%3Falt%3Dmedia%26token%3D15607d01-004f-44d1-a7a0-dec19347c56d&width=768&dpr=3&quality=100&sign=f9e2c98c&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/tags#types-of-tags) Types of Tags There are three main types of tags: * **Bot Tags:** Tags that are applied to your bot. They do not change state and remain applied to the bot unless reset or untagged by the user. Bot tags can be used to track the status of your bot, such as "actively hedging" or "avoiding high volatility". * **Position Tags:** Tags that are applied to your open positions. They stay with the position and are helpful to determine what type of position it might be or other identifiers the user might want to know to manage and treat that position differently than others. For example, you could use a position tag to identify a "hedge" or a "core" position. * **Symbol Tags:** Tags that are applied to your symbols. An example of this would be tagging a symbol based on an indicator reading like RSI Overbought. #### [hashtag](https://docs.optionalpha.com/tools/bots/tags#using-tags-in-automations) Using Tags in Automations Tags can be used in conjunction with decisions to create powerful and flexible automations. For example, you could use a bot tag to track the performance of your bot over time. You could use a position tag to identify a specific type of position, such as a "hedge" or a "core" position. You could also use a symbol tag to filter symbols based on certain criteria. #### [hashtag](https://docs.optionalpha.com/tools/bots/tags#tagging-options) Tagging Options The tagging system provides the following options for adding and removing tags: * **Tag Bot:** Add tags to your bot. * **Untag Bot:** Remove tags from your bot. * **Reset Bot Tags:** Replace all tags for your bot. * **Tag Position:** Add tags to a position. * **Untag Position:** Remove tags from a position. * **Reset Position Tags:** Replace all tags for a position. * **Tag Symbol:** Add tags to a symbol. * **Untag Symbol:** Remove tags from a symbol. * **Reset Symbol Tags:** Replace all tags for a symbol. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F1WFZh2ANrE8aE3wX5iTZ%252Fimage.png%3Falt%3Dmedia%26token%3Db6d4ddec-aee7-441a-8c48-13960319a9eb&width=768&dpr=3&quality=100&sign=5d7a5545&sv=2) **Tips for Using Tags** * Use descriptive and consistent tags. * Use a hierarchy of tags to organize your information. * Use tags to track the performance of your bots and positions. * Use tags to filter symbols based on certain criteria. * Use tags to create custom reports and analytics. The tagging system is a powerful tool that can be used to enhance the functionality of your automations. By using tags effectively, you can create more efficient, organized, and informed trading strategies. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Loops | Option Alpha [hashtag](https://docs.optionalpha.com/tools/bots/loops#using-loops) Using Loops ------------------------------------------------------------------------------------- Loops allow us to run actions for multiple positions and symbols. Loops are typically added to the beginning of an automation so that all subsequent actions are connected to the loop. There are three types of Loops available in automations: * Position Loops * Symbol Loops * Bot Symbol Loops ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FBpvP9dKvr7EGfhlCQCyC%252Fimage.png%3Falt%3Dmedia%26token%3D75503e11-6beb-4a9c-b9f6-b9a456438afb&width=768&dpr=3&quality=100&sign=8c540ad8&sv=2) ### [hashtag](https://docs.optionalpha.com/tools/bots/loops#position-loops) Position Loops To manage all open positions (or a specific position type) inside a bot, we can use a "Position Loop." A "Position Loop" repeats the action(s) below it for each position the bot has open, enabling us to apply one or more management techniques across one or more positions inside an automation. **Example:** Use a "Position Loop" to monitor all open trades and close any position that is in-the-money less than 5 days from expiration: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fnz9wLL48CrSDUJdSychE%252FCleanShot%25202025-10-30%2520at%252014.02.02.png%3Falt%3Dmedia%26token%3Ddf32fab5-916b-47c5-968f-34b186948039&width=768&dpr=3&quality=100&sign=189c8ee2&sv=2) All "Position" inputs below the loop action will automatically be linked to the current position in the loop: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FOcrEqUELr7HUEQ6EXzLg%252Fimage.png%3Falt%3Dmedia%26token%3Dc7c6c159-da8d-4033-bc43-ea1b62f62981&width=768&dpr=3&quality=100&sign=accabb6c&sv=2) This video shows how to set up a monitor automation using a Position Loop: ### [hashtag](https://docs.optionalpha.com/tools/bots/loops#symbol-loops) Symbol Loops Symbol loops run all subsequent actions after the loop for the selected ticker symbols. This enables us to evaluate multiple criteria for different symbols, and only symbols that meet the criteria will proceed down the automation's 'Yes' path. **Example:** Use a "Symbol Loop" to scan multiple tickers and open an iron condor if the symbol passes the following criteria: * Above the 50-day SMA * Has an IV Rank between 30-80 * RSI is neutral (between 30-70) ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FLbCgcS4s4To0crg7Qujr%252Fimage.png%3Falt%3Dmedia%26token%3D8361997c-2141-4c50-8442-0f0c04dcde1f&width=768&dpr=3&quality=100&sign=98bf0bd2&sv=2) This video shows how to set up a scanner automation using a Symbol Loop: ### [hashtag](https://docs.optionalpha.com/tools/bots/loops#bot-symbol-loops) Bot Symbol Loops Similar to Symbol loops, Bot Symbol loops will loop through multiple symbols and run all subsequent actions. [Bot Symbols use our custom watchlistsarrow-up-right](https://optionalpha.com/blog/bot-symbols-and-custom-shareable-watchlists) to sort and filter ticker symbols dynamically in real-time. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FAD4Jkiu4At0ypH1bk6kO%252Fimage.png%3Falt%3Dmedia%26token%3De412d450-9da0-485c-b902-853c4cd79fd7&width=768&dpr=3&quality=100&sign=eec33e7e&sv=2) This video shows how to use Bot Symbols inside an automation: #### [hashtag](https://docs.optionalpha.com/tools/bots/loops#loop-inputs) Loop Inputs When using any loop, the automation will automatically link to the symbol or position input variable inside a decision as an input. For example, if using a Symbol loop for multiple tickers, the decision will auto-populate the Symbol loop into the the decision's symbol field. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fcz3xQ6qImrpgPswBVhVi%252Fimage.png%3Falt%3Dmedia%26token%3D5505b562-702c-41b5-a8e9-5b531376b72d&width=768&dpr=3&quality=100&sign=471766dd&sv=2) With "Position Loops," all "Position" inputs below the loop action will automatically be linked to the current position in the loop: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FOcrEqUELr7HUEQ6EXzLg%252Fimage.png%3Falt%3Dmedia%26token%3Dc7c6c159-da8d-4033-bc43-ea1b62f62981&width=768&dpr=3&quality=100&sign=accabb6c&sv=2) Do not establish an input for the "symbol" or "position." Always use the the supplied input that appears when adding an action. Last updated 2 months ago Was this helpful? * [Using Loops](https://docs.optionalpha.com/tools/bots/loops#using-loops) * [Position Loops](https://docs.optionalpha.com/tools/bots/loops#position-loops) * [Symbol Loops](https://docs.optionalpha.com/tools/bots/loops#symbol-loops) * [Bot Symbol Loops](https://docs.optionalpha.com/tools/bots/loops#bot-symbol-loops) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Backtesting Metrics | Option Alpha The [Backtesterarrow-up-right](https://optionalpha.com/backtester) is a tool designed to backtest 0DTE and next-day options strategies by leveraging 1-minute historical data to find an edge and then quickly automate the strategy by generating a bot. Traders can use a test period of up to three years, and compare up to four backtests simultaneously, and combine multiple backtested strategies to see a single portfolio P/L curve. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/backtesting-metrics#stats) Stats Click here for more details on [performance metricsarrow-up-right](https://optionalpha.com/learn/performance-metrics) . * Total P/L - Overall profit or loss in dollars. * High P/L - Highest profit or loss recorded in the testing period. * Low P/L - Lowest profit or loss recorded in the testing period. * Max Risk - Maximum capital at risk at any point during the test (Losing P/L + open position risk). * Max Drawdown - Largest fall from P/L peak-to-trough. * ‍[Profit Factorarrow-up-right](https://optionalpha.com/learn/profit-factor) - The profit factor divides the total amount of money gained by the total amount lost. The profit factor is important when used with the win rate because it creates a complete view of trading performance. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/backtesting-metrics#positions) Positions * Count - Total number of positions included in the backtest * Win Rate - Total number of winning trades by total trades. * Best Win - Trade with the highest profit in the backtested period. * Worst Loss - Trade with the largest loss in the backtested period. * Win Streak - Most consecutive winning trades. * Loss Streak - Most consecutive losing trades. * Max Profit % - the % of positions that won the max profit.**‍** * **‍**Max Loss % - the % of positions that lost the max profit. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/backtesting-metrics#averages) Averages Backtest stat averages are calculated on a per-trade basis by summing the value of the metric and dividing by the total number of trades included in the test. For example, if 500 positions were included in the backtest, and the total P/L was $2,000, the average P/L would be $4. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/backtesting-metrics#filtered-trades) Filtered Trades View all filtered not included in the backtest because they did not pass an entry filter or position criteria. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/backtesting-metrics#entry-time) Entry time The backtester uses specific entry times to simulate trade history. Traders can select from 5-minute increments or set a custom time between 9:35 am EST and 3:55 pm EST. #### [hashtag](https://docs.optionalpha.com/tools/backtesting/backtesting-metrics#entry-filters) Entry filters Change % is calculated from the previous close to the backtest entry time. For example, if running a 0DTE backtest with an 11:00am entry time, change % will reference the underlying price at 11:00am each day relative to the previous close value. Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Automations | Option Alpha Most traders are used to doing everything manually when it comes to options trading: hunting for new ideas, analyzing potential trades, and watching positions. But with automations, you can finally leverage technology to improve your trading and free up your valuable time. Let's help you understand the basics of automations and how to use them for trading. ### [hashtag](https://docs.optionalpha.com/tools/bots/automations#what-are-automations) What are automations? Automations are simply a set of instructions you give the bot to perform. The automation tells the bot exactly what to look for, what decisions to make, and what actions to take if necessary. Plus, each automation you build is completely flexible, so you can put actions and decisions in whatever sequence or order you want the bot to go through when the automation runs. It's an entirely new way of trading focused on helping you become a more disciplined and systematic trader. ### [hashtag](https://docs.optionalpha.com/tools/bots/automations#what-can-automations-do-for-me) What can automations do for me? Automations can evaluate market data, check potential trading opportunities, make complex trading decisions, open positions, close positions, send notifications, and so much more. Here are just a few examples of what you could have an automation do for you: 1. Watch SPY for a 1% drop intraday and open a new short put spread position, then close that position when it reaches a 25% profit. 2. Scan a list of symbols for high implied volatility and open new iron condor positions on those symbols. 3. Wait until 1 pm, then check a list of symbols to see if any symbols have a technical buy/sell signal and open one new position in each symbol. 4. Monitor any option position for profit targets, stop-losses, or nearing expiration all at once and trigger an automated closing order if any exit criteria are met. 5. Close any position that is less than 3 days from expiration only if it's ITM and profitable by at least $100. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FvYXIJkoJ4PPlmwWcCdTz%252Fimage.png%3Falt%3Dmedia%26token%3D99cee2e8-10c7-4fa7-af4d-7c04a0a36c0a&width=768&dpr=3&quality=100&sign=ee2ac9ff&sv=2) Is this all you can do with automations? No way; this is just the tip of the iceberg. Remember, automations are just a set of instructions (steps/actions/decisions) for the bot to perform when the automation runs. They can be as simple or complex as you want. #### [hashtag](https://docs.optionalpha.com/tools/bots/automations#id-1.-create-automation) 1\. Create automation Creating a new automation is as simple as telling the bot what to do when the automation runs. Inside the automation editor, you'll add steps to your automation in the order and sequence you'd like them performed by the bot. The steps you can add to an automation are broadly categorized as either: * Actions: These tell the bot to perform a specific action, such as making a decision, opening/closing a position, sending a notification, and/or tagging. * Loops: These repeat the same subsequent actions for each [symbolarrow-up-right](https://optionalpha.com/help/loops) in a list of symbols or each [positionarrow-up-right](https://optionalpha.com/help/loops) currently open in a bot. With the flexibility and control to build automations using actions and loops, you can run virtually any automated (or semi-automated) trading strategy you want, from the most simple trend trading strategy to a highly sophisticated self-hedging, volatility adjusting strategy. #### [hashtag](https://docs.optionalpha.com/tools/bots/automations#id-2.-schedule-automation) 2\. Schedule automation Once you've created your automation, you'll need to schedule the automation to tell the bot when you want the automation to run. There are three main ways you can schedule an automation: * **Continuous**: as either _Scanners_, which run every 15 minutes by default to find and enter new positions only if the bot is under its position limits, or _Monitors_, which run every 15 mins by default only if the bot has an option position to monitor and helps close positions when your criteria are met. You can also self-select 5-minute and 1-minute scans. Scan speeds are set at the bot-level; each bot defaults to 15 minutes unless you select a different speed.**‍** * **Triggers**: run an automation on a specific _Date_, on a _Recurring Schedule_, when the _Market Opens/Closes_, or when a _Position is Opened/Closed_. These triggers run the automation one time when each event occurs.**‍** * **Manual**: with custom _Buttons_ that are added to your bot dashboard so you can run any automation instantly with the click of a button. Automations are 'OFF' by default. Turn automations 'ON' and they will run at the scheduled intervals. The schedule tells the bot how often or under what conditions the automation can run. You can edit/adjust the schedule at any time using the gear icon in the bot's Settings tab, and even order automations to run before other automations if you have multiple types running inside your bot. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F1Y2kspdeAQCG5vdLrUnW%252FCleanShot%25202026-03-11%2520at%252012.50.51%25402x.png%3Falt%3Dmedia%26token%3D8d142c8f-d5ed-441b-ae04-c96b15666073&width=768&dpr=3&quality=100&sign=83aea336&sv=2) ### [hashtag](https://docs.optionalpha.com/tools/bots/automations#scan-speed) **Scan Speed** Your bot's Scan Speed setting determines how frequently scanner and monitor automations run when the market is open. Your bot's default scan speed is set to 15 minutes. That means your bot will automatically run scanner and monitor automations every 15 minutes between 9:45 am and 3:45 pm EST. You can also self-select 5-minute and 1-minute scans. Scan speeds are set at the bot-level; each bot defaults to 15 minutes unless you select a different speed. In your settings, you can customize when automations run, from as early as 9:31 am EST until 5 minutes before the market close. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F6740d997069616137e3e9790_6740d90ef595ca2f2e25c3a9_Customizable%252520schedule%252520for%252520automations%252520and%252520exit%252520options.png&width=768&dpr=3&quality=100&sign=f04e8334&sv=2) > 1 minute scans run every 1 minute unless the previous 1 minute interval has not completed all scheduled automations. If the previous interval is still running the bot will try again at the next 1 minute interval. #### [hashtag](https://docs.optionalpha.com/tools/bots/automations#triggers) Triggers Triggers allow you to set an automation to run based on specific actions: * **Date** \- At a specific date and time * **Repeating** \- On a recurring schedule * **Market open** \- 10 minutes after the market opens (9:40 am EST) * **Market close** \- 10 minutes before the market closes (3:50 pm EST) * **Position opened** \- After the bot opens a position * **Position closed** \- After the bot closes a position * **Webhook** \- When a webhook is called (learn more: [Option Alpha Webhooksarrow-up-right](https://optionalpha.com/blog/webhooks) ) Market open automations run first at the time you specify automations to begin. Scanner automations will begin running after the market open automation. Market close automations run last after the final scan of the day. #### [hashtag](https://docs.optionalpha.com/tools/bots/automations#manual) Manual Create a button to run an automation instantly whenever you click the button. * **Button** - Add abutton to the bot's dashboard ### [hashtag](https://docs.optionalpha.com/tools/bots/automations#save-reuse-and-copy-automations) Save, Reuse & Copy Automations You can save automations to your library and create multiple folders to organize them all. Automations can also be shared across multiple bots. Any changes made to an automation will flow through anywhere the automation is used, including other bots. You can copy an automation and make changes to the new version without impacting the original. Last updated 1 month ago Was this helpful? * [What are automations?](https://docs.optionalpha.com/tools/bots/automations#what-are-automations) * [What can automations do for me?](https://docs.optionalpha.com/tools/bots/automations#what-can-automations-do-for-me) * [Scan Speed](https://docs.optionalpha.com/tools/bots/automations#scan-speed) * [Save, Reuse & Copy Automations](https://docs.optionalpha.com/tools/bots/automations#save-reuse-and-copy-automations) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Scanners | Option Alpha Scanner automations typically begin with a [symbol loop](https://docs.optionalpha.com/tools/bots/loops) and a subsequent list of one or more [decisions](https://docs.optionalpha.com/tools/bots/decision-actions) , ending with an 'Open Position' action. Here is an example of a scanner that evaluates the market and opens a bullish or bearish credit spread depending on the current conditions: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FrvcweeNzKqQBJQLxY9m5%252Fimage.png%3Falt%3Dmedia%26token%3D838128be-596e-4253-ab36-34315e46dcde&width=768&dpr=3&quality=100&sign=5c6f4ddc&sv=2) ### [hashtag](https://docs.optionalpha.com/tools/finding-trades/scanners#open-position-action) Open Position action The 'Open Position' action includes all the position's details, including the symbol, expiration, strike prices, position sizing, [SmartPricing](https://docs.optionalpha.com/tools/bots/smartpricing) settings, [Exit Options](https://docs.optionalpha.com/tools/managing-positions/exit-options) , and any [tags](https://docs.optionalpha.com/tools/bots/tags) you may want automatically applied to the position that is opened. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FBqjbqtOkX29Mz9bvBTgQ%252FCleanShot%25202026-03-11%2520at%252012.45.32%25402x.png%3Falt%3Dmedia%26token%3D68ac25a0-dcea-413b-8612-572a6bc4249a&width=768&dpr=3&quality=100&sign=971c1ffd&sv=2) We can also define one or more entry criteria: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FUJjRjjGAYtT9xQCpRuSu%252FCleanShot%25202026-03-11%2520at%252012.46.58%25402x.png%3Falt%3Dmedia%26token%3Dccdb4485-1a90-4b6f-bf03-5ec7a4aed9db&width=768&dpr=3&quality=100&sign=ed4d0db8&sv=2) As well as position criteria to set minimum and maximum values for specific variables, which the bot will filter out if your criteria aren't met: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FIMAHpQaBp2PuK0gjqYwI%252FCleanShot%25202026-03-11%2520at%252012.48.45%25402x.png%3Falt%3Dmedia%26token%3Dc3f6e14f-57d8-4120-aa01-f3d80bc2beaa&width=768&dpr=3&quality=100&sign=b908eb54&sv=2) Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Webhooks | Option Alpha With Webhooks, we can now link our Option Alpha automations with the indicators and signals from some of the most popular charting platforms and applications. The addition of webhooks is a solution for traders in the community who want to use more indicators, custom signals, intraday timeframes, and email-based trade alerts. Imagine triggering an automation to enter or exit a trade based on a custom indicator from TradingView or a trendline break on TrendSpider. With Webhooks, it’s now incredibly easy to set up these – or any other highly specific scenario you can dream up. Plus, it doesn’t just stop there, because you can also use external software services like Zapier, which enables you to convert signals received by email or any number of other sources into an outgoing Webhook headed straight to your bots. ### [hashtag](https://docs.optionalpha.com/tools/bots/webhooks#what-is-a-webhook) What is a Webhook? A webhook makes it possible for two unconnected systems to communicate with each other. The webhook is the link between the platforms. For example, if something happens in 'System A' (such as a indicator-based trading signal) it can trigger something happening in 'System B' by calling the webhook (like running an automation in Option Alpha to open a position). A Webhook allows you to trigger automations within Option Alpha from any external source you choose. This means we can now connect our Option Alpha account with other platforms like TradingView, Zapier, Python, and much more. Trigger an automation to run inside Option Alpha from anywhere, for any reason; the possibilities are endless! ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FxWKNal54mIQpbk0OJeDL%252Fimage.png%3Falt%3Dmedia%26token%3D05e11086-b0ab-45c7-9ce6-f41705163d46&width=768&dpr=3&quality=100&sign=957a2f19&sv=2) ### [hashtag](https://docs.optionalpha.com/tools/bots/webhooks#trigger-automations-using-indicators-and-charts) Trigger automations using indicators and charts There are many different ways we can use automations inside our bots. We can run them at continuous intervals, schedule them for a specific date and time, and now trigger them if a webhook is called from an external source, meaning an automation can run at any time based on a wide variety of alert signals. One of the most exciting aspects of webhooks is the ability to use any indicator available on our favorite trading platforms. We’re no longer limited to the indicators within Option Alpha; we can now leverage the full suite of tools and analytics from other services to trigger trading signals and expand our opportunities. This, of course, includes any intra-day indicators from smaller timeframe charts. circle-info If you clone a bot that uses a Webhook automation trigger, the webhook will persist since it can be shared among bots. ### [hashtag](https://docs.optionalpha.com/tools/bots/webhooks#how-to-use-webhooks-in-option-alpha) How to use Webhooks in Option Alpha Getting started with Webhooks is simple and straightforward. 1. Create a new webhook URL in your Option Alpha account 2. Schedule an automation to run when the webhook triggers 3. Copy/paste the unique URL into an external platform 4. Define the criteria to call the webhook #### [hashtag](https://docs.optionalpha.com/tools/bots/webhooks#create-a-new-webhook-url) Create a new Webhook URL Create and name your new webhook inside your Option Alpha Settings: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FD67rHYnfaNznwKv6WkJa%252Fimage.png%3Falt%3Dmedia%26token%3Dc676fbcb-47f1-40a8-ba96-4153dc348405&width=768&dpr=3&quality=100&sign=29cbfa29&sv=2) Or when creating a New Automation in a bot's Settings tab: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F69CIlzT7Wehjdu8plEHX%252Fimage.png%3Falt%3Dmedia%26token%3D3d827c0c-ed36-40b1-b136-c92959b4c9f9&width=768&dpr=3&quality=100&sign=db7141d8&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/webhooks#schedule-your-automation-trigger) Schedule your automation trigger**‍** In your bot’s Settings, add the automation you want to run when your webhook is called, and select ‘Webhook’ from the available triggers. When your webhook is called, the automation will run instantly. A webhook can trigger up to 10 automations in a single bot, and a webhook can trigger automations in multiple bots. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FW45Tr1bHeJgX4Xd7yEIs%252Fimage.png%3Falt%3Dmedia%26token%3D66f8bf65-6eaf-4ef0-89c9-e40e4ba5235c&width=768&dpr=3&quality=100&sign=a461ee39&sv=2) Copy the webhook's unique URL code to paste into an external platform. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FCrXKVVPwyFiodb8j7tf5%252Fimage.png%3Falt%3Dmedia%26token%3Dd729f949-5d8c-4aba-bc79-9c9d5bfa12a8&width=768&dpr=3&quality=100&sign=16a68363&sv=2) **‍**Once your webhook is set up, you can sit back and let Option Alpha handle the execution of your trading strategy based on the real-time data from your connected sources. Your automation can evaluate additional market criteria, position filters, opportunity checks, and more. Or, it can simply open a position. It can even run alongside other automations. You have full control to customize your webhooks and automations to accomplish your strategy goals. #### [hashtag](https://docs.optionalpha.com/tools/bots/webhooks#connect-to-an-external-source) Connect to an external source**‍** **‍**Paste the custom URL to connect your Option Alpha account with the external platform of your choice. This may involve entering the URL into the webhook settings of TradingView, TrendSpider, or your email-based signal service. Here is an example from TradingView… Click on the Alert Button, then on the Notifications tab and paste your unique URL into the field: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FquRpttx9F9cUoRnMrHJI%252Fimage.png%3Falt%3Dmedia%26token%3D5afd3fc0-42f4-4217-89bc-6a7cf5a4ea3b&width=768&dpr=3&quality=100&sign=b6854ed8&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/webhooks#define-your-alert-criteria) Define your alert criteria **‍**Specify the conditions under which the Webhook should trigger an automation. This could be a particular indicator crossing a threshold, a specific chart pattern being recognized, or a trade signal email being received. For example, this webhook would be called if SPY's 9-day SMA crossed above the 21-day SMA, trigger an automation of your choice in Option Alpha: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FnO7qoZu5G3dqb5Yabeql%252Fimage.png%3Falt%3Dmedia%26token%3Dd8f6c399-676a-42ca-b6b7-5d66850b03b3&width=768&dpr=3&quality=100&sign=36846efe&sv=2) Here is a short, step-by-step guide to follow along with as you create a new webhook in Option Alpha and connect it to an a 3rd-party platform. \*Option Alpha is not affiliated with TradingView, Zapier, or Python, and does not endorse any specific strategy, indicator, or alert. All examples are provided for demonstration purposes only. Last updated 2 months ago Was this helpful? * [What is a Webhook?](https://docs.optionalpha.com/tools/bots/webhooks#what-is-a-webhook) * [Trigger automations using indicators and charts](https://docs.optionalpha.com/tools/bots/webhooks#trigger-automations-using-indicators-and-charts) * [How to use Webhooks in Option Alpha](https://docs.optionalpha.com/tools/bots/webhooks#how-to-use-webhooks-in-option-alpha) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Safeguards | Option Alpha The Option Alpha autotrading platform has been designed with multiple safeguards and limits to protect traders. Bots necessitate you to think through the entire trading process from entry to exit. This is for your safety. Bot safeguards are designed to help traders think about their automations critically. Bots require that you define what to do, when to do it, and with how much capital to allocate. Automations only run when they are turned on. Position and allocation limits help manage overall portfolio exposure, and [automations automatically turn offarrow-up-right](https://docs.optionalpha.com/platform-1/troubleshooting/excessive-errors-failsafe) if a limit triggers. The bot will alert you if an automation is missing an input so that you do not create an automation without clearly defining the actions the bot should perform. You can always paper trade with any bot and [test automationsarrow-up-right](https://docs.optionalpha.com/platform-1/troubleshooting/testing-automations) in live market conditions. ### [hashtag](https://docs.optionalpha.com/tools/bots/safeguards#bot-safeguards) Bot safeguards Bot safeguards are in the bot's Settings. Safeguards define the bot's allocation and position limits. You can edit the safeguards at any time. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FwlvvquyRvYmjuUxrJsEb%252Fimage.png%3Falt%3Dmedia%26token%3D56c1cec0-4e06-46e0-946d-8eea8151b798&width=768&dpr=3&quality=100&sign=83dfce44&sv=2) ### [hashtag](https://docs.optionalpha.com/tools/bots/safeguards#allocation-safeguards) Allocation safeguards When you create a new bot, you must manually input an allocation limit. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FhJeNuoe3cuSzQ6hTJTBk%252Fimage.png%3Falt%3Dmedia%26token%3D0c726787-8dbb-4eae-a2b2-e24599fe1983&width=768&dpr=3&quality=100&sign=38a2dd93&sv=2) Allocation is the total capital from your trading account that is available for a bot to open positions. Bot allocation limits are calculated at position entry. The bot will not open a new position once the allocation limit is reached. If the allocation limit is reached, a new position will only open once another position has been closed and additional capital becomes available, or you change the bot's settings. Market conditions at position closing may cause increased capital allocations beyond the calculated maximum risk at position entry. If the market is illiquid or bid-ask spreads are wide, bots have the potential to risk more capital when the position is closed than was allocated at entry. For example, if there is a wide bid-ask spread for a credit spread position, the ask price to close the spread may exceed the spread’s width. As always, you have the ability to manually override positions, [SmartPricingarrow-up-right](https://docs.optionalpha.com/platform/bots/smartpricing) settings, exit criteria, and orders at any time. If you manually override a position, the Option Alpha platform no longer communicates with the position, and the position will not count against position limits or capital allocation limits. You will need to manage the position manually. You may also need to re-consider your bot’s capital allocation limit if you manually override positions. ### [hashtag](https://docs.optionalpha.com/tools/bots/safeguards#position-safeguards) Position safeguards You can manually select and modify daily and total position in the bot's safeguards. Bots allow for ten daily positions and ten total open positions. 'Daily positions limits' is the maximum number of positions a bot can open in one trading day. 'Position limits' is the maximum number of positions that can be open in a bot at any time. Position limits are for opening positions only; there is no limit on the amount of closing positions, and closed positions do not impact the safeguard position limits. Scanners are automatically turned off if a bot reaches either limit. If a bot has reached an allocation or position limit, the scanner turns off and a warning is displayed in the Position statement and Bot Log stating that a position limit has been reached. ### [hashtag](https://docs.optionalpha.com/tools/bots/safeguards#trade-safeguards) Trade safeguards Trade safeguards require you to manually input certain values, such as the ticker symbol, expiration date, strike price, and more. You must also quantify maximum risk, contract amount, or a percentage of the bot's allocation. These protections are in place because you are responsible for telling the bot exactly what to do. ### [hashtag](https://docs.optionalpha.com/tools/bots/safeguards#other-safeguards) Other safeguards Bots may open risk-defined options positions. This feature is in place to protect traders from undefined risk and to control margin requirements. Synthetic naked positions can be replicated by purchasing far out-of-the-money long options to create a wide credit spread. Last updated 2 months ago Was this helpful? * [Bot safeguards](https://docs.optionalpha.com/tools/bots/safeguards#bot-safeguards) * [Allocation safeguards](https://docs.optionalpha.com/tools/bots/safeguards#allocation-safeguards) * [Position safeguards](https://docs.optionalpha.com/tools/bots/safeguards#position-safeguards) * [Trade safeguards](https://docs.optionalpha.com/tools/bots/safeguards#trade-safeguards) * [Other safeguards](https://docs.optionalpha.com/tools/bots/safeguards#other-safeguards) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # SmartPricing | Option Alpha [hashtag](https://docs.optionalpha.com/tools/bots/smartpricing#smartpricing) SmartPricing ---------------------------------------------------------------------------------------------- SmartPricing places timed limit orders traversing the bid/ask spread to your final price. SmartPricing starts at the mid-price and works toward the bid when selling or ask when buying. SmartPricing attempts to fill the trade by submitting orders from the mid price to a "final price". The final price is the worst price you are willing to accept to fill the trade. Each order will stay active at the broker for an amount of time based on the setting selected. Unfilled orders are canceled automatically and replaced with the next price in the sequence. The final price will stay active for two minutes and then cancel automatically. The two controls you have over this functionality are the SmartPricing mode (e.g. Patient, Normal, Fast) and the "Final Price" (the worst price it should try). You can choose from three SmartPricing settings (normal, fast, patient), turn SmartPricing off and use a single limit, or send a market order. * **Normal** will try up to 4 prices, 10 seconds each.**‍** * **Fast** will try up to 3 prices, 5 seconds each. * **Patient** will try up to 5 prices, 20 seconds each. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F672940c957507999bd0fb8ef_672940bb0207865669818612_Option-Alpha-SmartPricing.png&width=768&dpr=3&quality=100&sign=370606e9&sv=2) Option Alpha SmartPricing #### [hashtag](https://docs.optionalpha.com/tools/bots/smartpricing#final-price) Final Price SmartPricing's Final Price settings allows us to customize the minimum or maximum price we're willing to let the bot to attempt. The final price is the final order your bot will send - your minimum price when selling or max price when buying. circle-info Profit Taking [Exit Options](https://docs.optionalpha.com/tools/managing-positions/exit-options) are a special scenario. You don't need to set a "Final Price" because the final price is automatically set by the bot to a price that locks in the profit you specified. It won't try a price worse than the one that would result in a profit less than your specified amount. If more than one final price option is selected, the best price is used. If the bid/ask spread is narrow, the best price may be the ask when entering a trade. But we can also use use the slippage from the mid-price setting to protect against price fluctuations. This allows the bot to trade even when bid/ask spreads get wide, while still controlling slippage. circle-info For example, if selecting 100% of the bid/ask and $0.10 from the mid-price, the best available price of the two will be used. In the image below, the bid/ask spread is $22.30 -$23.00, with a mid-price is $22.65. The bot would have tried a final price of $22.55 ($0.10 from the mid), but did not continue all the way to the bid price of $22.30. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F1PIdPGhPvJrrCUrFGIDS%252Fimage.png%3Falt%3Dmedia%26token%3D8e3f7614-06e1-46f5-90b4-8d98e05815c1&width=768&dpr=3&quality=100&sign=c161a234&sv=2) Final Price settings If you select 100% as the final price of the bid-ask spread then SmartPricing goes from 50% (mid) to 100% (ask). If you select 75% as the final price of the bid-ask spread then SmartPricing goes from 50% (mid) to 75% (halfway between the mid and the ask). If you limit SmartPricing to 50% as the final price of the bid-ask spread it will only attempt the midpoint price because the midpoint is 50% of the distance between the bid and ask by definition. Bid (0%) - - - (25%) - - - Mid (50%) - - - (75%) - - - Ask (100%) circle-info Keep in mind you're selecting the "final price", not the percentage of the bid-ask spread that's used. SmartPricing always starts at the midprice. We can also use a math operator as a final price setting inside a 'Close Position' action in automations. The final price value references the position’s opening entry price to arrive at a final limit price to exit the position. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FN5gkMWRvcjFt0KWEsuf3%252Fimage.png%3Falt%3Dmedia%26token%3Db7928225-adc2-413d-b539-a3c9503e5f9e&width=768&dpr=3&quality=100&sign=a97e8401&sv=2) SmartPricing Final Price position trade price math operator For example: A **x 1.15** multiplier would close the trade with a 15% or better profit for a debit type trade. A **\+ 2.50** addition would close the trade with $250 or better profit per contract for a debit type trade. A **x 0.50** multiplier would close the trade with a 50% or better profit for a credit type trade. A **\- 0.75** offset to the position’s opening price would close the trade with a $75 or better profit per contract for a credit type trade. #### [hashtag](https://docs.optionalpha.com/tools/bots/smartpricing#spx-smartpricing) SPX SmartPricing SmartPricing calculates the prices based on several points across the bid/ask spread. For example: mid, 1/3, 2/3, final price. In the case of SPX, the prices at the fractions in the middle are rounded up or down to the nearest nickel ($0.05) depending on whether you are selling or buying. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F8XJSDN6BR9WZCVihaMNV%252Fimage.png%3Falt%3Dmedia%26token%3D2d367fec-4f90-4ee0-9943-7ce8b1379b80&width=768&dpr=3&quality=100&sign=3a7e0009&sv=2) SPX SmartPricing example For example, if the bot is using the 'normal' SmartPricing setting to open an SPX short put spread with a $0.50 wide bid/ask spread, it will start at or near the mid price and send timed limit orders as it traverses toward the bid as optimal as possible. $0.25 cannot be evenly distributed four ways, so SmartPricing automatically adjusts the spacing of the orders. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FpeHh3DkWBxgdzeMNCIG2%252Fimage.png%3Falt%3Dmedia%26token%3D9947f6f7-9e49-40f7-b701-c2b49f3d3f5c&width=768&dpr=3&quality=100&sign=5c8f9971&sv=2) SPX SmartPricing example SmartPricing automatically rounds to the nearest nickel increment price (rounds up when selling, down when buying). In the above example, he final price is set to $4.23, so the bot rounds up to $4.25 and will not try a price below that. The fill price is the mid of all legs added together. In the case of SPX which can only fill legs in nickel increments, it can result in a mid that is not actually in the middle of the bid/ask. For example, an SPX call with a bid/ask of $0.10 - $0.15 the mid price is $0.15 when buying, $0.10 if selling since there is no valid price in between the spread. When you apply that same rule for all legs of a multi-leg position, you can end up with a mid price that is not very intuitive. #### [hashtag](https://docs.optionalpha.com/tools/bots/smartpricing#smartpricing-example) SmartPricing example The Final Price setting is available on all position opening actions (e.g. Open Position, Open Trade Idea, etc), the Close Position action and each Exit Option setting. The default is to try filling the trade at a price up to 100% of the bid/ask spread, which looks like this: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F67aa548951cf25fcc56463c4_173919722467618382711.png&width=768&dpr=3&quality=100&sign=7b4c23ea&sv=2) In this case the bot will start with an order at the mid price and try up to a total of four different prices before it makes it to the "Final Price", which is set to 100% of the bid/ask spread. If you click the "Price" field, you have the option to control the "Final Price" the bot will try to get the order filled at, for example: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F67aa54896f31a784c25478b2_173919736023415575401.png&width=768&dpr=3&quality=100&sign=cb69fa&sv=2) If you select more than 1 Final Price option then the best price is selected as the final price to try to get filled at. For example, you could select: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F67aa548a7f33619ddb303862_173919755139116957321.png&width=768&dpr=3&quality=100&sign=1287047e&sv=2) Which would make it use whichever is the "best" fill price for you out of those 3 options. You can see a log of the values at the time of the trade in the trade log here: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F67aa548991084a6deb8e2465_173919785029016097271.png&width=768&dpr=3&quality=100&sign=2d0cf988&sv=2) This was selling a short put credit spread, so the "best" price of the 3 selected options was $2.34 from the "120% of typical slippage" option and that was used as the Final Price to try to get filled at. Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Decision actions | Option Alpha [hashtag](https://docs.optionalpha.com/tools/bots/decision-actions#decisions) Decisions -------------------------------------------------------------------------------------------- Decision recipes are the core components of creating sophisticated trading automations. These pre-built logic blocks handle a wide range of conditions, from simple price movements to complex market indicators and trade performance metrics. By understanding and effectively combining these recipes, you can construct automations that align precisely with your trading strategy. #### [hashtag](https://docs.optionalpha.com/tools/bots/decision-actions#types-of-decision-recipes) Types of Decision Recipes * Symbol-Based Decisions: These recipes focus on the characteristics of a specific symbol. You can evaluate its price, volatility, or other properties specific to the symbol referenced. * Indicator-Based Decisions: Based on technical indicators, these recipes allow you to assess market trends and conditions. You can set conditions on daily closing values of indicators for the assigned symbol. * Position-Based Decisions: Evaluate the performance of an open position using various metrics and statistics. These decisions are crucial for managing risk and optimizing profits. * Bot-Based Decisions: Analyze the behavior and performance of your bot itself. You can check specific bot properties and metrics to make adjustments to your strategy. * Opportunity-Based Decisions: Focus on the characteristics of a potential trade opportunity before it's opened. You can filter opportunities based on specific criteria. * General Decisions: These versatile recipes cover broader conditions like time of day, day of week, and economic news events. #### [hashtag](https://docs.optionalpha.com/tools/bots/decision-actions#building-your-automation-logic) Building Your Automation Logic Decision recipes are the building blocks for your automation's logic flow. By connecting these recipes in various combinations, you can create complex conditions that trigger different actions. For example, you might combine a symbol-based decision (price above a certain level), an indicator-based decision (RSI overbought), and a time-based decision (specific trading hours) to open a short position. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FggnB6bfFOQH3MvC4XLEw%252Fimage.png%3Falt%3Dmedia%26token%3Dd29154d3-d04c-453d-ae65-ebe94719efc1&width=768&dpr=3&quality=100&sign=39505e05&sv=2) Additionally, you can group decisions together using Or and And conditions which enhances the logic being checked even further. For example, you may want to check for a situation where one, or the other, conditions could be true for a trade to be attempted. Lets build off the previous example; in this case we'll use an Or condition to build a decision that is checking if the RSI is overbought above 70 or that the price is above Bollinger Band High Band Level. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F7aPMCPhYLyTrPtm7LTcc%252Fimage.png%3Falt%3Dmedia%26token%3D593588ee-b8ea-4de1-b280-d413f55b5df1&width=768&dpr=3&quality=100&sign=dbf3ddef&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/decision-actions#leveraging-the-editor-for-efficiency) Leveraging the Editor for Efficiency Option Alpha's editor is designed to streamline the automation building process. One of its powerful new features is the ability to copy and paste groups of decisions. This allows you to reuse complex logic structures across multiple automations, saving you time and effort. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FYmbjA9ijWbpYTDl2e7Dm%252Fimage.png%3Falt%3Dmedia%26token%3D504cac87-65a6-4b64-b1ec-bdc1e96333c4&width=768&dpr=3&quality=100&sign=691c0479&sv=2) By mastering the art of combining decision recipes, you can create highly customized and effective trading automations. Experiment with different combinations to find the strategies that best suit your trading style. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Platform | Option Alpha [Infrastructure & Securitychevron-right](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security) [Automationschevron-right](https://docs.optionalpha.com/technical-documentation/platform/automations) [Automation Behaviorchevron-right](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior) [Data Feedschevron-right](https://docs.optionalpha.com/technical-documentation/platform/data-feeds) [Order Handlingchevron-right](https://docs.optionalpha.com/technical-documentation/platform/order-handling) [Bot Limitationschevron-right](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations) [Supported Ticker Symbolschevron-right](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols) [Supported Browserschevron-right](https://docs.optionalpha.com/technical-documentation/platform/supported-browsers) [Supported Countrieschevron-right](https://docs.optionalpha.com/technical-documentation/platform/supported-countries) [Ex Dividend & Earnings Dateschevron-right](https://docs.optionalpha.com/technical-documentation/platform/ex-dividend-and-earnings-dates) [Options Expiration Protocolchevron-right](https://docs.optionalpha.com/technical-documentation/platform/options-expiration-protocol) [Autotrading Best Practiceschevron-right](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Infrastructure & Security | Option Alpha The Option Alpha bot ecosystem is hosted entirely on Amazon Web Services (AWS), located within the United States. The front-end is written primarily in native JavaScript, with minimal reliance on third-party frameworks. The back-end infrastructure is written entirely in Node.js and deployed across a large, distributed network of servers. We are proud to say that all of our servers are the fastest available anywhere in the cloud. Each Linux server runs an all-core turbo clock at 4.5 GHz to ensure automations and data are processed as fast as possible. Bots are stateful and in the unlikely event of a network failure, the entire system can be brought back online in a matter of seconds, resuming the exact state they were in prior to failure. [hashtag](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#pod-system) Pod System ------------------------------------------------------------------------------------------------------------------------------- The entire platform is set up to auto-scale as new users join. We use a horizontal scaling paradigm, meaning that each user is allocated resources per bot service instance, with a predefined number of instances per server, across _n_ servers. Each server is referred to as a _pod_, where each pod can handle _m_ users. The entire network of pod servers is closely monitored for resource usage, and at any time we can re-scale the total number of users per bot service instance, instances per pod, and/or total pods to maintain network stability. [hashtag](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#browser-compatibility) Browser Compatibility ----------------------------------------------------------------------------------------------------------------------------------------------------- The autotrading platform offers cutting-edge technology directly inside your web browser. There is no software to download. The trade-off is browser compatibility. Not all browsers are compatible with the platform. To provide users a consistently fast and extremely powerful web-based software, our developers leverage advanced features available to Google's [V8 enginearrow-up-right](https://v8.dev/) that runs JavaScript. An engine is underlying code that's used to interpret and execute Option Alpha's JavaScript instructions at the browser level. Therefore, the officially supported browser is [Google Chromearrow-up-right](https://www.google.com/chrome/) . In theory, any browser running V8 (the new Chromium-based Microsoft Edge, for example), should be fully compatible. **Users not running Google Chrome or another V8 browser will experience stability issues.** Any user not running a V8-compatible browser will still be able to login to the platform but may experience undocumented stability issues. The user may not even be aware the application is not functioning as intended. [hashtag](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#security) Security --------------------------------------------------------------------------------------------------------------------------- Most platforms are a collection of code from various libraries and scripts that creates an unstable platform and leaves you vulnerable. Instead, we spent five years building the entire platform and network from the ground up with an in-house team of developers. We wrote every single line of code that runs automated trading which means we control the full software stack from top to bottom. There is an absolute minimal reliance on third-party packages or software. You won't find this level of commitment anywhere else. Plus, we also... 1. Operate a web-based platform in the cloud, hosted by AWS and monitored by our team inside our Virtual Private Cloud (VPC). 2. Require the highest level of TLS browser encryption. 3. Send all requests originating from bots via point-to-point access from our US-based servers directly to your broker. 4. Place multi-tiered web application firewalls (WAFs), in front of all web traffic, to protect against malicious hacking or denial-of-service (DoS) attempts. 5. Use reverse proxying to scalable web server instances to create the fastest platform possible for our traders and ensure uptime. [hashtag](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#broker-connections) Broker Connections ----------------------------------------------------------------------------------------------------------------------------------------------- The method the bots use to connect to your brokerage account is dictated by the broker. In most cases, they will dictate the use of the [OAuth 2.0arrow-up-right](https://oauth.net/2/) standard for access delegation. When it is time to [connect to your brokerarrow-up-right](https://optionalpha.com/help/trading-accounts) for live trading, we will present you with a secure login modal for your account to authenticate the bot server with your broker. The broker will provide us with a special token that the bots will use in a very limited capacity. circle-info Bots only use broker connections to submit or monitor active orders and positions. They only access your broker when required. Option Alpha does not have access to your account details. Bots are not constantly connected to brokerage accounts. Instead, they only submit orders through the API and monitor their status, if required. All tracking that occurs during the lifetime of an open position is done directly through the bots and their live data feed. Last updated 2 months ago Was this helpful? * [Pod System](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#pod-system) * [Browser Compatibility](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#browser-compatibility) * [Security](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#security) * [Broker Connections](https://docs.optionalpha.com/technical-documentation/platform/infrastructure-and-security#broker-connections) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Parameter Selection | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#parameter-selection) Parameter Selection --------------------------------------------------------------------------------------------------------------------------------------------- Unless otherwise specified, the bots will default to whichever value or parameter is **closest** to the requested input parameter (described below). In almost all cases, this is done by a binary search on a sorted array of possible values. Additionally, strike selections for **exactly**, **or higher**, and **or lower** are available which provides full control over targeting specific strikes and rounding in your preferred direction based on the strike selection method. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#strikes-selection) Strikes Selection #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#delta) Delta If the user requests a strike based on a delta value, the strike chosen will be the strike with a delta value closest to the delta specified, determined by absolute difference with up to 8 decimal places of precision. In the simplest case, assume a put option delta _**z**_ is chosen with a value _**z**_ =−0.1 (i.e., the 10-delta). If the strikes closest to _**z**_ have delta values _**x**_ =−0.08 and **y**\=−0.11, then we choose the strike **closest to** _z_ with delta _k._ Therefore, ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F6238a31d7476389391357ad9_Delta%2520Formula.png&width=768&dpr=3&quality=100&sign=f40a84d8&sv=2) where _**x**_ and _**y**_ are identified from the ordered list of all strikes on a given expiration. As noted above, decimal precision goes out to 8 decimal places. The probability that 2 adjacent strikes exist of equal absolute distance to the chosen _**z**_ is extremely small. Should that situation occur, the strike chosen will be the first closest to be identified. The range of deltas listed on the auto-trading platform is in increments of +/- .05. This is because deltas between different tickers are wide-ranging and often have an inconsistent variance. While the bot can choose any delta, the selection of deltas for the bot will be in increments of +/- .05**.** #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#percentage) Percentage If a user requests a strike based on percentage value, the strike chosen will be the strike closest to the percentage offset; whether that is a percentage from underlying price or a percentage above or below a referenced leg, it will always be closest to. If choosing a percentage of a referenced leg, the strike chosen will never be the same as the referenced leg, even if the offered strike widths are wider than the resulting percentage offset. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#dollar-based) Dollar-based If a user requests a strike based on a dollar-based offset, the strike chosen will be the closest strike to the dollar-based offset. In situations where the width of the offered strikes in an option chain is wider than the specified offset, the next available strike will be selected. The automation will not choose the same strike as the strike in reference. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#standard-deviation) Standard Deviation The standard deviation option for strike selection compares the current price to the underlying's 30-day std deviation, multiplied by the user-defined value. Contract expiration does not play a role in the std. deviation calculation: underlying Price +/- (X \* sd30) _**X**_ represents the number of std. dev provided by the user. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#days-to-expiration) Days to Expiration **When using "at least" or "exactly"** When selecting an option expiration using "at least" a certain number of days, the chosen expiration will always be at least the number of days specified but the closest DTE beyond that minimum threshold. When selecting an option expiration using "exactly" a certain number of days, the chosen expiration will always be the exact number of days specified unless that expiration is not available. In that case, an error will generate notifying that no expiration exists. **When using between "x and y" days** When selecting an expiration between "x and y" number of days, the bot will select the first available expiration that is closest to the minimum number of days. For example, if you select an expiration between 10 and 30 days, and there is an expiration at 14 days and another at 21 days, it will choose the 14-day expiration. The bot has a tendency towards the lower bound of the range and will always select the one closest to the earliest day specified. **When using "on or after a certain date"** When selecting an expiration on or after a certain date, the expiration chosen will be on that date if an expiration exists, and the closest expiration after that date if it does not exist. Last updated 2 months ago Was this helpful? * [Parameter Selection](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#parameter-selection) * [Strikes Selection](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection#strikes-selection) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Calculations | Option Alpha [Profit and Losschevron-right](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss) [Decision Propertieschevron-right](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties) [Decision Calculationschevron-right](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations) [Parameter Selectionchevron-right](https://docs.optionalpha.com/technical-documentation/calculations/parameter-selection) [Probabilitychevron-right](https://docs.optionalpha.com/technical-documentation/calculations/probability) [Probability Theorychevron-right](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory) [Understanding Alpha and Expected Valuechevron-right](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Supported Ticker Symbols | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#supported-ticker-symbols) Supported Ticker Symbols -------------------------------------------------------------------------------------------------------------------------------------------------------- Option Alpha currently supports more than 340 ticker symbols. Learn more about the selection criteria [here](https://docs.optionalpha.com/technical-documentation/platform/data-feeds) . ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#stocks) **Stocks** A, AA, AAL, AAP, AAPL, ABBV, ABNB, ABT, ACN, ADBE, ADI, ADM, ADP, ADSK, AEP, AES, AFL, AFRM, AGNC, AIG, AI, AKAM, ALB, ALK, ALL, AMAT, AMD, AMGN, AMRN, AMZN, APA, APH, APTV, AVGO, AXP, BA, BABA, BAC, BAX, BBY, BEN, BIDU, BIIB, BK, BKR, BMY, BP, BSX, BX, BYND, C, CAH, CAT, CB, CCI, CCL, CCJ, CF, CFG, CHWY, CI, CL, CLF, CLX, CMCSA, CME, CNC, CNP, COF, COIN, COP, COST, CPB, CPRI, CRM, CRON, CRWD, CSCO, CSX, CTVA, CVNA, CVS, CVX, CZR, D, DAL, DD, DE, DELL, DHI, DHR, DIS, DKNG, DLR, DOCU, DOW, DRI, DVN, DXC, EA, EBAY, ED, EIX, EL, EMR, ENPH, EOG, EQT, EQR, ETSY, EVRG, EW, EXC, EXPE, F, FANG, FAST, FCX, FDX, FE, FITB, FOXA, FSLR, FTI, FTV, GD, GE, GILD, GLW, GM, GME, GOLD, GOOG, GOOGL, GPRO, GPS, GS, HAL, HBAN, HBI, HCA, HD, HIG, HLT, HOG, HOLX, HON, HPE, HPQ, IBM, ICE, INTC, IP, IPG, IRM, IVZ, JCI, JD, JNJ, JNPR, JPM, K, KHC, KMI, KO, KR, KSS, LEN, LI, LKQ, LLY, LNC, LOW, LUMN, LUV, LVS, LYB, LYFT, MA, MAR, MARA, MAS, MCD, MCHP, MDLZ, MDT, MET, META, MGM, MMM, MO, MOS, MPC, MRK, MRNA, MRVL, MRO, MS, MSFT, MSTR, MTB, MU, MTCH, NCLH, NEE, NEM, NET, NFLX, NKE, NOW, NRG, NTAP, NTES, NVAX, NVDA, NWL, NWSA, O, OKE, OMC, ON, ORCL, OXY, PBR, PDD, PENN, PEP, PFE, PFG, PG, PGR, PINS, PNC, PPL, PLTR, PRU, PSX, PT, PTON, PYPL, QCOM, RBLX, RCL, RF, RIOT, RIG, RIVN, ROKU, ROST, RTX, RUN, SBUX, SCHW, SEDG, SHOP, SIRI, SLB, SMCI, SNAP, SNOW, SO, SPG, STX, SWKS, SYF, SYY, T, TAP, TCOM, TDC, TDOC, TFC, TGT, TJX, TMO, TMUS, TPR, TRIP, TRV, TSLA, TSM, TSN, TT, TTD, TTWO, TXN, U, UA, UAA, UAL, UBER, ULTA, UNH, UNM, UNP, UPS, UPST, URBN, USB, V, VALE, VFC, VTR, VZ, WAB, WBA, WBD, WDC, WFC, WM, WMB, WMT, WU, WY, WYNN, XEL, XOM, XRX, XYZ, YELP, ZION, ZM ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#etfs) **ETFs** BITO, DIA, EEM, EFA, EWJ, EWW, EWY, EWZ, FXE, FXI, GDX, GLD, HYG, IBB, IBIT, IEF, IWM, IYR, JETS, KRE, KWEB, LQD, OIH, QQQ, SCHD, SLV, SMH, SOXL, SOXS, SPXL, SPXS, SPY, SQQQ, TBT, TLT, TQQQ, UNG, USO, UVXY, VGK, VXX, XBI, XHB, XLB, XLC, XLE, XLF, XLI, XLK, XLP, XLRE, XLU, XLV, XLY, XOP, XRT, YINN ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#indexes) **Indexes** SPX, XSP #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#trade-ideas) **Trade Ideas** AAL, AAPL, ABBV, ABT, ADI, ADM, ADBE, ADP, ADSK, AIG, AMAT, AMD, AMGN, AMZN, APA, AVGO, AXP, BA, BABA, BAC, BBY, BIDU, BMY, BP, BSX, BX, BYND, C, CCL, CAT, CF, CHWY, CL, CLF, CLX, CMCSA, COF, COP, COST, CRM, CRWD, CSCO, CVS, CVX, CZR, DAL, DD, DE, DHI, DIA, DIS, DKNG, DOCU, DOW, DVN, EA, EBAY, EEM, EFA, EIX, EOG, EWJ, EWW, EWZ, EXPE, F, FCX, FDX, FITB, FSLR, FXI, GDX, GE, GILD, GLD, GM, GOLD, GOOG, GOOGL, GS, HAL, HD, HON, HPQ, HYG, IBM, IBB, IBIT, INTC, IWM, IYR, JD, JNJ, JPM, KMI, KO, KR, KRE, KSS, LEN, LLY, LOW, LQD, LUV, LVS, LYFT, MAR, MARA, MCD, MCHP, MDT, MDLZ, MET, META, MGM, MMM, MO, MOS, MPC, MRK, MRNA, MRVL, MS, MSFT, NCLH, NEE, NEM, NET, NFLX, NKE, NOW, NRG, NTAP, NVDA, OIH, OMC, ORCL, OXY, PEP, PFE, PG, PGR, PLTR, PNC, PSX, PYPL, QCOM, QQQ, RCL, RIG, ROKU, ROST, RTX, SBUX, SCHW, SHOP, SLB, SLV, SMH, SO, SPG, SPY, STX, T, TBT, TCOM, TGT, TJX, TLT, TMUS, TSLA, TSM, TSN, TTD, TXN, UAL, UBER, ULTA, UPS, USB, USO, V, VFC, VXX, VZ, WBA, WDC, WFC, WMT, WYNN, XBI, XHB, XLC, XLB, XLE, XLF, XLI, XLK, XLP, XLU, XLV, XLY, XOM, XOP, XRT, XSP, ACN, XYZ, ZM Download CSV format [here.arrow-up-right](https://docs.google.com/spreadsheets/d/13shqynYndlgTiV-1JuR8j9JByKBjaELOYeh1eLb9i9s/edit?usp=sharing) circle-info Additional symbols may be added to the database at a future date based on popularity and liquidity. Last updated 1 month ago Was this helpful? * [Supported Ticker Symbols](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#supported-ticker-symbols) * [Stocks](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#stocks) * [ETFs](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#etfs) * [Indexes](https://docs.optionalpha.com/technical-documentation/platform/supported-ticker-symbols#indexes) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Ex Dividend & Earnings Dates | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/ex-dividend-and-earnings-dates#ex-dividend-and-earnings-dates) Ex Dividend & Earnings Dates ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Earnings and ex-dividend dates are an integral part of financial markets. Many of Option Alpha's supported tickers pay a dividend. However, ex-dividend and earnings dates are often rescheduled. To ensure redundancy, we employ two different data sources for the earnings dates showing in our calendar. ETF ex-dividend dates have been manually added to the platform using the providers distribution schedule or the projected recurring schedule based on historical data. Future dates are an estimation and subject to change. circle-info We encourage the community to participate in this process and ensure that the dates are accurate. Here are links to the 2024 Distribution Schedules for most of the [supported ETFsarrow-up-right](https://optionalpha.com/help/supported-ticker-symbols) ‍ [BlackRock iSharesarrow-up-right](https://www.ishares.com/us/literature/shareholder-letters/isharesandblackrocketfsdistributionschedule.pdf) (EEM, EFA, EWZ, FXI, HYG, IWM, IYR, LQD, TLT, EWJ, EWY, EWW, IBB) [StateStreet SPDRsarrow-up-right](https://www.ssga.com/library-content/products/fund-data/etfs/us/distribution/SPDR_Dividend_Distribution_Schedule.pdf) (DIA, KRE, SPY, XBI, XHB, XLB, XLE, XLF, XLK, XLP, XLU, XLY, XOP, XRT, XLC, XLI, XLRE, XLV) [VanEckarrow-up-right](https://www.vaneck.com/us/en/vaneck-etfs-distributions-schedule-2024.pdf) (GDX, OIH, SMH) [Direxionarrow-up-right](https://www.direxion.com/press-release/etf-distributions) (SPXL, SPXS) [Proshares arrow-up-right](https://www.proshares.com/resources/distribution-schedules) (TBT, SQQQ, TQQQ) The following ETFs do not currently offer a dividend and are excluded from the calendar: * GLD * SLV * UNG * USO * UVXY * VXX * XSP Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Inputs | Option Alpha [hashtag](https://docs.optionalpha.com/tools/bots/inputs#using-inputs) Using Inputs ---------------------------------------------------------------------------------------- Efficiency is one of the key advantages of using automation in trading. With less manual trading, you have more time to discover, refine, and scale your strategies. One of the most powerful tools for increasing bot functionality on Option Alpha’s platform is the use of custom inputs. This guide will help you understand how to use inputs effectively, the hierarchy involved, and the best practices for managing these inputs. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FzPZLEEcrIMfxKKLkkTPl%252Fimage.png%3Falt%3Dmedia%26token%3D9f3a6b20-0550-42e9-9c42-b35427be9bda&width=768&dpr=3&quality=100&sign=93062b23&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#what-are-inputs) What Are Inputs? Custom inputs are variable fields within your automations that you can link and edit in the future. They provide a convenient way to manage and update key values without having to edit each individual instance within an automation. By using inputs, you can change a value in one place, and that change will automatically apply wherever the input is referenced in the automation. For example, if you create a custom input for a ticker symbol within an automation, you can reference that input throughout the automation. Then, if you need to change the ticker symbol later, you simply update the custom input, and the change is reflected everywhere that input is used. #### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#input-hierarchy-automation-level-vs.-bot-level-inputs) Input Hierarchy: Automation-Level vs. Bot-Level Inputs One of the most important concepts to understand is the hierarchy of inputs. In Option Alpha, you can manage inputs at two levels: 1\. Automation-Level Inputs: These inputs are defined within a specific automation. They can be modified directly in the automation's settings panel and will affect all instances of that input within the automation. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FObQAMCBnIl4w6T8EVFoG%252Fimage.png%3Falt%3Dmedia%26token%3D10b40aaa-fff9-4780-93e2-3ba11dc4f620&width=768&dpr=3&quality=100&sign=1d8b80cd&sv=2) 1. Bot-Level Inputs: These inputs are defined at the bot level and can be used across multiple automations within the same bot. Bot-level inputs allow you to manage key variables from a central location, the Bot Settings panel, providing a higher level of control and convenience. By moving an input from the automation level to the bot level, you can change values without diving into each individual automation. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F8guzZ3DlSJloecJAU2Yu%252Fimage.png%3Falt%3Dmedia%26token%3D5bb77696-5c7b-4ec9-821d-c38e990909df&width=768&dpr=3&quality=100&sign=36c49fba&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#using-bot-inputs) Using Bot Inputs ### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#what-is-the-difference-between-a-decision-input-automation-input-and-bot-input) What is the difference between a Decision Input, Automation Input, and Bot Input? medal (Thank you to community member [Robert DiNeroarrow-up-right](https://app.optionalpha.com/community/member/pachiraaquatica) for his contribution and help in [this postarrow-up-right](https://app.optionalpha.com/community/posts/whats-the-difference-between-a-decisio-2026040221160) ). We frequently get questions about users changing values, but the bot doesn't recognize the new values. Most often, this is due to the user changing the Default Value instead of the Automation Input value. Here are the 5 types of inputs and how they are used. #### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#decision-inputs) Decision Inputs This bot example has one automation: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F829R5krTOjyf1B0l8my0%252Fimage.png%3Falt%3Dmedia%26token%3Ded30786a-6c92-4bef-87c7-8c307241842a&width=768&dpr=3&quality=100&sign=97c2192a&sv=2) That automation has one recipe that checks whether SPY is above $600. The $600 value is only used by that specific decision. We'll call that the Decision Value. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517715865510523951.png&width=768&dpr=3&quality=100&sign=a6ebaec1&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#automation-inputs) Automation Inputs Inputs make it easier to change a value, especially if it is used multiple times within an automation. To add a **second recipe within the bot** that also uses the same price, you can create an **Automation Input** that can be used across multiple decisions within the same Automation (the "Automation" in "Automation Input"). Create the Automation Input when I link (🔗) the Decision Input to the Automation Input. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517319372019151121.png&width=768&dpr=3&quality=100&sign=c7cca76e&sv=2) As there are no existing Automation Inputs that match that data type, add a new Automation Input called 'myAutomationInput'. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517722907114374371.png&width=768&dpr=3&quality=100&sign=7a88ca5c&sv=2) Give it a "Default Value" of 600. Important to note that at the time the input is created, the Default Value and the Automation Input value are the same value: 600. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517326229116762761.png&width=768&dpr=3&quality=100&sign=f6e20b39&sv=2) You can see the list of Automation Inputs on the left side of the Automation. There is currently one Automation Input called 'myAutomationInput,' and it's used once in the automation. Click on that input to change the label, default value, and description. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517329229215175161.png&width=768&dpr=3&quality=100&sign=6dcf5824&sv=2) Click on the gear icon (⚙️) next to the automation to see the newly created 'myAutomationInput' and the value assigned to it: 600. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517351323615736321.png&width=768&dpr=3&quality=100&sign=2b92c33b&sv=2) If you want to change the 'myAutomationInput' to 700, you can change that number in the **Settings of the Automation.** **THIS IS KEY!** ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517363615715521371.png&width=768&dpr=3&quality=100&sign=2acf1624&sv=2) In the automation's Inputs, the Automation Input Default Value is still 600. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517369127717903341.png&width=768&dpr=3&quality=100&sign=8122d0b3&sv=2) When running the automation, the bot uses the 700 value defined in the **settings** for 'myAutomationInput' (**not the Default Value**): ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517382817715296431.png&width=300&dpr=3&quality=100&sign=903922b5&sv=2) If you want to add another decision using 'myAutomationInput', you now only have to change the value in one location (the gear icon next to the automation name) when you want to change the value. The list of Automation Inputs now shows that there are two places in which that input is used within the automation. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517461979812385761.png&width=768&dpr=3&quality=100&sign=601d4af7&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#bot-inputs) Bot Inputs If you want to add a **second automation within the bot** that also uses the same value (as it is easier to change one value), you can create a [**Bot Input**arrow-up-right](https://docs.optionalpha.com/tools/bots/inputs#using-bot-inputs) that can be used across multiple automations within the same bot (the "Bot" in "Bot Input"). Create the Bot Input when I link (🔗) the Automation Input to the Bot Input. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517408511513424801.png&width=768&dpr=3&quality=100&sign=a297f51f&sv=2) Because there are no existing Bot Inputs that match that data type, you can add a new Bot Input called 'myBotInput' and give it a "Default Value" of 650. Important to note that at the time the input is created, the Default Value and the Bot Input value are the same value: 650. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517417184614030341.png&width=768&dpr=3&quality=100&sign=e78b8ad3&sv=2) Now 'myAutomatonInput '(shared across multiple decisions) is linked to 'myBotInput' (shared across multiple automations) ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517427209814100191.png&width=768&dpr=3&quality=100&sign=e9ec701b&sv=2) ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517428462517926751.png&width=768&dpr=3&quality=100&sign=f056573d&sv=2) Remember from above that **myAutomationInput** had a value of 700, which resulted in "false" when running the automation. Now, when running the automation with the link to **myBotInput**, which has a value of 650, the result is "true": SPY's price of 655.83 is above 650. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517486182712565281.png&width=768&dpr=3&quality=100&sign=d67325b6&sv=2) If you want the bot to use 675 in each decision and automation that's linked to myBotInput, change myBotInput to 675... ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517509100311706421.png&width=768&dpr=3&quality=100&sign=7b9a3910&sv=2) ...and run the automation again, the result is false: SPY's price of 655.83 is NOT above 675. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517512490110736371.png&width=768&dpr=3&quality=100&sign=2052623a&sv=2) Keep in mind the Bot Input Default Value is still 650. At this point you might say "what's the purpose of the Default Value if it's always ignored?". So let's talk about Default Values. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517520504614408131.png&width=768&dpr=3&quality=100&sign=830b0f9a&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#default-values) Default Values Remember: the decision input is linked to the Automation Input, which is linked to the Bot Input - and the **Bot Input value takes priority**. The Default Values are not used UNLESS the Automation/Bot Input link **is broken.** To illustrate this, here is a second bot called mySecondBot. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517541870319600351.png&width=768&dpr=3&quality=100&sign=a6f520a9&sv=2) This bot does not have any automations, so I'll "**copy to bot**" 'myAutomation'. Notice that when copying the automation to the new bot, there are no Bot Inputs. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517546026516598121.png&width=768&dpr=3&quality=100&sign=e821e00b&sv=2) However, when clicking on the gear icon next to the myAutomation you can still see that **myAutomationInput is linked to myBotInput**! ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517552137117603761.png&width=768&dpr=3&quality=100&sign=b6afa3d3&sv=2) So the Decision Value is linked to the Automation Input. And the Automation Input is linked to the Bot Input. But the Bot Input is not defined anywhere. So what happens when you run the automation? Which value will it use? When running the automation, the bot cannot find the Bot Input value and "defaults" to the Automation Input Default Value of 600. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177517558308612651561.png&width=768&dpr=3&quality=100&sign=b5c48488&sv=2) **Upgrades**: Bot Inputs are **not** updated when you upgrade a bot. This is why you see the Bot Inputs screen - so you can compare your Bot Inputs with the author's new Bot Inputs. If your bot isn't using the values you expect, start by looking at the log to see whether a Decision Input is used (hardcoded value) or an Automation Input is used (variable name). If an Automation Input is used, check the value located in the Automation Settings (not the default value inside the automation). If the Automation Input is linked to a Bot Input, check that the Bot Input is defined. In addition, whenever you upgrade or clone a bot, make sure that you confirm the values for the Automation Inputs and Bot Inputs. Not only can this result in subpar performance for you, but it can also misrepresent the bot template's performance on the Top Bots page. ### [hashtag](https://docs.optionalpha.com/tools/bots/inputs#best-practices-for-managing-inputs) Best Practices for Managing Inputs Once you establish custom inputs, it’s crucial to manage them effectively to maintain the efficiency and flexibility they offer. Here are some best practices: \- Avoid Editing Inputs Inside the Editor: Once an input is established outside the editor, whether at the automation or bot level, all changes to that input should be made in the respective settings panel. This ensures consistency and prevents errors that could arise from making changes directly within the editor. \- Centralize Input Management: By moving key inputs to the bot level, you can manage them from the Bot Settings panel. This centralization simplifies the process of updating values and ensures that changes are applied consistently across all automations within the bot. \- Reuse and Scale with Inputs: Inputs are especially useful when you plan to reuse an automation in different bots or scenarios. By defining inputs that can be easily modified, you can quickly adapt the automation to different contexts without reworking the entire setup. Custom inputs are a powerful feature that can significantly enhance the efficiency and flexibility of your trading bots on Option Alpha. By understanding the input hierarchy and following best practices for managing inputs, you can streamline your trading processes, save time, and focus more on optimizing your strategies. Last updated 1 day ago Was this helpful? * [Using Inputs](https://docs.optionalpha.com/tools/bots/inputs#using-inputs) * [What is the difference between a Decision Input, Automation Input, and Bot Input?](https://docs.optionalpha.com/tools/bots/inputs#what-is-the-difference-between-a-decision-input-automation-input-and-bot-input) * [Best Practices for Managing Inputs](https://docs.optionalpha.com/tools/bots/inputs#best-practices-for-managing-inputs) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Order Handling | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/order-handling#order-handling) Order Handling -------------------------------------------------------------------------------------------------------------------------- Bots do not share an order ID with your broker. Each bot has a unique ID maintained by Option Alpha. Positions are tracked and managed independently of the broker. We submit a buy-to-close or sell-to-close order and the broker performs the reconciliation to determine whether or not the order is valid. The broker reconciles a buy or sell-to-close order against existing positions. The closing order won't automatically reverse the order if it does not exist, it will error out. When adding to an existing position, the bot will only manage the quantity it knows about. The additional quantity that was opened manually will need to be closed manually. You can manually override a position in the platform and the bot will no longer manage the position; you will need to manage the position through your broker. Additionally, overridden positions will no longer count against your daily or max position limits. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FLUT6BvM9NJvyaZiF3Lnx%252FCleanShot%25202026-03-05%2520at%252009.24.32%25402x.png%3Falt%3Dmedia%26token%3D236c5a15-6bed-416b-ae47-c19f1dfb9fd0&width=768&dpr=3&quality=100&sign=32b3cc0d&sv=2) The bot will honor any instructions to close the position in your automations (or at expiration if ITM) as if it was still open. However, since you've externally closed the position, the broker will produce an error with a message informing you the position does not exist. At that point, you can still manually override the position in the bot so it doesn't try again. circle-info Users are encouraged to reach out to the broker for questions on their reconciliation process**.** #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/order-handling#position-states) Position States Bot Positions can be in four different states, _Open_, _Opening_, _Closed_, and _Closing_. When an order is passed from the automation to the broker service it changes state, and in the process is released from the bot temporarily until returned with an updated state. During this time, the bot is unaware of this position and will not be recognized as Open by other automations. Positions that are in a _Closing_ state are not recognized by other automations as _Open_ while undergoing the closing process. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/order-handling#partial-fills) Partial Fills All orders are submitted as timed limit orders. If a partial fill event is returned, we wait for the remaining position to be filled. On the subsequent partial fill(s) we reset the timeout, default to 2 minutes. If no new partial fill event is received after the timeout expires, the remaining order is simply canceled, and the position status changes from "opening" to "open" with the partial quantity. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/order-handling#assignment) Assignment Bots are unaware if an assignment occurs as this event is not reported back to us by the broker API. The bot will continue to track what it views as the original pre-assignment position. If the bot’s exit conditions are met, it will attempt to close the position. Traders should monitor their broker platform for any positions that carry assignment risk and will need to manage the position from that end if assignment occurs. [Override the positionarrow-up-right](https://optionalpha.com/help/managing-positions) to remove it from the bot's management following an assignment. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/order-handling#tax-lot-selection) Tax Lot Selection A tax lot is a record of a transaction and its tax implications, including the purchase date and the number of shares. Each time you purchase a security, the new position is a distinct and separate tax lot, even if you already owned shares of the same security. A tax lot identification method is the way your broker will determine which tax lots are to be sold when you have a position consisting of multiple purchases made on different dates at differing prices, and you enter a trade to sell only part of the position. Your choice of tax lot ID method can have a significant impact on the amount of taxes you may pay when you sell an asset. circle-info Option Alpha does not pass tax lot information with the specific order to any of the brokers. Bots submit closing order requests for the options symbol used to open the position. Your brokerage account settings will determine tax lot treatment. If you have any questions on tax lot treatment, please reach out to your broker. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/order-handling#option-expiration-protocol) Option Expiration Protocol Positions expiring in-the-money are subject to assignment and/or broker intervention based on the contract type and your account balance. Use this setting to auto-close ITM positions 10 minutes before expiration **OR** auto-override and manually enter the position results later. In your [Settingsarrow-up-right](https://app.optionalpha.com/login?rurl=%2Fsettings) , you can select how you want your bots to handle expiring In-The-Money positions 10 minutes before market close on expiration day: * Calculate estimated P/L from Underlying Price (default) * Close position with a market order * Override position and manually enter results ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F65d64f4540d054c9156f5d8f_OptionExpirationSelections.png&width=768&dpr=3&quality=100&sign=321f1e8a&sv=2) Positions that have been overridden are no longer managed by the bot. It is the trader's sole responsibility to manage their positions and update the ending value with the [Position Editing functionarrow-up-right](https://optionalpha.com/help/managing-positions) and to ensure the bot's performance accurately reflects the outcome of expired positions that were released due to being In-The-Money. We recommend checking with your broker to confirm their expiration day position handling. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/order-handling#trade-importing) Trade Importing The import system checks the position for 1) strategy compatibility 2) symbol compatibility 3) non-zero cost basis 4) non-zero quantity. In the event your position is not being recognized when importing it is likely because it violates one of those requirements. Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Supported Browsers | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/supported-browsers#supported-browsers) Supported Browsers -------------------------------------------------------------------------------------------------------------------------------------- The Option Alpha autotrading platform is browser-based to offer flexibility and accessibility to our users. Instead of requiring a downloaded desktop client, the browser-based platform provides multiple opportunities from both an engineering and user experience perspective. Officially supported browsers for the autotrading platform include: * Google Chrome ([Installarrow-up-right](https://www.google.com/chrome/) ) * Microsoft Edge ([Installarrow-up-right](https://www.microsoft.com/en-us/edge) ) * Apple Safari ([Installarrow-up-right](https://www.apple.com/safari/) ) * Mozilla Firefox ([Installarrow-up-right](https://www.mozilla.org/en-US/firefox/) ) In general, most Chromium-based browsers that run the V8 JavaScript engine needed for the platform are supported. Firefox, for example, runs on a different engine and is not officially supported at this time. These browsers are based on Chrome or Safari and may also work: * Brave Browser ([Installarrow-up-right](https://brave.com/) ) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Automations | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automations#automations) Automations ----------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automations#global-controls) Global Controls Automations adhere to the Bot Settings' strict global controls when opening a new position. There are 3 primary controls: Control Description Allocation Total capital from your trading account available for the bot to open positions Daily Position Limit Number of positions that can be opened by the bot in one day. Max Position Limit Number of positions that can be open at any given time. Before sending an order to your broker, the bot first checks if it is within the bounds of its global limits. If opening a new position violates any of these limits, the bot will alert you with an error. These conditions are checked before the bot works through an automation. If the conditions are satisfied, the bot will continue through the automation and follow your actions. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automations#binary-trees) Binary Trees Decision trees are modeled after one of the most fundamental structures in computer science: binary trees. Mathematically, a binary tree is a connected, undirected, finite graph with no cycles and no vertex of degree greater than three. For most computer science applications, as in the case of the autotrading bots, binary trees are rooted. A special node_, r_, of degree at most two is called the root of the tree. For every node _u_ ≠ _r_ the second node on the path from _u_ to _r_ is called the parent of _u_. Each of the other nodes adjacent to _u_ is called a child of _u_. Most binary trees we are interested in are ordered, so we distinguish between the left child and right child of _u_, i.e., the Yes/No decision path. Binary trees are typically drawn from the root downward, with the root at the top of the drawing and the left and right children respectively given by left (Yes) and right (No) positions in the drawing. **Nodes** Each parent and/or root node of the decision tree is composed of conditional statements, using both logical and relational operators, built out of "decision recipes" curated by the Option Alpha team. [Grouped conditional statementsarrow-up-right](https://optionalpha.com/blog/grouping-and-nesting-decisions-for-more-powerful-automations) work in the same way they would in any modern programming language, discrete math and/or discrete logic, with the exception that decisions in automations do not use negation. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F6232099a393d897547645cc2_Nodes%2520%28tech%2520docs%29.png&width=768&dpr=3&quality=100&sign=2babd97c&sv=2) If a leaf node in a decision tree results in an action to open or close a position, the bot will use your broker's API to submit the order. Input parameters first undergo a translation process; for example, the rate of return in “Opportunity rate of return is greater than 25%” is translated into a real number before the mathematical condition is tested. The translation process into mathematical properties requires the user to input theoretical trade criteria, and that trade criteria has parameters of its own. In this case, the parameter input process is multiple layers deep. Fortunately, these trade inputs are identical to the opening position parameters required for the action of placing a real trade, typically located at the bottommost node of the decision tree. All parameters are evaluated for a binary outcome (true or false). In general, all numeric parameters are used to test a conditional statement for truthfulness. The conditions are described with natural language that represents a mathematical operation, e.g., above or below implies greater than (>) or less than (<) in “MSFT price is above/below 100.” The decision tree “decisions” and their parameters are grouped into four main categories: stock-based, opportunity-based, indicator-based, and position-based. **Negation** Decision nodes can also be [negated by adding a NOT propertyarrow-up-right](https://optionalpha.com/blog/edit-automation-paths-with-negated-decisions) in front of the decision logic. This allows the user to negate particular logic and more easily force the flow of a binary tree down the No path. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F6234993099bc9efe6c1be473_Negation%2520Tech%2520Docs.png&width=768&dpr=3&quality=100&sign=80b476d0&sv=2) #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automations#automation-types) Automation Types **Scanners & Monitors** [Scanner and Monitor automationarrow-up-right](https://optionalpha.com/help/automation-basics) categories are simply logical groupings for the abstract automation type. Automations in the Scanner category are intended for the searching and opening of opportunities, while automations in the Monitor category are intended for the management and closing of open positions. There is no functional difference between the automations in either category. If required by the user, a Scanner automation can close a position or a Monitor automation can open one. In this sense, the Scanner/Monitor categorization is a convenience. Scanners will not run once a [position limitarrow-up-right](https://optionalpha.com/docs/troubleshooting) is met. However, when using a monitor to open a position, if that position violates the global position limit settings, an error safeguard is in place and will throw an error for violating the set limit. circle-info Scanners are designed to be used as the primary automation to open positions because of their strict adherence to the position limit settings. **Events** Events offer more control over automation execution than generic intervals. Users can create events to fire on a specific date, at a specific time, at this very moment, when something happens inside the bot, and everything in between. circle-info Events are established and executed in Eastern Time. When creating events, you are creating the event based on Eastern Time which may cause a difference in current or next-day interpretation from your browser's time zone. **Scheduled** [Scheduled eventsarrow-up-right](https://optionalpha.com/help/automation-scheduling) are automations that run on a schedule, either once or in a repeating fashion. Users can choose to schedule one highly specific event, such as May 12th, 2021 at 9:45 AM Eastern, or on an arbitrary repeating schedule - e.g., the first of every month, every Mon/Wed/Fri, every third Friday, etc. Holidays are accounted for in scheduled events. A user will have the option to run an automation the day before a holiday, the day after a holiday, or skip the holiday altogether. Selection can be made on the "Schedule" tab of an automation event. circle-info A UTC offset is employed for all Scheduled events. This means that when creating an automation to run 'next day' you must be before UTC 00:00 in order for the event to run the next market day. For example: 7:00pm EST or 8:00pm EDT. **Unscheduled** There are 2 types of unscheduled events: resultant events and button clicks. Resultant events will fire as a result of another event occurring, such as the Opening or Closing of a position. When any position of a particular type is opened or closed, the user can choose to execute a separate automation immediately afterward. Button clicks events are fired as a result of pressing a button the user adds to his or her dashboard. One button click results in one execution of an automation. These can be executed at any time during open market opens. Last updated 2 months ago Was this helpful? * [Automations](https://docs.optionalpha.com/technical-documentation/platform/automations#automations) * [Global Controls](https://docs.optionalpha.com/technical-documentation/platform/automations#global-controls) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Data Feeds | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/data-feeds#data-feeds) Data Feeds -------------------------------------------------------------------------------------------------------------- Option Alpha streams real-time consolidated equity and options data. Our data feeds feature a 99.98% uptime and are relied upon by some of the world's leading financial institutions. Consolidated stock market data is an aggregated reporting of all securities exchanges’ and alternative trading venues’ price and volume data. It is the most relied upon type of market data, providing investors and traders globally with a unified view of U.S. stock market prices and volumes. It also underpins the National Best Bid and Offer (NBBO), which provides investors with a continuous view of the best available displayed buy and sell prices, and through Rule 611 ensures that investors receive the best available displayed prices on their trades, with a few exceptions. Consolidated reporting has been standardized since the 1970s when Congress directed the Securities and Exchange Commission (“the SEC”) to establish a “National Market System” for securities trading. Specifically, data collection, aggregation, and distribution are formalized in the Consolidated Tape Association (CTA) Plan and the Unlisted Trading Privileges (UTP) Plan. These plans are administered by the Consolidated Tape Association and UTP Plan market participants, and they dictate that each exchange is required to send its trade and quote information to the Securities Information Processor, also known as the SIP (of which there are two, one for Tape A/B and one for Tape C). The entire bot ecosystem operates on real-time CTA/UTP data streamed constantly throughout the trading day. circle-info Did you know? The bots are tracking over 150k options contracts per day. Each is updated (at most) every 500ms. That's 300k updates per second, 18 million updates per minute. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/data-feeds#how-it-works) How it Works Option Alpha uses a consolidated CTA/UTP data feed, aggregated from all major exchanges. All option symbols being tracked are NBBO, streamed in real-time, with a max update rate of 500ms (milliseconds). Each symbol, equity or option, is updated at most every 500ms unless the symbol received no updates within that time span (think thinly traded, far out-of-money options). Bot data is aggregated via data capture every time an automation runs. The bot is capturing data at a specific millisecond in time, whereas your broker platform is updating continuously. Therefore, unless you see your broker data at the exact millisecond of the bot data, there is likely to be a mismatch. Furthermore, many brokers have proprietary calculations for some indicators, etc. to "simulate" specific readings during the course of a day. While we may have similar indicators, the calculations may be slightly different. **Real-Time Data** With the exception of the cached values discussed below, all data is streamed constantly to our market data server. These values include pricing information like bid/ask, volume, open interest, greeks, etc. When an automation is executed, either at a scheduled interval or on-demand, the bots will request the most up-to-date values the market server knows about at that moment, down to the millisecond. This data is then used inside of every bot decision or action during that run. **Data Caching** Some unchanging data values are cached pre-market and used throughout the trading day. All daily indicators are cached pre-market based on yesterday's closing price. This allows for an accurate representation of a true N-day indicator. For example, to calculate a 14-day RSI indicator, the last 14 closing prices are fed into the RSI formula. This may deviate slightly from a daily technical indicator you see on a brokerage platform that attempts to simulate real-time indicators by using 13 previous closing prices, plus the last price of the security as the 14th bar in the RSI calculation. The criteria "days until earnings" is also updated only at the beginning of each day and there are no additional updates for half a day passed. #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/data-feeds#ticker-selection) Ticker Selection The list of tradable tickers is a subset of all optionable underlying securities. We applied a heuristic filter for liquidity and volume to produce a set of approximately 350 tickers: minimum equity average 10-day volume of 1,000,000 shares and minimum option open interest of 4,000 contracts over the next two monthly expirations in the delta range of 15 to 60. The minimum share price threshold was set at $5.00/share. From these lists we selected the top tickers from each, going down the lists to a point we felt had a good mix representing a cross-section of industry groups and included tickers we knew were popular with traders. We reviewed the lists and added a small number of tickers ad hoc that narrowly missed our liquidity filters, but we felt should also be included. **Options** For options, we looked at the two upcoming monthly expiration series only - no weekly or quarterly series. We looked for a minimum option open interest of 4,000 contracts over the next two monthly expirations in the delta range of 15 to 60. Over 90% of all contracts trade within this range. The open interest for all strikes in this delta range for the two expirations is then totaled. This is the number we are checking against the 4,000 level to select tickers for options trading. **Equity** For equities, we simply look at daily volume - a minimum equity average 10-day volume of 1,000,000 shares. We also used 10 and 20-day average volume as a Goldilocks reference. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Bot Limitations | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#bot-limitations) Bot Limitations ----------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#account-restrictions) Account Restrictions Any restrictions placed on an account by the brokerage can only be restricted by that brokerage. Restrictions include EM Restrictions (Pattern Day Trader), Good Faith Violation, and Free Riding violation. Please note that all restrictions are imposed by the brokerage, not the Bot Platform, and need to be reconciled with the brokerage. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#margin-calls) Margin Calls Bots have no knowledge of account type. They only know an allocation amount. All [Reg-T requirementsarrow-up-right](https://optionalpha.com/learn/margin-requirements) and [maintenance callsarrow-up-right](https://optionalpha.com/learn/margin) for equity positions bought on margin should be managed through the brokerage platform. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#exceeding-maximum-risk) Exceeding Maximum Risk Bot capital allocation limits are calculated at position entry. Market conditions at position closing may cause increased capital allocations beyond the calculated maximum risk at position entry. If the market is illiquid or bid-ask spreads are wide, bots have the potential to risk more capital at position exit than was allocated at position entry. For example, if there is a wide bid-ask spread for a credit spread position, the ask price to close the spread may exceed the spread’s width. This is not solely a function of the bots. It is common for a credit spread to move against the trader and display P/L numbers beyond their max loss throughout the course of the trade. Therefore, it is best to consider _max risk_ as the maximum risk **at expiration.** As always, you have the ability to manually override positions, SmartPricing settings, exit criteria, and orders at any time. If you manually override a position, the Option Alpha platform no longer communicates with the position, and the position will not count against position limits or capital allocation limits. You may need to re-consider your bot’s capital allocation limit if you manually override positions. More info on risk at expiration can be found under 'Forced Closures' in [Order Handlingarrow-up-right](https://optionalpha.com/help/order-handling) . ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#earnings-changes) Earnings Changes Company earnings dates can fluctuate and change on a regular basis for a variety of reasons. It is also common for the time of release to shift from AM and PM. The trader should remain aware of this at all times if they intended to use bots to trade earnings and manually intervene if necessary. We currently do not provide a solution to differentiate between AM or PM earnings releases. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#ticker-changes) Ticker Changes Occasionally, corporations change their ticker symbol. Ticker symbol changes affect options chains and all identifiers for a security. Bots do not automatically update or change to a newly issued ticker in the event of a ticker change. Traders should be aware of all corporate actions that could cause a ticker change to occur for any of the stocks or ETFs they're trading. Please reference the [OCC websitearrow-up-right](https://infomemo.theocc.com/infomemo/search) to review and maintain up-to-date information on any changes that would affect the symbols used within the bots. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#stock-splits-and-corporate-actions) Stock Splits & Corporate Actions Stock splits, reverse splits, stock dividends, spin-offs, mergers, special dividends, buyouts, and ticker symbol changes create unique situations for autotrading. [Stock splitsarrow-up-right](https://optionalpha.com/learn/stock-split) , [reverse splitsarrow-up-right](https://optionalpha.com/learn/reverse-stock-split) , and stock [dividendsarrow-up-right](https://optionalpha.com/topics/dividends) \* change the number of shares in a position. Stock splits and stock dividends\* increase the number of shares in a position. Reverse splits decrease the number of shares in a position. For example, a two-for-one stock split would double the number of shares outstanding and give every shareholder two shares for every share owned while reducing each share’s value by half. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F889RJOz1k878R8B6O17w%252F66b26ad80157b5794a0f86cc_605cdc1905db417898350415_1016138_Stocksplitreversestocksplit1_032521.png%3Falt%3Dmedia%26token%3D7251ff54-2049-42c1-b818-4a32d4f73a5a&width=768&dpr=3&quality=100&sign=e3c33b2d&sv=2) \*Stock dividends, as opposed to cash dividends, are paid to shareholders in additional shares rather than cash. Spin-offs, mergers, special dividends, and buyouts may impact the cost basis for positions, impact the options chain identifier, define a different deliverable for the options contract, or a combination of those impacts. Bots manage positions based on the quantity and underlying option symbol at the time the position was opened. Changes in the position’s characteristics (such as the number of shares or symbol) after the position was opened are outside the scope of the bot’s management visibility. Upon closing, the bot will attempt to close the entire position as it was opened, so the bot is unaware of symbol or quantity changes and unable to successfully close positions affected by these corporate actions. If your bot is managing a security that announces a stock split, reverse split, stock dividend, spin-off, merger, special dividend, buyout, or ticker symbol change, the appropriate action is to manually override the position. [Manual overridearrow-up-right](https://optionalpha.com/help/managing-positions) enables you to release a position from the bot’s management or manually close a position through your broker’s platform (not in the Option Alpha platform). The position would no longer exist in the Option Alpha platform, so this is a great tool to take back management of a position. To override an open position, choose a position and select “Override” in the Position Details. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F66b26ad80157b5794a0f895b_66b26ad242ccec51382425ec_position-override.png&width=768&dpr=3&quality=100&sign=fa43a5f9&sv=2) Overriding a position disconnects the position from the bot and transfers it to your broker platform for manual management. If you manually override a position, the Option Alpha platform no longer communicates with the position, and the position will not count against position limits or capital allocation limits. circle-info Overriding a position does not automatically close a position. The position remains open in your brokerage account, and you are responsible for the position’s management. The position’s original details are still available. Any actions performed manually after the position has been overridden, such as closing orders and final P/L, are not visible in the bot. If you have a bot that scans for new position opportunities in a security with these corporate actions, you may either turn off the bot or remove scanners with the affected symbol. When automations are off, they no longer run at their scheduled interval. Any open positions inside the bot will remain open but will no longer be managed by the bot. You can turn automations on or off at any time. Remember, [automated does not mean unattendedarrow-up-right](https://optionalpha.com/blog/automated-does-not-mean-unattended) . An essential part of autotrading is to pay careful attention to the tickers you trade so that you are not adversely affected by corporate actions. Last updated 2 months ago Was this helpful? * [Bot Limitations](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#bot-limitations) * [Account Restrictions](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#account-restrictions) * [Margin Calls](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#margin-calls) * [Exceeding Maximum Risk](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#exceeding-maximum-risk) * [Earnings Changes](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#earnings-changes) * [Ticker Changes](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#ticker-changes) * [Stock Splits & Corporate Actions](https://docs.optionalpha.com/technical-documentation/platform/bot-limitations#stock-splits-and-corporate-actions) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Trade Ideas | Option Alpha [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#trade-ideas) Trade Ideas ----------------------------------------------------------------------------------------------------- Trade Ideas helps us find trades with an edge based on expected value (EV) and probabilities. Trade Ideas displays opportunities in the options market in a convenient way to analyze the potential profitability of a position vs the potential risk associated with the position. Trade Ideas ranks spreads for profitability from a subset of all optionable symbols available to trade at Option Alpha (see the full list of Trade Ideas symbols [herearrow-up-right](https://docs.optionalpha.com/platform-1/supported-ticker-symbols) ). The symbols are selected each day based on ranking factors like liquidity, signal quality indicators like overall spread width, and outlier filtering. #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#how-it-works) How it works The Trade Ideas backend scans continuously during market hours (9:35am - 3:55pm) and finds trade ideas in 3 ways: 1. It analyzes the returns of thousands of position setups used by all of us (underlying symbol, leg deltas, days to expiration, etc) and loads the current market data for the top performing position setups and compares them looking for opportunities using Reward/Risk, EV (expected value) and Alpha (EV / Max Loss). 2. It examines every option series expiring in 45 days or less that falls on a Friday and matches up every possible combination of legs at various delta values (.50, .45, .425, .40, .375, .35, .325, .30, .275, .25, .20, .15, .10) looking for opportunities. 3. It examines all current open positions in the platform looking for opportunities. Trade Ideas analyzes all combinations of legs in a given option chain for a given underlying continuously throughout the day. Each combination of legs represents a tradable opportunity that is evaluated for suitability and inclusion in the Trade Ideas list. Every trade analyzed increases the overall count. After ~1 minute a Trade Idea quote is considered stale. It is discarded and the process starts over again, reevaluating all possible combinations. ### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#trade-idea-actions) Trade Idea Actions Option Alpha offers two primary types of Trade Idea Actions: * Multi-Symbol Actions: These actions incorporate a built-in symbol loop, allowing you to search for credit or debit spreads across multiple symbols and strategies. * Find Credit Spread * Find Debit Spread * Single Symbol and Strategy Actions: These actions are specific to a particular symbol and trading strategy, providing focused trade discovery. Actions are available for all strategies except Long Equity. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F7DzMyZY4vuA5a6sQTXKK%252Fimage.png%3Falt%3Dmedia%26token%3Da2ac390d-0802-4984-8236-2d7ff2d192fb&width=768&dpr=3&quality=100&sign=3d2003b1&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#ev-expected-value) EV (Expected Value) EV is a weighted average of all possible outcomes of a trade that serves as a powerful tool for decision-making and risk assessment. EV represents the expected average $ profit per contact of a trade if you were to make that trade consistently over a long period of time. Similar to a casino's house edge, the more you make trades with a positive EV, the more likely you are to be profitable over time. To ensure we have the most accurate EV possible, we calculate the probability and associated payoff **for every profit/loss scenario between the strike prices** in $0.01 increments**.** [**Learn how we calculate EV and Alpha**arrow-up-right](https://docs.optionalpha.com/calculations/probability/understanding-alpha-and-expected-value) #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#alpha) Alpha Alpha represents the expected average % return on risk per trade if you were to make that trade consistently over a long period of time. Many times higher EV also means higher $ risk making it difficult to compare multiple positions using EV alone without additional math. Alpha solves this by normalizing EV into a return on risk % which can be used to compare the expected outcomes of positions with different risk profiles._\\_ _Alpha = EV / Max Loss_ > _‍_For example, #1 position with $5 EV and $50 max loss vs #2 position with EV $25 and $250 max loss. Is #2 with $25 EV better? Both are equal since you can open quantity 5 of #1 to get the same $25 EV with the same $250 at risk. Alpha normalizes both trades into the same value ($5 / $50 = 10%) and ($25 / $250 = 10%) for sorting and comparison. #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#reward-risk) Reward/Risk % Measures the potential return of an investment against its potential loss. Typically, the higher the reward/risk, the lower probability of max profit. _Reward/Risk % = Max Profit / Max Loss_ #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#filter-all-trade-ideas) Filter all Trade Ideas You can easily organize millions of trade ideas with a few key filters. Select one or more filters to focus your search: * **Watchlist** - Focus on your favorite tickers only. You can add and remove tickers in your Watchlist at any time. * **Symbols** - Include or exclude symbols to customize your search to specific tickers. * **Strategy type** - Filter for bullish short put spreads, bearish short call spreads, and neutral iron condors. * **Symbol type** - Filter for ETFs only. The default setting displays all stocks and ETFs available for autotrading. * **High IV** - Select the High IV filter to see symbols with an IV Rank above 50. * **Days until expiration** - Refine your search for multiple target DTE timeframes. * **Avoid earnings** - Automatically filter any trade to avoid or target earnings. View Trade Ideas for tickers that have upcoming earnings. "Avoid earnings" will filter any positions that have an earnings announcement between today and position expiration to minimize risk exposure. Example: TSLA reports earnings in 9 days. Positions with more than 9 days to expiration will have an earnings announcement while holding the position (more risk). Positions with less than 9 days do not cross an earnings announcement, so they are displayed. * **Probabilities** - Filter trades using their probability of profit (POP), probability of max profit (PMP), and probability of max loss (PML). Select from one or more percentile ranges in each column. #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#sort-remaining-ideas) Sort remaining ideas You can sort and rank Trade Ideas for each column to find potential opportunities based on different preferences. All columns can be sorted by reverse order (highest to lowest or lowest to highest). Note that all data is updated every minute. Pricing and probabilities can change rapidly. * **Position** - You can always click on a ticker to see more information about the ticker symbol. * **Leg/Delta** - See the strike price and live delta of the trading opportunity. * **DTE** - Sort trades by their days until expiration. Hover your mouse over the DTE to see the position's expiration date. * **Max profit** - To know how much you can make on a trade, sort trades by the highest potential profit. Max profit represents the original credit received and is based on the underlying symbol expiring out-of-the-money. * **Max loss** - If knowing how much you can lose on a trade is more important, sort trades by their max loss potential. Max loss represents the spread width minus the original credit received. All probabilities are based on the underlying's price at expiration. * **Reward/Risk** - The reward/risk shows you your profit potential relative to the max loss. Reward/risk is calculated by dividing the max profit by the max loss. For example, a $6 wide credit spread with a $150 max profit and a $450 max loss has a reward/risk of 33%. The trade is risking $450 to make $150. * **Probability of profit (POP)** - Probability of profit is the % chance the trade will make money. The probability of profit is automatically calculated based on the trade's break-even price(s). Probabilities above 50% are shaded green and probabilities below 50% are shaded red. Probabilities are calculated at trade entry assuming the position is held until expiration.**‍** * **Probability of max profit (PMP)** - Probability of max profit is the % chance the trade will realize the full profit. The probability of max profit calculates the chance that all options will expire out-of-the-money. Probabilities are calculated at trade entry assuming the position is held until expiration.**‍** * **Probability of max loss (PML)** - Probability of max loss is the % chance the trade realizes a full loss. The probability of max loss calculates the chance that a spread will expire in-the-money. Probabilities are calculated at trade entry assuming the position is held until expiration.**‍** * **Alpha** - A proprietary calculation to help rank opportunities. We continue to monitor and tweak the calculation and may share details once we have a final formula.**‍** * **IV Rank** - Sort all ideas by IV Rank. Quickly and easily find symbols with high or low IV Rank.**‍** * **Earnings** - Rank trades by when earnings are to be announced next. Easily compare DTE to the next earnings date. Days until the earnings announcement is shaded red. Hover your mouse over the red box to see how long after earnings the position expires.**‍** * **Traders** - This shows how many Option Alpha traders are currently trading that particular position. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FfTf2XjXY08HHrSC1Ie2G%252Fimage.png%3Falt%3Dmedia%26token%3D7df841fd-429c-44bd-9be1-ed98331fe7f0&width=768&dpr=3&quality=100&sign=eb72ec64&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#select-a-position-to-trade) Select a position to trade Select your position to see the trade's details. The New Position screen displays all your trade's information, including the symbol, strategy type, expiration, and option legs. You can always edit any of the variables on this page. Note that changing the inputs will alter pricing and probabilities. All new information is immediately displayed using real-time live market data. #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#confirm-order-details-and-smartpricing) Confirm Order Details and SmartPricing Adjust your contract quantity, set your Final Price, and choose your SmartPricing setting. The Final Price is the price for the final order placed by SmartPricing. It is the minimum price when selling or the maximum price when buying. The default price displayed is 100% of the bid-ask spread. You can select from five SmartPricing settings: * **Normal** - tries up to 4 prices, 10 seconds each. * **Fast** - tries up to 3 prices, 5 seconds each. * **Patient** - tries up to 5 prices, 20 seconds each. * **Off** - turn off SmartPricing and submit a single limit order. * **Market** - send a Market Order. The final order is automatically canceled after two minutes if it is not filled. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fk7TQPhKmFmnApLrtkpBP%252Fimage.png%3Falt%3Dmedia%26token%3D44471ca3-75bb-4bc6-ba00-d4f39d954ec1&width=768&dpr=3&quality=100&sign=1c192403&sv=2) #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#select-a-bot) Select a bot All positions must be assigned to a bot. You can select an existing bot or create a new bot by clicking the '+' icon. Choose a paper trading bot or a live bot connected to your broker. Live bots will send an order to your broker to execute the trade in your account immediately after clicking 'Place Trade.' #### [hashtag](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#exit-options) Exit Options Pre-set your position's management with 1-minute Exit Options. Define your profit target, stop loss, and expiration/earnings filters. Trade Ideas is a great tool for options traders who want a better way of finding trading ideas without spending hours on researching trades. It gives you timely position-level data to make informed decisions about your trades without all the guesswork. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FWnjc8FremSK1nUZi3f8I%252Fimage.png%3Falt%3Dmedia%26token%3D3dc40d50-0194-4465-a0d6-cdb15392ed2f&width=768&dpr=3&quality=100&sign=bd988b01&sv=2) circle-info We have published multiple [Research Insights blogsarrow-up-right](https://optionalpha.com/category/research-insights) to analyze how pre-trade EV and Alpha values compare to realized P/L results using Trade Ideas positions. Last updated 1 month ago Was this helpful? * [Trade Ideas](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#trade-ideas) * [Trade Idea Actions](https://docs.optionalpha.com/tools/finding-trades/trade-ideas#trade-idea-actions) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Automation Behavior | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#automation-behavior) Automation Behavior ----------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#synchronous-execution) Synchronous Execution Automations execute in an adjustable synchronous order, meaning automations run in the order specified by the user. Automations following in sequence will not wait for order completion but rather will wait for a callback and proceed to the next automation. This means 5 scanners with 2-minute limit order will not hold up execution. The order is configured by selecting the arrows to the right of an automation. The automation on top runs first and the bottom automation runs last. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FsAKKFQcFeuBLFuz4bGiq%252F66d72ca07b613eae55db74f2_63e3cfbf7579512dc8525024_Automation%252520Ordering.png%3Falt%3Dmedia%26token%3D912065c9-6dd7-4c17-a22e-d8dc5798bdd1&width=768&dpr=3&quality=100&sign=d0621efe&sv=2) It is important to note that [monitor automationsarrow-up-right](https://optionalpha.com/help/automation-basics) will run first to process any closing orders ahead of possible new opening orders from a scanner. This is designed to alleviate concurrency issues when opening and closing positions on the same scan interval. > Scanner and monitor automations are queued and processed synchronously. Execution order is never guaranteed. A redundant position check occurs prior to each execution. In the event Scanner 2 opens a position prior to Scanner 1, and has reached a global [position limitarrow-up-right](https://optionalpha.com/help/safeguards) , a warning will alert the user that the maximum position count has been reached. This can happen when Scanner 1 has an execution method that is slower than Scanner 2, and Scanner 2 fills an order prior to Scanner 1. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FOvqyiT28ePMPSxHQANtN%252F66d72ca07b613eae55db74ef_62320a0a2b1bdbb2685633b3_spaces252Fuploads252Fredundant2520check.png%3Falt%3Dmedia%26token%3Dd99d84a9-ac4f-4870-a754-dcd2a81e2f2d&width=768&dpr=3&quality=100&sign=dbfff9c1&sv=2) circle-info The overall order of automations are: Exit Options, Scheduled Events, Monitors and Scanners. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#loops) Loops The platform employs two different loop types -- [Positionarrow-up-right](https://optionalpha.com/help/loops) and [Symbolarrow-up-right](https://optionalpha.com/help/loops) . Loops give you the ability to cycle through, or loop, a group of positions or symbols to check for other logic conditions down your decision tree. Although scanner automation groups and monitor automation groups operate in a synchronous manner, loops inside them do not, and modifying this behavior would result in excessively long execution time. When a loop executes, the full logic of the decision tree is run for each symbol sequentially one after another. When looping through Positions, the processing order is always Oldest to Newest. However, be aware that we reserve the right to change the way the cache system works and the behavior of how it returns the list of positions. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#position-allocation-and-loops) Position Allocation & Loops When using a multi-symbol loop with a percentage-based allocation for each trade, it is not guaranteed that the % of available capital is distributed in the same order as the symbols inside of the loop. Capital use is done by first figuring out how much there is total, then how much can be used based on the desired per position amount, and finally how many contracts/shares can fit into that amount based on margin requirements. **Example:** Using $10k Total Allocation, 45% Net Liquid per position, with SPY, QQQ, and TLT in a Symbol Loop. If you run the SPY, QQQ, TLT example test 100 times in a test environment, it will almost certainly use 45% SPY, 45% QQQ, and ~10% TLT, 100 times out of 100, because that's the order in which they're initially called and no one is competing for processor time. But the moment you run the same loop in an active environment with hundreds of other bots executed by the same process, and at the same time pulling and waiting on all kinds of asynchronous data (e.g., opportunity decisions, indicators, etc.) from other processes, there is no guarantee which symbol will end up with the ~10%. This means whichever symbol makes it to the order book first will get first dibs on decrementing the capital pool for itself. Nothing is based on fill or execution because that hasn't happened yet. The only certainty is whoever gets to the capital pool first and begins the process of opening a position gets to synchronously decrement the pool first with its pending draw value. That is how we ensure the bot stays under $10k at all times. Poorly constructed logic will have the potential to yield unexpected results and it is encouraged to utilize other decisions to avoid common errors and warnings when utilizing loops. circle-info If you attempt to open multiple positions using a percentage-based allocation amount greater than 50%, the subsequent position contract or share amount will be reduced intentionally to avoid an overallocation of more than 100% of bot capital. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#id-1-minute-exit-options) 1-Minute Exit Options Any position can be assigned [1-minute Exit Optionsarrow-up-right](https://optionalpha.com/help/exit-options) through an automation's Open Position action, its Update Position Exit Options action or the Manual Trading interface. The user-defined parameters are checked every one market minute between 9:40 AM and 3:59 PM Eastern. Safeguards have been established to ensure that your profit or stop loss levels are set to the worst possible fill based on the direction of the spread at the point the order is initiated (e.g., the bid price if selling or the ask price if buying). This can result in an order being canceled if unfilled but ensures that high exit efficiency is maintained. The default exit method for Exit Options is SmartPricing set to normal and 100% of the Bid/Ask spread. It is possible that your exit fill may be within a 1% tolerance of your specified stop or target value because of the ask price's value at the point SmartPricing begins. Additionally, because SmartPricing will begin near the bid price, for example, exits can be higher than your specified target when trading a liquid underlying and contract. circle-info In high volatility times it is possible the price of an option contract can change rapidly and surpass your Stop level. Bots will actively prevent an action from taking place when an identical action is already in process to avoid overlapping with other automations. The event sequence is set to run Exit Options before other automations in the following order: Exit Options, Scheduled Events, Monitors, and Scanners ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#intervals) Intervals Every Scanner and Monitor has a default scanning interval of 15 minutes. This means every 15 minutes—beginning approximately 15 minutes after the market opens, and ending at 15 minutes before the market close—automation(s) will scan for the criteria specified in the automation. If criteria are met, your bot will take an action, whether that is to open a trade, close a trade, or prompt you to take further action. circle-info You can also self-select 5-minute and 1-minute scans. Scan speeds are set at the bot-level; each bot defaults to 15 minutes unless you select a different speed. All user automations are pushed into a distributed work queue and executed in parallel by worker processes. There is no guarantee an automation will run exactly on the 15-minute marks of every hour. If a price, indicator, etc. exceeds a threshold between intervals, the bot does not know about it. The one major exception is tracking Smart Stops, where the position gain and high gain are tracked every minute. Regardless, even if a bot is logging information or position data between intervals, it will not act upon it until automation execution at the next interval. In _most_ cases, a bot will pull fresh data for all relevant decisions in every automation during execution. In other words, every 15 minutes, all relevant securities or options symbols will be quoted with the most up-to-date (usually sub-second) data. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#expiration-day) Expiration Day The last bot automation interval takes place at 3:45 Eastern time (15 minutes before market close). You can also use an automation trigger to run 10 minutes before the close. If it is [expiration dayarrow-up-right](https://optionalpha.com/help/order-handling) and any leg of an options position is in-the-money (ITM), the bots will attempt to close the entire position. Bots do not support assignment and are unaware of assignment, which can still occur for out-of-the-money positions before or after the market closes.. Last updated 2 months ago Was this helpful? * [Automation Behavior](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#automation-behavior) * [Synchronous Execution](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#synchronous-execution) * [Loops](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#loops) * [Position Allocation & Loops](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#position-allocation-and-loops) * [1-Minute Exit Options](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#id-1-minute-exit-options) * [Intervals](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#intervals) * [Expiration Day](https://docs.optionalpha.com/technical-documentation/platform/automation-behavior#expiration-day) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Options Expiration Protocol | Option Alpha #### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/options-expiration-protocol#managing-expiring-itm-positions-in-option-alpha) Managing Expiring ITM Positions in Option Alpha Option Alpha uses protocols for expiring positions based on their [moneynessarrow-up-right](https://optionalpha.com/learn/options-moneyness) . circle-info You should communicate with your broker about their guidelines for handling positions on expiration day. Positions expiring in-the-money are subject to assignment and/or broker intervention based on the contract type and your account balance. By default, the bot will calculate the estimated P/L from the underlying's closing price at the end of expiration day. The bot WILL NOT send an order to close the position. Live positions expiring in-the-money are subject to assignment/exercise by your broker. In your [Settingsarrow-up-right](https://app.optionalpha.com/login?rurl=%2Fsettings) , you can select how you want your bots to handle expiring In-the-Money positions at expiration: * Calculate estimated P/L from underlying close price (**Default**) * Close position with a market order * Override position and manually enter results ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FPSN35g6XjhQHa1VyhppJ%252FCleanShot%25202025-10-30%2520at%252014.09.24.png%3Falt%3Dmedia%26token%3Da084d4f4-f8b6-4053-87d2-49b9e624cb20&width=768&dpr=3&quality=100&sign=a9379030&sv=2) Positions that have been overridden are no longer managed by the bot. It is the trader's sole responsibility to manage their positions and update the ending value. We recommend checking with your broker to confirm their expiration day position handling. Option Alpha does not close option positions that are Out-of-the-Money (OTM) on expiration day. Contracts that expire OTM are worthless and you will realize the full loss for long positions or the full profit for short positions. Option Alpha last checks a position's moneyness 10 minutes before the market closes. Note that options are eligible for [assignmentarrow-up-right](https://optionalpha.com/learn/option-assignment) after-hours. ![Expired positions](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F641894156f6a2a830779e263_yBUiwweThhThnlv0jOyog4fkx0_kntOIvYs1XinPimZHBBttE5SmQfTNpNjVuQbxUWBxrU6Ab-e_QiNx94zf-YjnhIWCYcgvYcZUvBhY0CUK_Sq2jdQAsT8qrlds5MMmkyK9zo3paxYJ5Z7I_h2Qu_I.png&width=768&dpr=3&quality=100&sign=d52380a4&sv=2) It is the trader's sole responsibility to update the ending value of their position using the Position Editing function and to ensure the bot's performance accurately reflects the outcome of expired positions released due to being In-the-Money. Generally, early closure rules depend on whether the account has the funds to cover an assignment, whether the position is ITM, OTM, or ATM, and the account type where the expiring position is held. Check with your broker for more information. If you want to take assignment of an expiring position, you must manually override the position to transfer management from the bot. If you select 'Override position and manually enter results' in your [Settingsarrow-up-right](https://app.optionalpha.com/login?rurl=%2Fsettings) , the bot will automatically override the position at 3:50 pm EST. ![Override position](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64189415f143773cd6828777_FrYzuXBYWyNUHvUo60FMfajMqYsbS4q1856qhbBzU7NyX0gAp6k82I-N4v3qa4UZJOiSeJKGcz-LGIJ47rgf7RMccZBootvaxr3R60Kue0S32iLI7LzH-AbkKDMs9Mbq3g1islj3uK8PCg8eV_1eQ0E.png&width=768&dpr=3&quality=100&sign=d3586b90&sv=2) You can see positions you override under the bot's 'Closed Positions.' ![Overridden position](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64189415ebfd2010b0c468cf_T2BkM6cuQFmsavA2vU9SqQD_lNUT77CdYoiHl0cvzzb8jt35RHmpjprDr2VQM-ECDJCe_n2miDQQIcROVd0Hj5TwqN0AJvnPJDQ3BRP3ly8wxt0Dy-05zXIj7Fa2osAdavSXK5c1kBtJUIhPhUwSw30.png&width=768&dpr=3&quality=100&sign=7d511de&sv=2) It is important you understand the options expiration protocol of both Option Alpha and your broker and take the necessary steps to avoid or accept assignment of options positions.[‍arrow-up-right](https://optionalpha.com/blog/assigned-position-management) circle-info Bots do not support options assignment. Bots are unaware when an assignment occurs in your brokerage account. The autotrading platform tracks and manages positions independent of the broker. You must use the broker platform to manage assigned shares and any remaining option legs. The autotrading platform submits a buy-to-close (BTC) or sell-to-close (STC) order and lets the broker perform reconciliation if the order is valid. The broker reconciles a buy-to-close or sell-to-close order against existing positions. Buy-to-close (BTC) or sell-to-close (STC) orders do not automatically reverse if the position does not exist (go long or short instead). Instead, the orders will generate an error message. If the autotrading platform attempts to close a position that has been assigned, the bot will receive an error message for the closing order, and no action will be taken. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Decision Calculations | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#decision-calculations) Decision Calculations --------------------------------------------------------------------------------------------------------------------------------------------------- #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#rate-of-return) **Rate of Return Calculation** Rate of return is always calculated as max profit / max loss for all position types, where max loss is defined as the theoretical risk less any premium received. Copy Assume a credit spread where strike width = $2.00 and credit = $0.50, then Max profit = 0.5 Max risk = 2.00 - 0.5 = 1.5 Rate of return = 0.5 / 1.5 = 33% #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#percent-premium) % Premium Calculation The formula for % premium increase/decreased is: change\_percent\=changeprice\_openchange\\\_{percent} = \\frac {change} {price\\\_{open}}change\_percent\=price\_openchange​ wherechange\_percentchange\\\_{percent}change\_percentis equal to the net `change` in position value divided by the `openPrice` of the position, defined as: Copy let {openPrice, markClose} = position; let change = markClose - openPrice; let changePct = change / openPrice * 100; The definition for `markClose` calculations of individual position types can be found [herearrow-up-right](https://docs.optionalpha.com/calculations/broken-reference) . #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#return-calculation) **Return % Calculation** Percentage return measures the percentage gain or loss on an asset or portfolio relative to its starting value. In the example above, the investor earned a $1,250 total dollar return on a $5,000 investment. To calculate the total return in percentage, simply divide the total gains ($1,250) by the starting value ($5,000) = 25%. ![Percentage return formula](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F67056a07e53311e0da1d60e0_60d3bc7d4410c25409e7ef89_1091622_PercentageReturn_062321.jpeg&width=768&dpr=3&quality=100&sign=4cfdc1ad&sv=2) Total percent return can be a better indicator of return on investment because it shows growth relative to the initial investment. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#total-p-l) Total P/L The sum of open and closed P/L. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#total-p-l-1) Total P/L % The total P/L divided by the bot allocation. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#day-p-l) Day P/L The current intraday total P/L minus the previous days closing P/L value or $0 if no previous day. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#day-p-l-1) Day P/L % The day P/L divided by the previous day's closing net liquid or bot allocation if no previous day. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#closed-p-l) Closed P/L The bot's P/L for all closed positions. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-calculations#win-rate) Win Rate The bot's percentage of winning trades. Win Rate (win%) = number of wins divided by total number of closed trades. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon Copy let {priceChange, openPrice} = position; let returnPct = priceChange && openPrice ? priceChange / openPrice : 0; //where priceChange = position.currentPrice - position.openPrice; sun-brightdesktopmoon --- # Autotrading Best Practices | Option Alpha Following the best practices discussed in this article, such as paper trading, understanding live fills, thorough bot comprehension, organization, and preparation, can significantly improve your chances of successful autotrading. By adopting these practices and remaining disciplined in your approach, you can navigate the markets more confidently and effectively with Option Alpha's autotrading platform. Here are the "Do’s and Don’ts" for successful autotrading at Option Alpha: [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#dos) Do’s ----------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#think-through-your-bots-logic-from-entry-to-exit) **Think through your bot's logic from entry to exit** **‍**The main challenge in automated trading is thoroughly considering the entire trading process. Traditionally, traders could make changes dynamically; but with autotrading, the entire process must be planned from entry to exit. Automation involves creating a structured plan for the bot, essentially turning your trade strategy into decision-based instructions. Before building your bot, you should meticulously design your trading strategy, map out each decision point, and outline the trade process. You can then translate this strategy into an automation using if/then statements. Key factors to consider include asset type, capital allocation, trading frequency, market stance, evaluation criteria, indicators, and exit plans. Think about the big picture of the bot and narrow down your objective: * Do you want to trade stocks, ETFs, or options? * How much of your total capital do you want to allocate? * How many positions do you want to enter daily? Total? * Are you bullish, bearish, or neutral on the underlying asset? * What market criteria do you want to evaluate? * What kind of indicators do you use? * When and why do you plan to exit the trade? Once the framework is ready, you can use the automation editor to execute the bot's actions. It's best to test automations and paper trade the bot before using real funds to ensure it meets your expectations. Ultimately, as a trader, you're responsible for designing the trade plan and instructing the bot accordingly. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#paper-trade-before-going-live) **Paper trade before going live** Before deploying your bots in live trading, it is crucial to test your strategies in a risk-free environment using the in-app paper trading account. Paper trading allows you to simulate real market conditions that can help observe and refine your strategy. We suggest paper trading for a minimum of 30-60 days before risking any live capital. Paper trading your bot allows you to answer key questions about the bot's functionality: * Did the framework you created do what you expected? * Did the bot enter the positions you anticipated? * Did your closing actions exit positions according to your plan? ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#test-the-same-way-you-expect-to-go-live) **Test the same way you expect to go live** If you are starting out with $10K of capital and will begin trading with one contract, then you should calibrate your paper bots to use the same allocation and position size. This ensures that your expectations and behavior will not vary drastically when shifting to live trading.**‍** ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#adjust-live-pricing-expectations) **Adjust live pricing expectations** It's important to recognize that live fills are not guaranteed and that the symbols and strategy you choose to trade can affect the difference in results between live and paper trading. The favorable fill prices provided by paper trading engines may differ from live market executions. Be prepared for slight variations and adjust your expectations accordingly. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#get-comfortable-with-how-the-bot-works) **Get comfortable with how the bot works** **‍**Before going live with your bot, you should be comfortable with the logic and actions you are using. Familiarize yourself with the indicators, triggers, and logic employed by your bot. Read the [bot logsarrow-up-right](https://optionalpha.com/help/bot-logs) to fully understand when and why trades are opening or closing. Observing your bot’s activity will give you a complete understanding of how it operates and will enable you to make informed decisions to optimize your bot's performance effectively.**‍** ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#utilize-bot-notes-and-titling) **Utilize bot notes and titling** **‍**Stay organized by utilizing the bot notes section to document your observations and any adjustments made to the bot's settings. Additionally, give your bots unique icons and descriptive titles to identify their purposes and strategies easily. **‍** ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#familiarize-yourself-with-broker-rejection-errors) **Familiarize yourself with broker rejection errors** **‍**Prepare for potential broker rejection errors by understanding their causes and implications. Always utilize the Entry and Position criteria and the Pattern Day Trading (PDT) check inside Exit Options to mitigate some common errors and issues. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#understand-option-expiration-and-assignment) **Understand option expiration & assignment** Bots have certain limitations you should be aware of. For example, bots do not know if an option is assigned. We suggest you have a detailed understanding of the option expiration protocol and adjust your account's position management settings accordingly. Typically, in-the-money options have a higher chance on or near expiration day. Expiring trades, specifically short-term and 0DTE positions, should be managed accordingly. Option Alpha's Exit Options have safeguards for exiting position's on expiration day to manage assignment risk. Remember, assignment is random and unpredictable. ![Managing options positions on expiration day](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F6430365a8fd825548068317b_Expiration%2520day%2520exit%2520options.png&width=768&dpr=3&quality=100&sign=9bdf9d3e&sv=2) As always, we recommend talking to your broker about specific position handling near expiration. Some brokers may choose to automatically close positions prior to the end of the trading day. Also note that out-of-the-money options can still be exercised after-hours. Learn more about [options settlementarrow-up-right](https://optionalpha.com/topics/options-settlement) . ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#use-a-guard-to-protect-trailing-stops-from-wide-bid-ask-spreads) **Use a Guard to Protect Trailing Stops from Wide Bid/Ask Spreads** Volatile markets can lead to erratic pricing and wide bid/ask spreads. You can use a bid/ask guard to automatically disable Exit Options and ignore position returns until pricing becomes more rational. If the bid/ask spread is larger than your acceptable price, Exit Options won’t send an order. It also won’t record the position’s high or low. [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#donts) Don’ts**‍** -------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#blindly-clone-bots-from-the-community-and-run-live) **Blindly clone bots from the community and run live** **‍**It's tempting to want to trade live as soon as possible and especially after encountering bots made by others in the community that show signs of success. However, we suggest you always paper trade and understand all of the bot's components before risking your own capital; regardless of the author or shared results. Bots are simply decision logic that has been combined into a set of instructions to form a strategy. The name, the author, and the recent results are all secondary components to this underlying truth. You, as the trader, need to determine if that strategy is right for you, and we encourage everyone to interview bots and make sure they’re worthy of trading your hard-earned cash.**‍** ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#stack-multiple-open-position-actions) **Stack multiple Open Position actions** **‍**Running multiple open position actions, one after another, can lead to undesirable outcomes. Because there are no guarantees either order will be filled, it's important to utilize an event trigger when scheduling automations for your secondary entries and ensure that positions are opening in a more orderly sequence.**‍** ![Stacking open position actions](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64dfc81f37bfbfec1e62f0c5_Stacking%2520open%2520position%2520actions.png&width=768&dpr=3&quality=100&sign=238ee8a8&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#simultaneously-use-open-and-close-actions-in-the-same-automation) **Simultaneously use Open and Close actions in the same automation** **‍**Similar to stacking multiple open actions, you should avoid combining Open and Closing actions in the same automation path. When an order is sent to the broker for execution, the bot state changes, and the order is essentially detached temporarily from the bot until the order is returned with updated details. When combining Open and Closing actions, you will run into situations where the ‘Position’ is unknown to the bot and an error will be generated.**‍** ![Stacking open and close position actions](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64dfc861a9627bddf0ce469f_Stacking%2520open%2520and%2520close%2520position%2520actions.png&width=768&dpr=3&quality=100&sign=abe9421f&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#create-duplicate-symbol-or-position-inputs) **Create duplicate ‘Symbol’ or ‘Position’ inputs** **‍**Instead, use the default symbol or position inputs supplied by the Loop. If you start the automation with a Loop, all subsequent decisions that require referencing a symbol or position will be linked automatically to that Loop and will display the infinity icon vs. the chain link.**‍** ![Connecting loops to decision actions](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64dfc8bcf550378982ca9b2c_Connected%2520loops.png&width=768&dpr=3&quality=100&sign=f12a5605&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#use-more-than-one-loop) **Use more than one Loop** **‍**It's best to start each automation with a symbol Loop in scanner automations or position loops in monitor automations. Adding additional loops at different sections of the automation can lead to mixed-up inputs and generate errors. ![Using multiple loops in an automation](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64dfc8b28c6649c4085c512b_Multiple%2520loops.png&width=768&dpr=3&quality=100&sign=122bfe83&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#trading-the-exact-same-strategy-in-multiple-bots) **‍‍Trading the exact same strategy in multiple bots** **‍**Running multiple instances of the exact same bot when trading live can potentially create issues with your broker. The broker often perceives entry and exits in the same positions are manipulative behavior and will flag your account accordingly. Stick to a single instance for each bot unless there are differences in their trade details. ### [hashtag](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#ignore-your-brokerage-account) Ignore your brokerage account Remember, automated does not mean unattended. We strongly recommend that you continue to check your broker account, positions, and order activity on a regular basis. Bots are not aware of early assignment, so your Option Alpha autotrading account will not reflect any change to positions that did not occur within the platform. We also suggest you speak directly to your broker about their position management and associated fees so you're aware of their procedures. Last updated 23 days ago Was this helpful? * [Do’s](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#dos) * [Think through your bot's logic from entry to exit](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#think-through-your-bots-logic-from-entry-to-exit) * [Paper trade before going live](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#paper-trade-before-going-live) * [Test the same way you expect to go live](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#test-the-same-way-you-expect-to-go-live) * [Adjust live pricing expectations](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#adjust-live-pricing-expectations) * [Get comfortable with how the bot works](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#get-comfortable-with-how-the-bot-works) * [Utilize bot notes and titling](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#utilize-bot-notes-and-titling) * [Familiarize yourself with broker rejection errors](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#familiarize-yourself-with-broker-rejection-errors) * [Understand option expiration & assignment](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#understand-option-expiration-and-assignment) * [Use a Guard to Protect Trailing Stops from Wide Bid/Ask Spreads](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#use-a-guard-to-protect-trailing-stops-from-wide-bid-ask-spreads) * [Don’ts‍](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#donts) * [Blindly clone bots from the community and run live](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#blindly-clone-bots-from-the-community-and-run-live) * [Stack multiple Open Position actions](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#stack-multiple-open-position-actions) * [Simultaneously use Open and Close actions in the same automation](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#simultaneously-use-open-and-close-actions-in-the-same-automation) * [Create duplicate ‘Symbol’ or ‘Position’ inputs](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#create-duplicate-symbol-or-position-inputs) * [Use more than one Loop](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#use-more-than-one-loop) * [‍‍Trading the exact same strategy in multiple bots](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#trading-the-exact-same-strategy-in-multiple-bots) * [Ignore your brokerage account](https://docs.optionalpha.com/technical-documentation/platform/autotrading-best-practices#ignore-your-brokerage-account) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Understanding Alpha and Expected Value | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#understanding-alpha-and-expected-value) Understanding Alpha and Expected Value ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Expected Value (EV) is a fundamental concept in probability theory that provides insight into the outcome or value of a random variable. To put it simply, EV is a weighted average of all possible outcomes. It serves as a powerful tool for decision-making and risk assessment. In options trading, calculating the EV of a trade is useful for evaluating its potential profitability. To accurately calculate the expected value for an options trade, we found it critical to assess the probabilities and associated payoffs not just for a single profit/loss scenario, but for _every profit/loss scenario_. We’re excited to announce that in **Trade Ideas 2.0**, we’ve completely revised the Alpha metric to be based on the true Expected Value of an Opportunity. It is a calculation that no one else in this industry is offering. To understand how and why, let's explore three levels of increasing difficulty for calculating the expected value of a risk-defined options trade, accompanied by mathematical examples for each step. circle-info A model is only as good as its assumptions. For the following examples, we assume all trades are defined-risk, meaning both the maximum profit and loss are known. We also assume there is an efficient function for calculating the probability of the underlying’s price being above or below some price in the future; for this, we will be using the Probability Density Function (PDF) described by Black-Scholes. [Learn more about how Option Alpha calculates probabilities herearrow-up-right](https://optionalpha.com/help/calculating-probability) . ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#calculating-ev-at-expiration-for-max-profit-or-loss) Calculating EV at Expiration for Max Profit or Loss The simplest and most often cited method of calculating EV is for maximum profit and loss at expiration. This method is often described using hypothetical scenarios like, “Would you play the game?” E.g., if you won $1 for every coin flip that landed heads and lost $2 for every coin flip that landed tails, would you play the game? #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#simple-betting-games) **Simple Betting** Games The options trading analog is to assume that for every “play” of the game (trade taken to expiration), is it worth it to play assuming you took full profit or full loss? Consider a betting game with a maximum potential profit of $500 and a maximum potential loss of $200. Suppose you estimate the probabilities of reaching the max profit and max loss at expiration to be 40% and 60%, respectively. To calculate simple EV, you multiply each outcome by its probability, P(x), and add them: EV\=(MaxProfit∗P(MaxProfit))+(MaxLoss∗P(MaxLoss))EV=(MaxProfit∗P(MaxProfit))+(MaxLoss∗P(MaxLoss))EV\=(MaxProfit∗P(MaxProfit))+(MaxLoss∗P(MaxLoss)) ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64a603b8c923669dda417a2c_fC77lCBg_kpa0qjFu2COIqNfEONFAQiTHCGmuBw6d7HI9-SzKkh0AMeKzq5jYtcLRfKwo8p89MJ8vh4jScBRz7Y9BGrQ-_K1XSVF2FnE6m8G_Tr_os7JiCH2RWvoUDFXGTkYwLTGAxlIyaCpKV4QPfw.png&width=768&dpr=3&quality=100&sign=3f9dc26e&sv=2) Expected value of a simple betting game with positive outcome Therefore, the expected value of an options trade at expiration, considering only the max profit or max loss scenarios, is $80. The expected value is not always positive, however. More often than not, EV for betting games is negative when there’s a lower percentage chance of winning a lot of money and a higher percentage chance of losing a little money, e.g., playing the lottery. Imagine a lottery game where you bet $2 with a 1% chance of winning $100 and a 99% chance of losing $2. ![Negative EV example](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64a72e39ea269acdbb63ea34_Negative%2520EV%2520Example.png&width=768&dpr=3&quality=100&sign=f90aeb79&sv=2) Expected value of a simple betting game with negative outcome So, over time, you can expect to lose $0.98 every time you play the game. The problem with this calculation, however, is that options trades are not strictly binary outcomes, and the assumptions used here will usually yield an EV of near zero when real market payoffs and probabilities are used. But there is a gray area beyond the short strikes and before the breakevens where some, but not all, profit can be achieved. This can wildly affect the outcome over many occurrences. Example: ![Expected Value Calculation Options Trading](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64a946185b0fb260f936bd39_Expected%2520Value%2520Calculation.png&width=768&dpr=3&quality=100&sign=776efac9&sv=2) Profit/Loss diagram of a defined-risk options trade with partial profit region To illustrate, let’s first consider the simplest case where the third possibility, the “gray area,” results in a fixed payout win, rather than a difficult-to-calculate partial win or loss. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#estimating-expected-value-for-an-average-outcome) Estimating Expected Value for an Average Outcome If EV is just the summation of probabilities multiplied by their outcomes, then it stands to reason that the more probabilities and outcomes known, the more accurate the final value will be. Any time you see options EV quoted or explained in a defined-risk manner where the probabilities sum to 1 while _only_ considering the max profit or loss, you can immediately assume that it’s wrong. At best, it’s a broad estimate or generalization. The probabilities of max profit and loss _can’t_ sum to 1 because there is a very real possibility the underlying asset's price is between the strike prices at expiration. In this case, we need to calculate the partial profit or loss. To address this scenario in an options trade, we can enhance our simple EV calculation by assuming an intermediate payout outcome. This method is commonly employed in some financial software products because it offers a more robust solution while remaining a fast and deterministic calculation for a computer. The profit is determined by the difference between the net credit received and the difference between the strike prices, multiplied by the probability of the underlying price expiring between the strikes. The loss is the difference between the net credit received and the difference between the strike prices, multiplied by the complementary probability. For partial profit/loss, let's first consider the following example of a put credit spread: Short Put: Strike price $55 Long Put: Strike price $50 Premium received: $2.00 Assuming a 70% probability of the stock price staying above $55, a 20% probability of it expiring between $55 and $50, and a 10% probability of it falling below $50, we can calculate the expected value by using a linear approximation for the underlying price within the range between the two strikes. Here's a simple way to represent the partial profit/loss EV: 1\. **Calculate the Range Value:** The difference between the short put strike and the long put strike: $55−$50=$5. 2\. **Calculate the Net Credit Received:** Given as $2.00 in our example. 3\. **Calculate Max Loss:** The max loss is the difference between the range value and the net credit received, i.e., ($5−$2)=−$3 4\. **Calculate Partial Profit or Loss:** The expected value of the partial profit/loss is the midpoint between the max profit and max loss, multiplied by the probability of the partial range: 5\. **Calculate the EV:** EV\=(MaxProfit∗P(MaxProfit))+(Partial∗P(Partial))+(MaxLoss∗P(MaxLoss))EV=(Max Profit∗P(Max Profit))+(Partial∗P(Partial))+(Max Loss∗P(Max Loss))EV\=(MaxProfit∗P(MaxProfit))+(Partial∗P(Partial))+(MaxLoss∗P(MaxLoss)) Therefore, the expected value of this short put spread, accounting for estimated partial profit or loss, is $1.00. This approach offers a reasonable approximation without introducing complexity and can be considered a more balanced estimate of the partial profit range payoff within the given probabilities and constraints. It treats the partial range as a uniform distribution and considers the average of the max profit and max loss to represent this range. Even though this calculation is objectively better than the “simple” method, it’s still just a broad estimate of EV. Since our goal is to be as accurate as possible, we need something better. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#calculating-expected-value-as-a-random-variable) Calculating Expected Value as a Random Variable For Trade Ideas 2.0, we decided to use the most mathematically robust representation of Expected Value that we could. The method we employ and its use in an Alpha metric is, to our knowledge, something not seen anywhere else in the industry. We’re about to dive into some math theory, so buckle up. What we’re trying to accomplish is known as calculating the expected value of a random variable. But there are different methods of solving this problem, and their use is dictated by how the variable is described: continuous or discrete. * Discrete random variables are countably finite, meaning there is an observable number of increments or steps the value of the variable can be. * Continuous random variables are uncountably infinite. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#continuous-random-variables) Continuous Random Variables A continuous random variable encompasses all real values within a specific range or interval. For instance, it could represent the height of a person or the time required for an event to occur. These are considered continuous because a more granular level of measurement resolution can always be achieved, e.g., a person’s height can always be measured to more decimal places. Calculating the expected value for continuous random variables involves finding the integral of the product of the variable and its probability density function (PDF) over its entire range. To determine the expected value, E(X), of a continuous random variable X, the following formula is used: Here, f(x) represents the Probability Density Function (PDF) of X. By integrating the product of x and its probability density across the range, we arrive at the expected value. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#discrete-random-variables) Discrete Random Variables On the other hand, a discrete random variable takes on distinct and specific values. Examples include the number of heads obtained in coin flips or the outcome of a roulette game. In this case, the expected value is calculated by summing the product of _every possible value_ and its corresponding probability. The formula for calculating the expected value, E(X), of a discrete random variable X is: Here, x represents each possible value of X, and P(X=x) denotes the probability of X taking on that specific value. Recall from your college Calculus class that big sigma, ∑, means summation. By summing the product of each possible value and its probability, we determine the expected value. This is basically a more formal definition of what we were doing in the previous examples, all of which happen to have discrete outcomes. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#underlying-price-as-a-discrete-random-variable) Underlying Price as a Discrete Random Variable In options trading, determining EV involves discrete steps due to the incremental nature of potential profits or losses. For example, there are discrete $0.01 steps in the underlying’s price (in most cases) between the upper and lower profit bounds. This means we need to calculate EV based on a discrete random variable, and fortunately, the math to do so is significantly less complicated than continuous variables. The trade-off, and the reason no one else is doing this at scale, is the higher computational power required to do the summation, which can only be solved at best in linear time. In other words, there are no shortcuts; every discrete outcome and its probability must be calculated within the profit range. The wider the strikes, the larger the profit range, and the more possible discrete outcomes. Multiply that process by millions of Trade Ideas and Opportunities and suddenly you have a big data problem. To illustrate what we’re talking about, suppose you establish a put credit spread with a short strike price of $50 and a long strike price of $49. The credit spread involves selling an option with a higher strike price and simultaneously buying an option with a lower strike price. The potential payoff at expiration is determined by the underlying asset's price movement relative to the strike prices, and a maximum loss is incurred if the underlying is below the long strike price at expiration. Partial profit (or less than max loss), however, can occur anywhere between the strikes. To calculate the expected value, we must determine the probabilities and payoffs for each $0.01 discrete increment between $49 and $50. Let's assume the following probabilities are known: * Probability of stock price above $50 (max profit): P(X>$50) * Probability of stock price below $49 (max loss): P(X<$49) * Probability of stock price at each $0.01 increment between $49 and $50 (partial profit): Next, we need to calculate the payout for each outcome. Assume there is a function Z(x) that describes the payout for each outcome x. Now we can multiply each outcome by its corresponding probability, and finally sum the products to create the Expected Value. Our EV equation then becomes: For outcomes less than $49, the payout is the maximum loss. For outcomes greater than $50, the payout is the maximum profit. And for discrete outcomes between $49 and $50, the payout is a partial profit or loss described by Z(x). The final equation for calculating the expected value, E(X), in this scenario, can be expressed as: While on its own a single calculation of this formula can be completed fairly easily using commodity computing hardware, nothing is easy at scale. In order to build and rank Trade Ideas, we are computing EV along with many other performance probability metrics for millions of trade setup combinations. This requires us to rent some truly powerful cloud computing hardware each month. But we chose to do it because we believe this equation provides the most accurate and useful expected value metric available anywhere. That is what Option Alpha traders deserve and it gives us great pride to be able to provide it for you. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#the-new-alpha) The New Alpha In Trade Ideas 1.0 we created the notion of Alpha, which was a proprietary value that combined various market metrics and statistics in a unique way to provide a score that identified trading opportunities. But that Alpha didn’t sit right with us. We want to be in the business of transparency, not opacity, and we don’t want to peddle the illusion that we know something OA traders don’t, or that we’re smarter. We’re not. We’re just traders who use and share the tools we build because we believe there’s a better way to trade options. In Trade Ideas 2.0, we decided to revise how Alpha is calculated and share it with you all in a completely transparent and reproducible way. Now that the true EV of a trade is known, we simply calculate the Alpha value as the Expected Value divided by the Max Loss - an enhanced version of the Reward/Risk metric. circle-info We have published multiple [Research Insights blogsarrow-up-right](https://optionalpha.com/category/research-insights) to analyze how pre-trade EV and Alpha values compare to realized P/L results using Trade Ideas positions. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#conclusion) Conclusion Understanding and calculating the Expected Value in options trading is essential for assessing the potential profitability of a trade. In this article, we walked through three increasing levels of difficulty for calculating EV, and described how traders can delve into increasingly complex calculations involving probabilities, payoffs, and discrete price increments. The resulting Expected Value provides valuable insights into the average outcome of an options trade. In Trade Ideas 2.0, we introduced the most robust and computationally heavy calculation for EV to provide traders with the most accurate calculations in the industry, something not seen anywhere else. Last updated 2 months ago Was this helpful? * [Understanding Alpha and Expected Value](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#understanding-alpha-and-expected-value) * [Calculating EV at Expiration for Max Profit or Loss](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#calculating-ev-at-expiration-for-max-profit-or-loss) * [Estimating Expected Value for an Average Outcome](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#estimating-expected-value-for-an-average-outcome) * [Calculating Expected Value as a Random Variable](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#calculating-expected-value-as-a-random-variable) * [The New Alpha](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#the-new-alpha) * [Conclusion](https://docs.optionalpha.com/technical-documentation/calculations/understanding-alpha-and-expected-value#conclusion) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Testing Automations | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/testing-automations#testing-automations) Testing Automations ------------------------------------------------------------------------------------------------------------------------------------------------ Testing your bots and automations is a critical step when building your portfolio. Testing allows you to observe how your bot works, diagnose potential issues, and ensure that automations function as you intend. There are multiple ways to test your bots. We recommend running bots in a paper trading account before using live capital. We encourage you to continuously test all facets of a bot to feel confident your strategies execute correctly. It is important to test in multiple environments, capital structures, and trading limits. You can always test any automation type individually by clicking the “**Run Test**” button. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F66b267ac843884e2a3d74aed_66b26796f9ba44cc44f3db14_run-test.png&width=768&dpr=3&quality=100&sign=2fedd32a&sv=2) The test feature allows you to verify the automation’s logic will function the way you expect it to and identify where any issues may occur. You can choose any bot to run the test in and even assign custom inputs. Testing an automation in different bots lets you view the results for additional capital allocations and position limits. When testing an automation, live market data is used when evaluating decision recipes. You can view all information immediately in the Automation Log. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F66b267ac843884e2a3d74ae9_66b267a39fb92216f2f1379f_test-automation.png&width=768&dpr=3&quality=100&sign=7012c9ab&sv=2) Testing your bots is also a proactive way to review how different variables affect the bot. For example, changing a technical indicator may determine whether or not a position will be opened or closed at the end of the automation. circle-info Remember, this is only running a test inside the bot. Positions will not be opened, and no actions will be visible in the Bot Log. Testing is a great way to verify your bot’s decision-making parameters and outcomes. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Probability | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability) Probability --------------------------------------------------------------------------------------------------------------------- The bots assume the [Black-Scholes-Merton (BSM)arrow-up-right](https://optionalpha.com/topics/options-pricing) model when calculating probability, which (imperfectly) implies a Gaussian or normal distribution. The bots use a fast polynomial approximation for calculating the probability that's derived from BSM. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#background) Background The payoff to a European call option, for example, with a strike price _**K**_ at the maturity date _**T**_ is where _**S(T)**_ is the price of the underlying asset at the maturity date. At maturity, if _**S(T) > K**_ the option to buy the underlying at _**K**_ can be exercised and the underlying asset immediately sold for _**S(T)**_ to give a net payoff of _**S(T) − K**_. Since the option gives only the right and not the obligation to buy the underlying asset, the option to buy the underlying will not be exercised if doing so would lead to a loss, _**S(T) − K <0**_. The BSM formula for the price of the call option at date _**t=0**_ prior to maturity is given by c(0)\=S(0)N(d1)−e−rtKN(d2)c(0)=S(0)N(d1)−e−rtKN(d2)c(0)\=S(0)N(d1)−e−rtKN(d2) where _**N(d)**_ is the **cumulative probability distribution** for a variable with a **standard normal distribution** with a mean of zero and a standard deviation of one. It is the area under the standard normal density function from **−∞** to _**d**_ and therefore gives the probability that a random draw from the standard normal distribution will have a value less than or equal to d. Therefore, we have _**0 ≤ N(d) ≤ 1**_ with _**N(−∞) = 0, N(0) = 0.5**_, and _**N(0) = 0.5**_. The term r is the continuously compounded risk-free rate of interest, and variables _**d1**_ and _**d2**_ must satisfy the respective constraints d1\=ln⁡(SK)+(r+σ22)TσTd1=ln⁡(SK)+(r+σ22)TσTd1\=ln⁡(SK)+(r+σ22)TσT d\_1\=ln⁡(SK)+(r+σ22)TσTd\\\_1 = \\frac{{\\ln \\left( \\frac{S}{K} \\right) + \\left( r + \\frac{\\sigma^2}{2} \\right) T}}{\\sigma \\sqrt{T}}d\_1\=σT​ln(KS​)+(r+2σ2​)T​ d2\=d1−σTd2=d1−σTd2\=d1−σT where: ‍ &#xNAN;_**S**_ = Spot price of the underlying asset &#xNAN;_**K**_ = Strike price of the option &#xNAN;_**r**_ = Risk-free rate &#xNAN;_**σ**_ = Volatility of the underlying asset &#xNAN;_**T**_ = Time to expiration of the option For more information on the BSM model, see [herearrow-up-right](https://www.jstor.org/stable/1831029) . ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#polynomial-approximation) Polynomial Approximation The cumulative standard normal distribution is the probability that a number arising from a standard normal distribution lies between **−∞** and **x**. The cumulative standard normal distribution function, which we'll call _**P(x)**_, does not have a simple (read fast, in computing terms) analytical solution. Instead, the bots use a **polynomial or rational approximation** of the standard normal ([26.2.17; National Bureau of Standards, 1972arrow-up-right](https://www.math.ubc.ca/~cbm/aands/page_932.htm) ). The equation is: P(x)\=1−Z(x)(b1t+b2t2+b3t3+b4t4+b5t5)+ϵP(x)=1−Z(x)(b1t+b2t2+b3t3+b4t4+b5t5)+ϵP(x)\=1−Z(x)(b1t+b2t2+b3t3+b4t4+b5t5)+ϵ where, * _**Z(x)**_ is the probability density function for a standard normal distribution, described below t\=11+pxt = \\frac{1}{1+px}t\=1+px1​ _with_ _**p=0.2316419**_ * _**b1= 0.319381530**_ * _**b2= −0.356563782**_ * _**b3= 1.781477937**_ * _**b4= −1.821255978**_ * _**b5=1.330274429**_ * and ϵ is the error estimating _**P(x)**_ The equation is valid for: This function does not describe the probability of observing value _**x**_, but the probability of observing any value **≤x**. As a result, the cumulative normal distribution function is sometimes described as a normal integral function. The **probability density function**, _**Z(x)**_, is equivalent to the slope of the cumulative distribution - in other words, the rate of increase of _**P**_ for a given _**x**_. circle-info The BSM analog for the rational approximation _P(x)_ is _N(d)_, described above. The normal probability density function is often confused with the normal distribution function, or is assumed to provide the probability of observing some value, x. In fact, this function only approximates the probability of observing a value within a very small range about x. As a result, when considered over a finite interval, that value can be very much greater than 1, which a probability, by definition, cannot exceed. The function can be described as: Z(x)\= e−(x−μ)22σ2σ2πZ(x) = \\frac {e^{\\frac {-(x-μ)^{2}} {2σ^{2}}}}{σ \\sqrt{2\\pi}}Z(x)\=e2σ2−(x−μ)2​ ​σ2π​ where μ is the [location parameterarrow-up-right](https://www.itl.nist.gov/div898/handbook/eda/section3/eda364.htm) and σ is the [scale parameterarrow-up-right](https://www.itl.nist.gov/div898/handbook/eda/section3/eda364.htm) . The case where μ=0 and σ=1 is called the **standard normal distribution**. We can therefore simplify the equation for the standard normal distribution. Z(x)\=e−x222πZ(x) = \\frac {e^{\\frac {-x^{2}} {2}}}{\\sqrt{2\\pi}}Z(x)\=2π​e2−x2​​ ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability-of-future-price) Probability of Future Price Bot automations may contain various decisions surrounding the probability of the underlying's price being a specific value at some date in the future. All of these recipes are derived from the same probability formula, P(x). The probability function takes the current price, strike price, annual volatility of the underlying, the risk-free rate, and days to maturity as inputs to calculate d1 and d2_**​**_, as described above. The bots will then effectively calculate N(d2) from BSM by first solving the **probability density function**, Z(x), before using all values as inputs to the **cumulative probability distribution function**, P(x). The outputs of P(x) and Z(x) are then used to solve a variety of sub-problems relevant to the specific decision recipes: probability above price x, below price x, between prices x and y, etc. In the context of the BSM, N(d1) and N(d2) represent cumulative standard normal distribution functions applied to d1 and d2 variables, respectively. Even though both d1 and d2 are derived from underlying asset dynamics, volatility, risk-free rate, and time to expiration, they serve distinctly different purposes. It's important to understand why. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#role-of-n-d1) Role of N(d1) _N(d1)_ serves multiple purposes: 1\. **Delta:** For a European call option, _N(d1)_ is the option's Delta, which signifies the rate of change of option price with respect to the price of the underlying asset. 2. **Hedge Ratio:** N(d1) also represents the number of shares needed to hedge against the price change in the option, often termed as the hedge ratio. 3\. **Probabilistic Interpretation:** N(d1) can be interpreted as the risk-adjusted probability that the option will finish in-the-money under the risk-neutral measure, discounted back to today's value. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#role-of-n-d2) Role of N(d2) N(d2), on the other hand, has a more specific role: 1\. **Probabilistic Interpretation:** N(d2) represents the risk-neutral probability that the option will be exercised, i.e., that the asset will be above the strike price K at expiration T for a call option. 2\. **Link to Option Price:** N(d2) is directly used in the Black-Scholes formula to determine the value of a European call option as: C\=S⋅N(d\_1)−K⋅e−rT⋅N(d\_2)C = S \\cdot N(d\\\_1) - K \\cdot e^{-rT} \\cdot N(d\\\_2)C\=S⋅N(d\_1)−K⋅e−rT⋅N(d\_2) and similarly for a European put option as: P\=K⋅e−rT⋅(1−N(d\_2))−S⋅(1−N(d\_1))P = K \\cdot e^{-rT} \\cdot (1-N(d\\\_2)) - S \\cdot (1-N(d\\\_1))P\=K⋅e−rT⋅(1−N(d\_2))−S⋅(1−N(d\_1)) #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#key-differences) Key Differences 1\. **Sensitivities:** N(d1) is more sensitive to changes in the underlying asset's price, given its direct correlation to Delta. N(d2) is generally less sensitive to these changes. 2. **Functional Role:** N(d1) has a broader set of implications, including hedge ratios and option sensitivities. N(d2) is primarily used for pricing and probabilistic assessment related to the strike price. 3\. **Mathematical Derivation:** d1 and d2 may appear similar, but the minor difference in the terms (presence or absence of σ22) significantly impacts their role in option pricing and risk management. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#how-to-interpret-n-d1-and-n-d2-in-trading) How to Interpret N(d1) and N(d2) in Trading N(d1) can be viewed as the risk-adjusted probability that the option will be exercised, assuming the option is held until expiration and that returns are log-normally distributed. In the context of the Black-Scholes model, this risk adjustment is performed via a drift term equal to the risk-free rate r, implying a risk-neutral valuation. Mathematically, N(d1) can be considered the delta of an option, i.e., the sensitivity of the option's price with respect to a change in the price of the underlying asset. N(d2), on the other hand, is the risk-neutral probability that the option will be exercised, without any further adjustments. This is more straightforward than N(d1) and essentially represents the probability that the option will end up in-the-money under the risk-neutral measure. In simpler terms, N(d2) represents the probability that the option will be exercised in a world where all investors are risk-neutral. While both N(d1) and N(d2) are derived from the same Black-Scholes formula, their financial interpretations are markedly different. N(d1) serves as the risk-adjusted (via risk-free rate) probability for the option ending up in-the-money, whereas N(d2) represents the risk-neutral probability of the same. Both are crucial for understanding the behavior and valuation of options within the Black-Scholes framework. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability-decisions-on-the-underlying) Probability Decisions on the Underlying There are several probability-related decisions available when analyzing the security object. Examples include: * Chance of being above/below m price in n days is more/less than x. * Chance of being between a and b prices in n days is more/less than x. Both decisions use variations of fast polynomial approximation to calculate the final probability of the event occurring. The first use case, the chance of being **below** m price in n days, is the output of P(x). The opposite decision, the chance of being **above** m price in n days, is simply 1−P(x). In the case of price between prices a and b, recall that the cumulative standard normal distribution polynomial describes the probability of observing any value ≤x. Therefore, to calculate the chance of falling within a range in n days, we subtract P(x) with S(T)=a from P(x) with S(T)=b to determine the final probability. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability-decisions-on-the-opportunity) Probability Decisions on the Opportunity There is one probability-related decision available when analyzing Opportunities, either in a decision or as part of Trade Ideas: * Chance of _Profit, MaxProfit, MaxLoss, ITM, etc._ is more/less than x. Unsurprisingly, we are again calculating the probability of ending up at some price in the future. The only relevant question is, which price and when? For Opportunities, calculations are always made using the number of days to expiration as the input, i.e., we're answering the question, "What is the chance of these things happening _at expiration_?" The determination of underlying price in relation to profit, max loss, or being ITM is fully dependent on both the strategy type in question and the composite value of the opportunity, given its individual legs (assuming an options strategy). In the case of a short put spread, for example, the "chance of profit" is determined by the probability the underlying price will be above the break-even price of the spread at expiration. In other words, the probability the spread will make at least a $1 profit. The max loss chance is then determined by the underlying price being below the long put at expiration, and the being ITM chance is determined by the underlying price being below the short strike at expiration. The same principles are applied to each strategy type. In the case of more complex, multi-legged strategies like iron condors, we use the same probability formula for calculating the chance of price between prices a and b to determine the likelihood of the profit range in between the short strikes, max loss range, etc. Last updated 2 months ago Was this helpful? * [Probability](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability) * [Background](https://docs.optionalpha.com/technical-documentation/calculations/probability#background) * [Polynomial Approximation](https://docs.optionalpha.com/technical-documentation/calculations/probability#polynomial-approximation) * [Probability of Future Price](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability-of-future-price) * [Probability Decisions on the Underlying](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability-decisions-on-the-underlying) * [Probability Decisions on the Opportunity](https://docs.optionalpha.com/technical-documentation/calculations/probability#probability-decisions-on-the-opportunity) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Day Trading | Option Alpha ### [hashtag](https://docs.optionalpha.com/answer-vault/day-trading#what-is-day-trading) What is day trading? Day trading is when you buy and sell a stock on the same trading day. Oftentimes, 'day traders' will execute multiple trades in a day and hold onto each position for only a short period of time. ### [hashtag](https://docs.optionalpha.com/answer-vault/day-trading#is-all-options-day-trading-0dte) Is all options day trading 0DTE? 0DTE options expire the same day, so all 0DTE trades are executed as day trades, but not all day trades involve 0DTE contracts. Any option contract can be a day trade if opened and closed on the same day. ### [hashtag](https://docs.optionalpha.com/answer-vault/day-trading#is-day-trading-legal) Is day trading legal? Yes, day trading is legal. However, you should check with your broker to ensure you have the correct account type and minimum funds to avoid the pattern day trading rule. ### [hashtag](https://docs.optionalpha.com/answer-vault/day-trading#what-is-0dte) What is 0DTE? 0DTE options, aka zero days to expiration, are option contracts that expire at the close of the day they are opened. Trading a 0DTE position means you entered the trade on the same day the contract expires, regardless of how long the contract has been available. ### [hashtag](https://docs.optionalpha.com/answer-vault/day-trading#what-is-pattern-day-trading-pdt) What is pattern day trading (PDT)? The PDT rule states that investors who make four or more day trades in a five-day period are considered pattern day traders and must maintain a minimum account balance of $25,000. Violating the PDT rule can result in your trading account being suspended by the broker. ### [hashtag](https://docs.optionalpha.com/answer-vault/day-trading#what-is-the-difference-between-spx-and-spy) What is the difference between SPX and SPY? SPX is an index option whose contracts derive their value from the S&P 500 index. SPX is a European-style index option with cash-settlement and favorable 60/40 tax treatment. SPX cannot be traded like a stock; traders must use options to gain exposure. SPY is an ETF (exchange-traded fund) that tracks the S&P 500 but can be bought and sold and also has tradeable options. SPY is 1/10th the value of SPX. SPY is an American-style ETF with options that have physical settlement. Learn more about SPX vs SPY [herearrow-up-right](https://optionalpha.com/learn/spx-vs-spy-how-to-trade-the-s-p-500) . ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FKIwzcZ3Vk3CGki3gtfmo%252Fimage.png%3Falt%3Dmedia%26token%3D5a489389-7a3c-4c15-8c28-1f05453d24b3&width=768&dpr=3&quality=100&sign=2e017060&sv=2) Last updated 22 days ago Was this helpful? * [What is day trading?](https://docs.optionalpha.com/answer-vault/day-trading#what-is-day-trading) * [Is all options day trading 0DTE?](https://docs.optionalpha.com/answer-vault/day-trading#is-all-options-day-trading-0dte) * [Is day trading legal?](https://docs.optionalpha.com/answer-vault/day-trading#is-day-trading-legal) * [What is 0DTE?](https://docs.optionalpha.com/answer-vault/day-trading#what-is-0dte) * [What is pattern day trading (PDT)?](https://docs.optionalpha.com/answer-vault/day-trading#what-is-pattern-day-trading-pdt) * [What is the difference between SPX and SPY?](https://docs.optionalpha.com/answer-vault/day-trading#what-is-the-difference-between-spx-and-spy) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # FAQs | Option Alpha ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#why-do-i-need-a-bot) Why do I need a bot? When you create a bot, it is assigned to an account (live or paper). This connection is permanent, and tells the bot to send orders to your live brokerage account, or simulate fills using the OA in-app paper trading engine. A bot does a few things for you, even if you are not running automations. For example, when you are opening a position, the bot will try multiple prices between the bid/ask spread ([SmartPricingarrow-up-right](https://docs.optionalpha.com/tools/bots/smartpricing) ) and attempt to get the trade filled at the best possible price (instead of the usual cancel/replace order process). After the position is opened, the bot will monitor the position's [Exit Optionsarrow-up-right](https://docs.optionalpha.com/tools/managing-positions/exit-options) looking for an opportunity to exit and execute a trade to close the position when its available (also executing SmartPricing settings there too). Bots are also a great way to organize your positions, making it easy to analyze the results of certain strategies. ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#how-do-i-turn-a-paper-bot-into-a-live-bot) How do I turn a paper bot into a live bot? A bot's account connection cannot be changed. To make a paper bot live, you'll need to [clone the bot](https://docs.optionalpha.com/tools/clone-bot-templates) and change the account type to connect it to a live brokerage account. Click the ••• in the bot's top right corner and select 'Clone bot.' ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FhoKsh4lM2vpAlQ58hUcA%252FCleanShot%25202026-03-21%2520at%252014.15.32%25402x.png%3Falt%3Dmedia%26token%3Decceaf68-fdc5-43b1-bded-526c1305a096&width=768&dpr=3&quality=100&sign=644b4669&sv=2) ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#why-didnt-my-order-fill) Why didn't my order fill? There is no way to 100% guarantee a fill in a live market. In a live market, each order requires a counterparty to take the other side of the trade. A position not filling will naturally happen when trading in a live market when there is no counterparty to fill your order and/or the price you are requesting is outside the range the market is willing to accept. You may consider expanding the range of the bid/ask spread you're willing to let the bot work through (up to 100% or more). You may also try adjusting the SmartPricing speed. When attempting to open or close a position, your bot works through the bid/ask spread based on your SmartPricing settings, automatically canceling and replacing unfilled orders. The final price in the sequence stays active as a limit order for **two minutes** and then cancels. circle-info [**Click here**arrow-up-right](https://optionalpha.com/help/smartpricing) for more details about SmartPricing functionality. ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#why-are-my-live-and-paper-bot-results-different) Why are my live and paper bot results different? Paper trading bots simulate a fill based on the current market's live pricing, typically at or near the mid price (you can modify your SmartPricing settings to allow for more slippage to help generate more realistic results. The most common reason that a paper bot's results differ from a live bot is the ability to fill orders, specifically profit taking or stop losses. Consider including pessimistic pricing in your entry/exit criteria, and think criticially about how a strategy is likely to perform in a live market (e.g., will an order fill for a far OTM 0DTE position right before the market closes?). ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#why-didnt-my-position-close-when-it-had-a-profit) Why didn't my position close when it had a profit? [SmartPricing](https://docs.optionalpha.com/tools/bots/smartpricing) attempts to fill the trade by submitting orders from the mid price to a "final price." The final price is the worst price you are willing to accept to fill the trade. The 2 controls you have over this functionality are the SmartPricing mode (e.g. Patient, Normal, Fast) and the "Final Price" (the worst price it should try). Both are typically set up in this screen: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F177314742986611668861.png&width=768&dpr=3&quality=100&sign=d9dfe4ea&sv=2) However, the Profit Taking Exit Options are a special scenario. You don't need to set a "Final Price" because the final price is automatically set by the bot to a price that locks in profit you specified. It won't try a worse price that would result in profit less than your specified amount. In case you are wondering why profit taking works this way: If SmartPricing were to go beyond a final price that locks in your profit taking, the outcome can quickly flip a trade from winner to loser. For example, in your trade above, if i went further than $.91 traversing the bid/ask spread than 1) you would get less than the 30% profit taking you specified 2) if it went all the way to $0.48, profit taking being triggered could have resulted in an unexpected loss. Instead the bot will continue to retry until it can fill at a price that gets the specified profit taking. ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#can-i-backtest-a-bot) Can I backtest a bot? Bots cannot be backtested, simply because they can include many variables that aren't included in the backtester. ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#why-did-my-position-close-for-a-loss-greater-than-my-stop-loss) Why did my position close for a loss greater than my stop loss? Stop losses and trailing stops do not guarantee that a position will close for that exact value. Markets move fast and just because your stop is hit doesn't mean you'll get out at the same price as the trigger level. Bots use the position's mid-price when evaluating returns. It is possible that your stop loss or trailing stop will trigger _after_ the position's value has exceeded your value. The exit stop loss is only a threshold, which means it will begin the closing order sequence at or below the target loss. Second, price movements are discrete and "jumpy" - just because a position is at a 10% loss, doesn't mean it can't be at a 50% loss seconds from now. Even if a stop loss is triggered at or near the target, you may end up closing at a much worse price than you were expecting. ### [hashtag](https://docs.optionalpha.com/answer-vault/faqs#what-is-the-difference-between-a-decision-input-automation-input-and-bot-input) What is the difference between a Decision Input, Automation Input, and Bot Input? medal (Thank you to community member [Robert DiNeroarrow-up-right](https://app.optionalpha.com/community/member/pachiraaquatica) for his contribution and help in [this postarrow-up-right](https://app.optionalpha.com/community/posts/whats-the-difference-between-a-decisio-2026040221160) ). We frequently get questions about users changing values, but the bot doesn't recognize the new values. Most often, this is due to the user changing the Default Value instead of the Automation Input value. Here are the 5 types of inputs and how they are used. question [See this help page for detailed information on using inputs](https://docs.optionalpha.com/tools/bots/inputs) . Last updated 1 day ago Was this helpful? * [Why do I need a bot?](https://docs.optionalpha.com/answer-vault/faqs#why-do-i-need-a-bot) * [How do I turn a paper bot into a live bot?](https://docs.optionalpha.com/answer-vault/faqs#how-do-i-turn-a-paper-bot-into-a-live-bot) * [Why didn't my order fill?](https://docs.optionalpha.com/answer-vault/faqs#why-didnt-my-order-fill) * [Why are my live and paper bot results different?](https://docs.optionalpha.com/answer-vault/faqs#why-are-my-live-and-paper-bot-results-different) * [Why didn't my position close when it had a profit?](https://docs.optionalpha.com/answer-vault/faqs#why-didnt-my-position-close-when-it-had-a-profit) * [Can I backtest a bot?](https://docs.optionalpha.com/answer-vault/faqs#can-i-backtest-a-bot) * [Why did my position close for a loss greater than my stop loss?](https://docs.optionalpha.com/answer-vault/faqs#why-did-my-position-close-for-a-loss-greater-than-my-stop-loss) * [What is the difference between a Decision Input, Automation Input, and Bot Input?](https://docs.optionalpha.com/answer-vault/faqs#what-is-the-difference-between-a-decision-input-automation-input-and-bot-input) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Probability Theory | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#probability-theory) Probability Theory ------------------------------------------------------------------------------------------------------------------------------------------ [Implied volatilityarrow-up-right](https://optionalpha.com/learn/implied-volatility) (IV) and [historical volatilityarrow-up-right](https://optionalpha.com/learn/historical-volatility) (HV) stand as two primary measures employed in the domain of probability theory, each with its strengths and limitations. While IV is widely used and quoted, HV offers a more grounded and accurate choice for calculating the probability of future price. In this article, we will explore the technical nuances and mathematical foundations behind this assertion, examine specific algorithms, methodologies, and concepts used in advanced probability theory and financial modeling. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#how-option-alpha-calculates-the-probability-of-future-price) How Option Alpha Calculates the Probability of Future Price If you've been around OA before, you already know that math and probabilities encompass a large part of how we trade. If interested, we have entire articles explaining the gritty details of how [probability is calculatedarrow-up-right](https://optionalpha.com/help/calculating-probability) and [how we generate true Expected Valuearrow-up-right](https://optionalpha.com/help/understanding-alpha-and-expected-value) from defined-risk trades. But in short, we use the probability distribution derived from [Black-Scholesarrow-up-right](https://optionalpha.com/learn/black-scholes-model) that describes the chance of the underlying stock price being below a target price level at some point in the future. The inputs to that function are: the current underlying price, target strike price, days to maturity, risk-free rate, and volatility. The volatility parameter is what I'd like to focus on. We use annualized volatility of the underlying as the volatility input to the equation, specifically the annualized 30-day standard deviation of returns, and it's important to understand why. IV has its place, but it's not entirely relevant to the problem we're trying to solve here. Recall that IV is solved for as the missing variable when reversing the option pricing equation, BSM or similar. But that IV is representative of a _single_ option contract. In [Trade Ideasarrow-up-right](https://optionalpha.com/blog/find-better-trade-ideas) , for example, the Probability of Profit (POP) for an Iron Condor trade is the probability that the underlying price falls within the breakevens at expiration. An Iron Condor has 4 legs. The cumulative probability function has 1 input for volatility. So what do we do? We are trying to figure out where the _underlying price_ will be in the future, which means the IV of a single option leg won't help us. We could find some average of the individual legs' IVs, roll our own IV calculation that represents the underlying, rely on a black-box proprietary calculation for underlying IV, or use the annualized historical volatility, which is what we choose to do. circle-info Assume in this article that Probability of Profit (POP) algorithms refers to a mathematically robust representation of probability calculation that is not simply a function or restatement of a Reward/Risk ratio. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#historical-volatility-in-probability-equations) Historical Volatility in Probability Equations In POP algorithms, historical volatility is used instead of implied volatility to calculate the likelihood of profit. HV, representing the standard deviation of an asset's historical returns, offers a more accurate and predictive measure of the cumulative density area due to its reflection of actual price movements. Since HV captures the realized price fluctuations of the underlying asset, and by incorporating HV into the POP calculation, we consider the complete historical distribution of the asset's returns. This comprehensive view enables a more accurate assessment of the likelihood that the underlying price will remain within the desired range based on its observed behavior over time. The use of HV is a practical choice. It ensures that the full range of price movements observed in the past is taken into account. Consequently, a more representative and precise estimation of the likelihood of the underlying price falling within the desired range is achieved. In "Index Option Prices and Stock Market Momentum," [Amin, Coval, Seyhun (2004)arrow-up-right](https://www.jstor.org/stable/10.1086/422440) examined the performance of HV and IV in options pricing and aimed to "test the prediction of standard option pricing models." They posited "that there should be no relation between option prices and past stock market movements." However, circle-info "... evidence suggests that taking past stock returns into account results in more-accurate estimates of implied volatilities from index option prices, which have been used by many authors to explore arbitrage opportunities, measure risk premia in the stock markets, or **forecast future volatilities**." The findings of the study revealed that incorporating HV as a measure of volatility led to more accurate pricing models and improved estimations of probabilities compared to using IV. HV captured the historical distribution of price movements, which provided a more complete view of the underlying asset's behavior and better reflected market dynamics. The researchers concluded that HV-based probability calculations resulted in superior predictions and a more reliable assessment of option prices. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#advantages-of-historical-volatility) **Advantages of Historical Volatility** **Incorporation of actual price movement.** Historical volatility directly incorporates observed price movements and variations over time. This comprehensive view captures the impact of market conditions, shocks, and other factors on volatility dynamics. **Analysis of skew and term structure.** HV allows for the direct analysis of the [skew and term structurearrow-up-right](https://optionalpha.com/learn/skew) of volatility. We can observe variations in volatility levels across different strike prices and expiration dates, gaining insights into market perceptions of risk. **Tangible measure of realized volatility.** Historical volatility provides a tangible and reliable measure of realized volatility based on actual price data. It serves as a robust foundation for estimating future volatility. **Reproducibility.** In a later section we will discuss how deriving a single IV number from a landscape of options chains across expirations can be a very black-box endeavor. Anyone can produce an obscure, proprietary IV with a flurry of marketing material about how, "_Our_ IV is better than _their_ IV." In fact, there are several popular financial platforms that refuse to reveal or provide information on how their IV is calculated. Go ahead and ask them. What's more difficult is providing something that's truly reproducible and verifiable, and that is something we at OA stand behind. [**IV typically overstates HV**arrow-up-right](https://optionalpha.com/lessons/iv-expected-vs-actual-move) **.** IV is derived from option prices and reflects the market's expectation of future volatility, while HV is based on historical price movements. The options pricing models assume constant volatility, which is unrealistic in practice as market conditions change over time. Additionally, IV includes a risk premium to account for uncertain market conditions or perceived risk of extreme volatility. HV is based on observed price movements that include both predictable and unpredictable factors, excluding anticipation events that can significantly impact prices. The forward-looking nature and market expectations embedded in IV tend to result in a higher estimate of future volatility compared to the retrospective nature of HV. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#limitations-of-implied-volatility) Limitations of Implied Volatility In contrast, implied volatility is derived from option prices and reflects market expectations, not reality, of future price volatility. Calculated using options pricing models like Black-Scholes or similar, implied volatility is not directly observable and varies across different options and strike prices based on market participants' expectations and sentiment regarding future price movements. In complex options trades such as iron condors, using IV directly becomes impractical as the probability algorithm requires a single volatility parameter representing the entire underlying asset. However, implied volatility can differ across options and strike prices due to factors such as time to expiration, strike price, supply and demand dynamics, and market sentiment specific to each option. Incorporating implied volatility into the POP calculation necessitates deriving a single value that represents the overall volatility of the underlying asset. Yet, there is currently no standardized method for combining multiple implied volatilities into such a value accurately. This single value represents an average or aggregate implied volatility across the selected options, typically encompassing different strike prices and expiration dates. The specific options chosen are based on factors like liquidity and moneyness (in-the-money, at-the-money, out-of-the-money), but regardless of the selection, a heuristic approach is employed. Here's an overview of the process: **Option selection.** Choose a representative set of options for the underlying stock. These options should have different strike prices and expiration dates, covering a range of maturities and moneyness levels. Commonly, at-the-money options (where the strike price is close to the current stock price) are included. **Option price input.** Gather the current market prices of all selected options. **Implied volatility calculation.** Apply an option pricing model, such as Black-Scholes, to calculate the IV for each option in the selected set. This is done by iteratively adjusting the volatility until the calculated option prices match the market prices. There are several common numerical algorithms used to do this: * Newton-Raphson method, an iterative root-finding algorithm for solving nonlinear equations. * Bisection method, a bracketing method to find the root of a function within a specified interval. * Brent's method, a combination of the above methods that offers robustness and efficiency. **Weighted average.** Calculate a weighted average of the implied volatilities obtained from the previous step. The weights can be based on various factors, such as option liquidity or market capitalization of the underlying stock. The exact methodology for assigning weights may vary depending on the provider or source of the quoted IV. These methods are usually unadvertised (black box). **Final IV value.** The resulting weighted average implied volatility is the single IV value quoted for the entire underlying stock. It's important to note that this single IV value is an approximation and represents the market's overall _expectation_ of future volatility for the underlying stock. It provides a concise measure of the aggregate market sentiment for the stock's potential price movements. Providers of implied volatility data, however, may use different methodologies in selecting options and calculating the weighted average, so the specific details of how the IV is derived are few and there can be a wide variance between sources. Comparing probability numbers between different softwares is never apples-to-apples, and this is why. Due to this practical limitation, historical volatility is often used as a reasonable substitute in the algorithm for calculating POP. Historical volatility provides a single measure of price fluctuations observed in the past, which can be utilized as a consistent volatility input for the underlying asset in the context of the probability calculation. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#peering-beyond-the-iv) Peering Beyond the IV The process of calculating a single implied volatility value for an underlying has potential sources of misrepresentation. There are manipulative market forces at play influencing the price of an option that traders, especially retail traders, may not be aware of. Or, if they are aware of it, have no way to measure. In the context of the POP equation, relying on the weighted IV can have certain significant drawbacks: **Simplified representation**. The single IV value of an underlying represents an average or aggregate measure of expected volatility across a range of options. It assumes that volatility is constant across all strike prices and expiration dates, which may not be the case. In reality, volatility can vary depending on the specific option contract and market conditions. By condensing the IV into a single value, certain nuances and variations in implied volatility across different options may be overlooked or abstracted away. **Limited option sample.** The contracts selected for calculating IV might not capture the full range of available options on the underlying stock. If illiquid or less actively traded options are excluded from the sample, the resulting IV value may not fully reflect the true market sentiment or expectations. Again, this part is not up to or controlled by you, the data consumer. **Weighting methodology**. The weights assigned to individual options when calculating the weighted average IV can vary depending on the methodology used by different providers or sources. Different weighting schemes can lead to different IV values, potentially biasing the overall representation of volatility. **Skew and term structure.** Implied volatility can exhibit a [skew or smile patternarrow-up-right](https://optionalpha.com/podcast/ultimate-guide-to-option-skew) , where options with different strike prices have different implied volatility levels. This skew reflects the market's perception of potential asymmetric risks. A single IV value may not adequately capture the shape of the skew or the term structure of implied volatility, which could lead to misrepresentation of the underlying volatility dynamics. **Assumption of constant volatility.** Implied volatility assumes a homogeneous volatility distribution across all strike prices and expiration dates. Variations in volatility across different options can be overlooked, leading to a _simplified_ representation of volatility dynamics. **Supply and demand dynamics**. Market makers and institutional investors, who often trade large volumes of options, can influence the supply and demand for specific option contracts. By actively trading or overtrading options, they can affect the prices and implied volatility levels. This may even be done strategically to impact the IV and potentially benefit their trading positions. **Volatility positioning.** Market markers may also have an incentive to influence the IV to benefit their trading strategies. For example, if a market maker or a large investor holds a significant position in options, they might take actions that can temporarily affect the supply or demand for those options, thereby impacting the IV. **False quotes or rumors**. Market participants can spread false quotes or rumors to manipulate perceived market sentiment. This can create artificial demand for options, affecting their prices and subsequently their IV. **Market maker activities.** Market makers, who facilitate options trading and provide liquidity, have the ability to influence option prices and implied volatility through their trading activities. They adjust their quotes and hedging strategies based on _their_ assessment of market conditions, which can not only impact calculated IV, but it is an unwanted inherent bias baked into the IV number. It's extremely important for retail traders to be aware of these factors and exercise caution when interpreting and relying on implied volatility data. Multiple sources, analysis of option chains, and consideration of broader market factors can provide a more comprehensive view of the underlying volatility dynamics. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#conclusion) Conclusion In this article we've discussed the motivations behind the use of Historical Volatility (HV) as the input parameter to Black-Scholes probability instead of the less trustworthy weighted Implied Volatility (IV) of the underlying security. HV provides a more robust measure of volatility because it considers a broader range of market conditions and price movements over a specified time period. Unlike IV, which can be influenced by short-term market sentiment, HV takes into account a longer time frame, providing a more comprehensive view of volatility dynamics. This empirical foundation lends credibility to HV as a reliable measure of realized volatility, as it is derived from a large sample size rather than relying on theoretical assumptions or market sentiment. Since HV is based on readily available historical price data, it remains consistent over time and can be recalculated for any given period. It provides valuable insights into the potential range of price movements and assists in making informed decisions about risk exposure and position sizing. There is practicality and real-world relevance of HV that is simply not present in momentary IV. Last updated 2 months ago Was this helpful? * [Probability Theory](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#probability-theory) * [How Option Alpha Calculates the Probability of Future Price](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#how-option-alpha-calculates-the-probability-of-future-price) * [Historical Volatility in Probability Equations](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#historical-volatility-in-probability-equations) * [Limitations of Implied Volatility](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#limitations-of-implied-volatility) * [Conclusion](https://docs.optionalpha.com/technical-documentation/calculations/probability-theory#conclusion) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Troubleshooting | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#troubleshooting) Troubleshooting -------------------------------------------------------------------------------------------------------------------- 1 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#testing-automations) [Testing Automations](https://docs.optionalpha.com/technical-documentation/troubleshooting/testing-automations) Testing automations enables you to check all the logic and decision criteria to be confident your bots will perform how you anticipate. 2 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#broker-rejection-messages) [Broker Rejection Messages](https://docs.optionalpha.com/technical-documentation/troubleshooting/broker-rejection-errors) Overview of common error messages you may encounter when submitting orders through the autotrading platform. 3 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#capital-warnings) [Capital Warnings](https://docs.optionalpha.com/technical-documentation/troubleshooting/capital-warnings) The “not enough avialable capital” warning occurs when there isn't sufficient capital for a bot to enter a new position. 4 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#position-limit-warnings) [Position Limit Warnings](https://docs.optionalpha.com/technical-documentation/troubleshooting/position-limit-warnings) Position limit warnings occur when you reach the maximum allowable positions for a bot or the trading day. 5 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#trade-enforcements) [Trade Enforcements](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements) Learn how to navigate the trade enforcement rules for different strategies. 6 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#pricing-anomaly-warning) [Pricing Anomaly Warning](https://docs.optionalpha.com/technical-documentation/troubleshooting/pricing-anomaly-warning) The “pricing anomaly” warning occurs when a trade opportunity experiences pricing that is outside of what is expected. 7 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#missing-or-invalid-input) [Missing or Invalid Input](https://docs.optionalpha.com/technical-documentation/troubleshooting/missing-or-invalid-input) The “missing input” or “invalid value” error occurs when a required input field is not assigned inside the automation. 8 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#daily-symbol-limit-error) [Daily Symbol Limit Error](https://docs.optionalpha.com/technical-documentation/troubleshooting/daily-symbol-limit-error) The “daily symbol limit” error occurs when a bot attempts to reference more than 10 symbols in a single trading day. 9 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#excessive-errors-failsafe) [Excessive Errors Failsafe](https://docs.optionalpha.com/technical-documentation/troubleshooting/excessive-errors-failsafe) The “excessive errors” failsafe occurs when a bot encounters ten errors in one day and automatically turns off automations. Here is what you need to know about excessive errors. 10 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#bot-event-loops) [Bot Event Loops](https://docs.optionalpha.com/technical-documentation/troubleshooting/bot-event-loops) Bot event loop errors may occur in positions that are triggered by an open position or close position event. 11 #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting#option-and-expiration-availability) [Option & Expiration Availability](https://docs.optionalpha.com/technical-documentation/troubleshooting/option-and-expiration-availability) Bots notify you with an error or warning if a specific option leg or expiration are not available for your position. Here's why you receive these alerts, and how to avoid them. Last updated 26 days ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Position Limit Warnings | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/position-limit-warnings#position-limit-warnings) Position Limit Warnings ------------------------------------------------------------------------------------------------------------------------------------------------------------ Bots have safeguards and limits that alert you when an automation encounters a warning. Daily and total position limits prevent overtrading by limiting the max number of positions a bot can have open at one time and in a single trading day. ### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/position-limit-warnings#daily-position-limit) Daily position limit The daily position limit is the number of positions a bot can open in a single trading day. The “**daily position limit**” warning occurs when a bot attempts to add a position that exceeds the number of new positions allowed. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FN2Zo3Ik6bNqdOpzqn7Cj%252F66b2689bd2b1eb0e2ecd835d_63f927c1dba29565a8bccdb2_Daily20limit.png%3Falt%3Dmedia%26token%3De43f05b9-086e-405c-883a-9f26569afb67&width=768&dpr=3&quality=100&sign=62a33b33&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/position-limit-warnings#total-position-limit) Total position limit The total position limit is the max open positions a bot can have at one time. The “**total position limit**” warning occurs when a bot attempts to add a position that exceeds the maximum number of positions allowed for the bot. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FFFpn61DbBYAmPu2oYYVL%252F66b2689bd2b1eb0e2ecd835a_63f927cf205b025fb8960c18_Total20limit.png%3Falt%3Dmedia%26token%3D748cee77-8354-467e-afc0-45570167cb9c&width=768&dpr=3&quality=100&sign=687be1d1&sv=2) circle-info There is no limit on closing positions. Once a daily position limit is reached, the bot won't open new positions unless you edit the safeguards. If a bot is at its max position limit and closes a position, new room becomes available to add a new position, assuming the daily position limit has not been hit. You can always edit your bot's position settings in the Safeguards section of the Settings tab. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F66b26871943baac68502d337_66b26869a7f877638686ed0b_bot-safeguards.png&width=768&dpr=3&quality=100&sign=43db1791&sv=2) ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FFS4llJXT1NflIBrr83hZ%252Fimage.png%3Falt%3Dmedia%26token%3D9dab131f-ce49-4aa1-ab98-0489ff416419&width=768&dpr=3&quality=100&sign=8d52e7e4&sv=2) Last updated 2 months ago Was this helpful? * [Position Limit Warnings](https://docs.optionalpha.com/technical-documentation/troubleshooting/position-limit-warnings#position-limit-warnings) * [Daily position limit](https://docs.optionalpha.com/technical-documentation/troubleshooting/position-limit-warnings#daily-position-limit) * [Total position limit](https://docs.optionalpha.com/technical-documentation/troubleshooting/position-limit-warnings#total-position-limit) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Decision Properties | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#decision-properties) Decision Properties --------------------------------------------------------------------------------------------------------------------------------------------- ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#overview) **Overview** [Decision recipesarrow-up-right](https://docs.optionalpha.com/platform/bots/decisions) evaluate the properties of an underlying security object, which is simply a JSON object that houses the most current information about the underlying or option contract at the moment it's requested. With few exceptions, the values of the security object for each underlying are updated in real-time, usually multiple times per second (actual update rate is dictated by the market). #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#example-security-object) Example security object: Copy { symbol: "SPY", description: "SPDR S&P 500 ETF Trust", stype: "etf", bidSize: 32, askSize: 2, bidTime: 1619119779000, askTime: 1619119779000, bid: 412.05, ask: 412.06, open: 415.89, high: 416.78, low: 411.13, close: 416.07, last: 412.0513, volume: 76149629, size: 0, time: 1619119779756, ivr: 7.023555, ... lastUpdate: "0.12s" } ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#security-properties) Security Properties Aside from IV Rank, which is calculated and cached once daily, the following properties are calculated in real-time: Property Description Last Price The last traded price of the security Close Price The most recent market session's closing price Open Price Current session's open price Low Price Current session's low price High Price Current session's high price Mark Price Current mark price of the security, mid-price of bid/ask. Change Dollar change from previous session's close and the last price. Change % Dollar change written as a decimal percentage. Volume Current session's volume since start of trading (includes pre-market). IV Rank The Implied Volatility (IV) of the security over the last 52 weeks. Greeks Delta, Gamma, Theta, and Vega are all real-time data. circle-info The Security Object for position leg properties stores value in a decimal type format. When referencing the position leg change or change % this will need to be expressed as a decimal. Therefore, a 100% change in the position leg value is represented as 1.00 ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#option-leg-properties) Option Leg Properties [**Extrinsic Value**arrow-up-right](https://optionalpha.com/options/options-pricing#extrinsic-value) is the difference between the price of an option (or the premium) and that option's intrinsic value. It is comprised of the greek values theta and vega. [**Intrinsic Value**arrow-up-right](https://optionalpha.com/options/options-pricing#intrinsic-value) is the inherent worth of an option. Intrinsic value is indicated by the degree to which the option is in-the-money. It is the difference between the underlying security's price and the options strike price when the option is in-the-money. [**Chance of ITM**arrow-up-right](https://docs.optionalpha.com/calculations/probability) is the mathematical probability of the underlying being in-the-money at expiration. [**OTM amount**arrow-up-right](https://optionalpha.com/blog/the-ultimate-guide-to-option-moneyness) measures the distance between the underlying at its current price and the strike price. It indicates how many points (dollars) away the underlying is from being ITM. If the leg is ITM, then the OTM amount will be 0. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#overview-1) Last updated 2 months ago Was this helpful? * [Decision Properties](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#decision-properties) * [Overview](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#overview) * [Security Properties](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#security-properties) * [Option Leg Properties](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#option-leg-properties) * [](https://docs.optionalpha.com/technical-documentation/calculations/decision-properties#overview-1) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Pricing Anomaly Warning | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/pricing-anomaly-warning#pricing-anomaly-warning) Pricing Anomaly Warning ------------------------------------------------------------------------------------------------------------------------------------------------------------ The "Pricing Anomaly" warning appears when a trade opportunity's pricing is outside an expected range. This typically occurs when an option leg is lacking a bid or the bid-ask spread for one leg is inverted with another leg. For example, the strike closer to the money has a mid/mark price that is less than the leg further out-of-the-money. You should reference your broker platform's option chain to investigate and check for zero-bid and inverted bid-ask spreads if you receive this warning. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FdUfri5JhohjMfwkJIWZO%252F67056a637684a4c59aab4c77_62349a67cb7954582cefb2b8_Price%252520Anomaly.png%3Falt%3Dmedia%26token%3Dada6560e-f3f9-4243-9700-496af3e5b744&width=768&dpr=3&quality=100&sign=366707aa&sv=2) Note that bots reference pricing at the time the order is submitted, so there could be situations where pricing for a particular leg fluctuates faster than what is displayed on the broker's platform. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Supported Countries | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/platform/supported-countries#supported-countries) Supported Countries ----------------------------------------------------------------------------------------------------------------------------------------- Through our brokerage support, Option Alpha is available to traders in 120+ countries around the world. The list of [broker integrationsarrow-up-right](https://optionalpha.com/integrations) and supported countries is growing and subject to change. Brokerage firms may change their list of supported countries at any time, either to add or remove countries, so be sure to check with your broker to see if your country is supported. **The following countries are supported by TradeStation and Tradier Brokerage:** * United States * Åland Islands * Algeria * American Samoa * Andorra * Angola * Anguilla * Antarctica * Antigua and Barbuda * Argentina * Armenia * Aruba * Austria * Bahrain * Bangladesh * Belgium * Belize * Benin * Bermuda * Bhutan * Bolivia * Bonaire, Sint Eustatius and Saba * Bouvet Island * Brazil * British Indian Ocean Territory * Bulgaria * Cabo Verde * Chile * China * China, Hong Kona Special Administrative Region * China, Macao Special Administrative Region * Christmas Island * Cocos (Keeling) Islands * Colombia * Comoros * Congo * Cook Islands * Costa Rica * Côte d’Ivoire * Curacao * Cyprus * Czechia * Denmark * Djibouti * Dominica * Dominican Republic * Ecuador * Egypt * El Salvador * Equatorial Guinea * Estonia * Eswatini * Falkland Islands (Malvinas) * Faroe Islands * Fiji * Finland * France * French Guiana * French Polynesia * French Southern Territories * Gabon * Gambia * Germany * Greece * Greenland * Grenada * Guadeloupe * Guam * Guatemala * Guinea * Guinea-Bissau * Heard Island and McDonald Islands * Holy See * Honduras * Hungary * Iceland * India * Indonesia * Ireland * Isle of Man * Israel * Italy * Jamaica * Japan * Jersey * Kazakhstan * Kiribati * Kuwait * Kyrgyzstan * Lesotho * Liberia * Liechtenstein * Lithuania * Luxembourg * Madagascar * Malawi * Malaysia * Maldives * Marshall Islands * Martinique * Mauritania * Mayotte * Mexico * Monaco * Mongolia * Montserrat * Namibia * Nepal * Netherlands * New Caledonia * New Zealand * Niger * Niue * Norfolk Island * Northern Mariana Islands * Norway * Oman * Papua New Guinea * Paraguay * Peru * Pitcairn * Poland * Portugal * Qatar * Republic of Korea * Réunion * Romania * Rwanda * Saint Barthélemy * Saint Helena * Saint Kitts and Nevis * Saint Lucia * Saint Maarten (Dutch part) * Saint Martin (French part) * Saint Pierre and Miquelon * Saint Vincent and the Grenadines * Samoa * San Marino * Saudi Arabia * Serbia * Seychelles * Singapore * Slovakia * Slovenia * Solomon Islands * South Georgia and the South Sandwich Islands * Spain * State of Palestine * Suriname * Svalbard and Jan Mayen Islands * Sweden * Switzerland * Tajikistan * Thailand * Timor-Leste * Togo * Tokelau * Tonga * Turkmenistan * Turks and Caicos Islands * Tuvalu * United States Minor Outlying Islands * Uruguay * Uzbekistan * Virgin Islands (U.S.) * Wallis and Futuna Islands * Western Sahara * Zambia **In addition, TradeStation also supports the following countries:** * Australia * Azerbaijan * Bahamas * Brunei Darussalam * Cameroon * Cape Verde * Cayman Islands * Croatia * Czech Republic * Fed. States of Micronesia * Georgia * Gibraltar * Guernsey, C.I. * Hong Kong * Jordan * Lao People's Democratic Republic * Latvia * Mozambique * Nauru * Palau * Philippines * Puerto Rico * Republic of Moldova * Sao Tome and Principe * Scotland * South Africa * St. Vincent and the Grenadines * Taiwan * Trinidad and Tobago * Turkey * United Arab Emirates * United Kingdom of Great Britain and Northern Ireland * United Republic of Tanzania * Vietnam * Virgin Islands (British) **tastytrade supports the following international countries:** * Andorra * Argentina * Australia * Austria * Bahrain * Belgium * Bolivia * Bulgaria * Brazil * Chile * Colombia * Czech Republic * Denmark * Dominican Republic * Ecuador * Egypt * Estonia * Finland * France * French Polynesia * Germany * Greece * Hungary * Iceland * India (cash accounts only) * Indonesia * Ireland * Isle of Man * Israel * Italy * Kuwait * Malaysia * Monaco * Mexico * Namibia * Netherlands * New Zealand * Norway * Peru * Poland * Portugal * Romania * San Marino * Saudi Arabia * Singapore * Slovakia * Spain * Sweden * Switzerland * Taiwan * Thailand * UK * Uruguay Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Broker Rejection Errors | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/broker-rejection-errors#broker-rejection-errors) Broker Rejection Errors ------------------------------------------------------------------------------------------------------------------------------------------------------------ Each [brokerarrow-up-right](https://optionalpha.com/integrations) will have its own API-generated error message that is sent back to us if an error rejection is encountered on their end. Broker rejection errors can occur from a number of situations, including PDT violation, stepping on strikes, or an incompatible account type. This page will outline the most common error messages you might encounter when submitting orders on the autotrading platform through your brokers API. It is important to note that these error messages are returned from the broker and are not generated by Option Alpha or the autotrading platform. Each broker has their own unique error language, that will vary slightly depending on the direction of the rejected trade. This article is intended to help you determine the root cause for the error message that appears in your canceled order information. #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/broker-rejection-errors#common-broker-errors) Common Broker Errors [Overlapping or Stepping on Strikesarrow-up-right](https://optionalpha.com/help/overlapping-strikes-failsafe) If a new position order offsets the legs of an existing position, the broker will generate an error to prevent "stepping on" the existing legs. This error will display regardless of whether overlapping strikes occur within a single bot or two separate bots, and the broker does not differentiate between order origination within the same brokerage account. **Tastytrade** responds: "Order rejected by tastytrade: You cannot sell to open against a long position." **TradeStation** responds: "Order rejected by TradeStation: EC804: Boxed positions are not permitted. To close long position, try a "Sell" order" **Tradier** responds: "Order rejected by Tradier: Backoffice rejected override of the order. Unexpected SellShortOrder" [Duplicate Ordersarrow-up-right](https://optionalpha.com/help/duplicate-orders-error) In situations where you have a resting limit order that was created through your brokerage platform and a bot attempts to perform a closing action of its own for the same position, the broker will reject the order. **Tastytrade** responds: "Order rejected by tastytrade: You already have a closing order for \[symbol\] which must be canceled before this order can be routed" **TradeStation** responds: "Order rejected by TradeStation: EC703: You are long 1.00 shares with 1.00 remaining on sell orders!" **Tradier** responds: "Order rejected by Tradier: Backoffice rejected override of the order. ShortPositionCrossZero" [PDT (Pattern Day Trade)arrow-up-right](https://optionalpha.com/podcast/pattern-day-trading-rules-for-options) Pattern Day Trader restrictions are imposed by the brokerage and prevents people with less than $25,000 in their investment accounts from engaging in day trading. If an order violates the PDT rules each broker will respond with their own error and impose the restriction the following day. **Tastytrade** responds: "Order rejected by tastytrade: Account is set to closing only and this order has an opening leg." **TradeStation** responds: "Order rejected by TradeStation: EC501: Day trading margin rules, too many opening trades, please call Trade Desk" **Tradier** responds: "Order rejected by Tradier: Backoffice rejected override of the order. DayTraderPatternRestriction" **Broker Links** Additional rejection errors for Tradier can be found [here.arrow-up-right](https://documentation.tradier.com/brokerage-api/overview/errors) Additional rejection errors for TradeStation can be found [here.arrow-up-right](https://docs.google.com/spreadsheets/d/1ghxFlOwDvgdNhzQypKanf8Ihbgcl0cNlRgF5RwlxQLk/edit?usp=sharing) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Excessive Errors Failsafe | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/excessive-errors-failsafe#excessive-errors-failsafe) Excessive Errors Failsafe ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Bots have [safeguardsarrow-up-right](https://optionalpha.com/help/safeguards) that alert you when your automations encounter an error. Errors will show up on the homepage. The **“excessive errors” failsafe** is a protection that automatically turns off all automations if a bot encounters 10 errors in one day. When a bot hits the 10th automation error in one day, the bot's automations automatically turns off. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FCWFx6eGdUnGt71kTadVN%252Fimage.png%3Falt%3Dmedia%26token%3Da2242787-c034-42d9-a510-e1074d5544e5&width=768&dpr=3&quality=100&sign=80e76647&sv=2) You can view the error that triggered the alert by clicking “errors” in the bot dashboard’s activity summary. Errors are also displayed in the bot's log, and the automation log will provide more details. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FAgvtuJCqqF7lu2eR55iF%252Fimage.png%3Falt%3Dmedia%26token%3D4bb4b260-2c10-4c9d-8880-b282922de259&width=768&dpr=3&quality=100&sign=8ea63829&sv=2) circle-info If a bot hits the ten error limit in one day, you can always turn automations on again. However, if the bot encounters another error on the same day, the automations will turn off again for excessive errors. The excessive error count resets the next trading day. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Daily Symbol Limit Error | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/daily-symbol-limit-error#daily-symbol-limit-error) Daily Symbol Limit Error --------------------------------------------------------------------------------------------------------------------------------------------------------------- You will receive an error if a bot has more than 10 symbols, regardless of whether those symbols are referenced in a scanner, monitor, or event [automationarrow-up-right](https://optionalpha.com/help/automation-basics) . So, whether opening new positions, analyzing conditions, monitoring existing positions, or using a symbol as a custom input, the bot has a maximum allowance of 10 ticker symbols. If you have more than 10 symbols, an error will generate, the automation will stop, and you'll receive a notification that the bot has exceeded its symbol limit. This safeguard upholds the stability of the platform for all users. circle-info The bot references symbols at the beginning of the trading day. If you have 10 symbols assigned to a bot when the market opens, you must wait until after hours to change symbols to avoid the error. You can always add and replace symbols until you reach the limit. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fa5A7kxJJWUfX0Zq19wZb%252Fimage.png%3Falt%3Dmedia%26token%3D65ca15f5-092b-4777-9472-f91f2d47d9aa&width=768&dpr=3&quality=100&sign=8576cb66&sv=2) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Overlapping Strikes Failsafe | Option Alpha The overlapping strikes failsafe prevents bots from opening a position that overlaps another position or splits a position apart. The error occurs if the new position is in the same bot or same brokerage account as the existing position. An attempt to open a new position that overlaps the strike price of an existing position in the same bot (also known as “leg stomping”) triggers the overlapping strikes failsafe. This failsafe will only occur if the option contracts have the same underlying symbol, strike price, and expiration date. For example, “Bot A” has a SPY short put spread expiring March 17th with a $393 short put strike price and a $387 long put strike price. ![Bot A position details](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F63fd08c2c8762764823b0dc5_Overlapping%2520strike%2520prices.png&width=768&dpr=3&quality=100&sign=ca3137dc&sv=2) If you try to open a new position in "Bot A" with an overlapping contract for either leg, you will receive an alert from your broker in the platform. For example, you can't open a new SPY position with a March 17th $393 long put because the new order interferes with the existing open contract and the order would “cancel out” the existing $393 short put. > Only a deliberate closing order can close a position. The failed position will display an error message stating that the broker would not execute the trade because it would close an existing position. ![Overlap position broker rejection](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F63fd0f375a45d5eed875dff9_Broker%2520rejection%2520.png&width=768&dpr=3&quality=100&sign=e4ddd275&sv=2) The error position occupies an active position spot in your bot and will count against your total and daily position limits. You must [manually cancel the positionarrow-up-right](https://optionalpha.com/help/managing-positions) to create space for more positions. All bots within the Option Alpha platform operate independently. However, if two different bots are connected to the same brokerage account, the broker will alert you to the error. For example, if “Bot B” tries to open a position with a March 17th $393 long put in the same brokerage account as "Bot A," the broker will reject the order and you will receive an in-app notification. Although bots do not communicate with one another, the overlapping strikes failsafe prohibits the broker from executing the order because the positions are managed within the same brokerage account. Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Price Exceeds Strike-Difference Error | Option Alpha The '**price exceeds strike-difference**' error may be sent by the broker if the bot attempts to close a credit spread position with a price that is greater than the spread’s width. For example, if you have a $5 wide short put spread and send a limit oder through Option Alpha to close the position for more than $5, you might receive an error message. The close position order is rejected by the broker because credit spreads cannot exceed the strike difference. > **Important**: While all integrated brokers adhere to the rule of rejecting orders that exceed the spread's width, they may not all send a rejection error to the bot in Option Alpha. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F663a571674e363229ec7c070_Price%2520Exceeds%2520Strike.png&width=768&dpr=3&quality=100&sign=4fe9d6b4&sv=2) The position remains open after you receive the error. This failsafe is in place to protect you from overpaying and taking a larger loss than necessary on a spread position. Again, there is no guarantee it will trigger. We suggest using [Exit Option settings and safeguardsarrow-up-right](https://optionalpha.com/blog/expanded-smartpricing-settings-control-slippage) to control slippage and help mitigate pricing anomalies. Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Duplicate Orders Error | Option Alpha The Duplicate Orders Error occurs when a resting limit order in your brokerage platform duplicates or contradicts a bot's closing action order for the same position. ![Duplicat order rejection](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F63fd00366ac37ee0190f4b77_Duplicat%2520order%2520rejection.png&width=768&dpr=3&quality=100&sign=978a4dec&sv=2) For example, if there is already an order to exit a position, the broker won't accept an additional duplicate order. To avoid the broker rejection error, it is best to allow bots to manage positions. If you prefer to take control of an active position in your brokerage platform, use the [manual overridearrow-up-right](https://optionalpha.com/help/managing-positions) to prevent the error when the bot attempts to close the position. Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Option & Expiration Availability | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/option-and-expiration-availability#option-and-expiration-availability) Option & Expiration Availability ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If the option leg or expiration you choose isn't available based on your settings, you'll receive a 'Requested option not found' error or a 'No option expiration available' warning. For example, if you choose an expiration date that is 'exactly 30 days,' but there are no option contracts available for the underlying security, you'll receive a warning. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FohM1RFYVjojRlKlP0Vcp%252Fimage.png%3Falt%3Dmedia%26token%3D335a4efd-ddf3-4ad8-bc74-f4c8a5e4f3fc&width=768&dpr=3&quality=100&sign=7d2021dd&sv=2) Similarly, when [opening positionsarrow-up-right](https://optionalpha.com/help/automated-trades) , you can specify detailed instructions for each leg, but there may not always be an option contract that meets your criteria. If you select a specific criteria, such as 'Long call leg is $5 above short call leg **exactly**,' and there's no option contract that fits that description, you'll receive an error. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FcpTJQMX6nQnlsYAtuHEQ%252Fimage.png%3Falt%3Dmedia%26token%3D172079ed-d074-4fa8-bd52-1d766377be89&width=768&dpr=3&quality=100&sign=6b261986&sv=2) To avoid these errors and warnings, you can use the ['Opportunity is available' decision recipearrow-up-right](https://optionalpha.com/help/evaluating-opportunity-availability) to check if the exact position is available. If it's not available, the automation will stop without alerting you. This can help you avoid multiple notifications. Once the position type becomes available, the automation will continue as usual. It's worth noting that more option contracts typically become available as expiration approaches and demand for options increases. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Profit and Loss | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#profit-and-loss) Profit and Loss --------------------------------------------------------------------------------------------------------------------------------- The bot dashboard shows the lifetime position metrics for a bot. The daily P&L chart requires at least 3 data points, i.e., 3 closing values on the portfolio across 3 market days before a graph is displayed. The active profit and loss value is updated each time the page is refreshed. The Activity Window will summarizes all bot activity. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F648713d804ed8882c4cb8679_Profit%2520and%2520Loss.png&width=768&dpr=3&quality=100&sign=b37818ff&sv=2) circle-info All End-of-Day profit and loss calculations are settled daily at 4:15 Eastern Time (ET) During the 15-minute period after the close, bid/ask spreads can become extremely wide which will cause the Daily P/L on your bot dashboard to become skewed. Do not panic! ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#activity-window) Activity Window The activity window provides a snapshot overview of the total count for bot automations and decisions along with daily counts for open and closed positions. In addition, any tickers that have been referenced and any warnings or errors are also shown on a daily basis. [Warnings and errorsarrow-up-right](https://docs.optionalpha.com/platform-1/troubleshooting/capital-warnings) will be cleared and reset prior to the market opening the following day. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F64da7e04d351c3cab9547b21_profit%2520and%2520loss%2520table.png&width=768&dpr=3&quality=100&sign=8be6028&sv=2) #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#available-capital-example) Available Capital (Example) Assume a new bot is allocated $2,500 capital. 1) The bot opens a $5 wide short put spread and receives $1.75 ($175) credit. 2) Another $5 wide short put spread opens for a $1.50 ($150) credit. The bot now has $2,825 in capital (original allocation $2,500 + $175 + $150). Both short put spread have a $500 maintenance. The total maintenance requirement for the open positions is $1,000. $2,825 - $1,000 = $1,825. The $1,825 is the available capital. circle-info The Available Capital calculation includes pending orders to prevent exceeding max allocation. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#performance-metrics) Performance Metrics #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#total-p-l-and-return) Total P/L & Return % The active profit and loss value is updated each time the page is refreshed and is the total of both active and closed positions (realized and unrealized gains or losses). Return on investment measures the effectiveness of an investment relative to its initial cost of entry. ROI divides the return of an investment by the cost of the investment. For example, if an investment cost $5,000 to purchase and is now worth $6,000, the ROI for the investment is 20% ($6,000-$5,000 = $1,000 / $5,000). #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#change-and-change) Change & Change % The Change P/L and Change % measure the change in P/L from yesterday. Change % is the change in P/L between yesterday and today divided by yesterday's bot "value" (the total worth of the bot, including open positions). When the bot has no previous day's value that can be used, the allocation is used to provide a starting value. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#win-rate) Win Rate The win rate divides the total number of winning trades by total trades. For example, if an investor has placed 200 trades and has realized a profit on 120 of them, the win rate is 60% (120/200). While the win rate can identify how successful trades are at generating profit, it is not as important as the profit factor or how much is gained or lost on each trade. For example, an investor may have a 60%-win rate, but if they lose 3x as much when they lose as they make when they win, they will still lose capital over time. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#profit-factor) Profit Factor The profit factor divides the total amount of money gained by the total amount of money lost. Profit factor is important when used in conjunction with the win rate because it creates a more complete view of trading performance. For example, if an investor has placed 200 trades with a win rate of 60% and averages $50 per winning trade and $50 per losing trade, their profit factor will be 1.5 with a net profit of $2000 ((120 x $50 = $6,000) / (80 x $50 = $4,000)). Compare this with an investor who has a 60%-win rate on 200 trades but a profit factor of .5 because they average $50 per winning trade, but $150 per losing trade ((120 x $50 = $6,000) / (80 x $150 = $12,000)). They will have a net loss of -$6,000, despite the same win rate. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#max-drawdown) Max Drawdown Maximum drawdown is a measure of the greatest fall in value from the peak high point to the lowest point before a new peak is achieved. This is also displayed as a percentage to further help identify how drastic of a peak to valley drawdown has been experienced over the course of the charted performance graph. If the bot's P/L value does not cross below 0, the performance graph will use 0 as the low point anchor and only display a maximum peak value alongside the current P/L value. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#averages) Averages Avg P/L is the average gain or loss for all closed positions. (Closed P/L ÷ Closed positions). Avg Win is the average gain for all winning positions. (Closed P/L of winning trades ÷ Number of winning trades) Avg Loss is the average loss for all losing positions. (Closed P/L of losing trades ÷ Number of losing trades) #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#position-value) Position Value The position "value" is a function of the currentPrice of a share or contract multiplied by the number of contracts, where the currentPrice is synonymous with the matched opportunity mark. Each Position is tracked as a combination of legs, where each leg has/is a security object. Every time we quote the Position, we build an opportunity out of all of the position legs and compare it to the saved values for where the Position opened to provide an accurate quote. For example, if we have a 425/400 short put spread and we want to know the P/L, we pull quotes for the 425 put and 400 put independently and then combine them into a short put spread opportunity. This provides the value X of this short put spread right now and now subtract the value of the original position, Y, from X, and that's the P/L. To obtain the total open P/L, sum the resultant values for every open position. ### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#differences-between-option-alpha-and-broker-p-l) Differences between Option Alpha and Broker P/L It's important to note that the P/L displayed on the Option Alpha platform may differ from what is shown on your brokerage platform or statements. In this article, we'll explore the reasons that may cause traders to notice a difference when comparing P/L on Option Alpha and their brokerage platform. Option Alpha receives order IDs and fill prices directly from the broker. While this data exchange ensures accuracy, it is essential for traders to cross-reference this information with their broker's platform to ensure consistency. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#valuation-methodology) **Valuation Methodology** One significant distinction lies in how Option Alpha and brokers evaluate the value of positions. Option Alpha values all positions based on the mid price of the entire position. In contrast, brokers often evaluate individual legs using the Last trade price. This difference exists because brokerage platforms allow traders to manage legs individually or together. Option Alpha justifies the use of the mid price as the best representation of a position's value as that represents a likely exit price, making it a more accurate measure of its potential value. By avoiding reliance on the Last trade price of any one leg, Option Alpha ensures that individual leg prices don't throw off the overall evaluation. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#wash-sale-rule-and-accounting-methods) **Wash Sale Rule and Accounting Methods** Broker statements might reflect the [Wash Sale rulearrow-up-right](https://optionalpha.com/learn/stock-wash-sale) in effect, which disallows the immediate repurchase of a security after selling it at a loss for tax purposes. This can lead to variations in P/L calculations between Option Alpha and brokerage platforms. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#exclusion-of-commissions-and-fees) **Exclusion of Commissions and Fees** Option Alpha does not include any commission or exchange fees in its P/L calculations. This approach simplifies the assessment of a position's performance and allows traders to focus solely on the market movement impact. Although generally only a few cents per trade, exchange and transactional fees can add up over time and create a noticeable difference when comparing P/L. Each broker has their own fee schedule, which you can reference for an overview of any associated fees. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#understanding-the-change-column) **Understanding the Change Column** On the Bots homepage of Option Alpha, the Change column represents the change in a position's value from one day to the next. It does not reflect the actual value of the position. For example, if a position’s value was $100 at market close yesterday and is now valued at $200, the Change column will display the difference, which is $100. This is not the same as a Day P/L or Open P/L column that you may see on the broker platform, which is showing you the value of positions today only, and not the day-to-day change. Additionally, the Change column from the main Bots page will include the Change of any closed positions today. This makes it common for the two Change column values to be different from one another. One viewpoint reflects all change, including closed positions, the other is only active open positions. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#after-hours-pricing) **After hours pricing** The most common discrepancy is caused by after-hours pricing. When the market closes, the spread prices of the underlying position widen out, which causes wild misrepresentations of the position's value. Upon the market reopening the following day, the values, and underlying spreads come back into normal alignment. If you are looking at positions outside of normal market hours, do not be alarmed if your position value is not what you expect. #### [hashtag](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#overridden-positions) **Overridden Positions** As mentioned in our [Order Handlingarrow-up-right](https://docs.optionalpha.com/platform-1/order-handling) page, the most common reason for differences between the two platforms is due to overridden In The Money positions that were released before expiration by our Option Expiration Protocol. Be sure to keep an eye on your expiring positions and if you intend to let In The Money positions expire, update the closed value based on the settlement price reflected in your brokerage account. Last updated 2 months ago Was this helpful? * [Profit and Loss](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#profit-and-loss) * [Activity Window](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#activity-window) * [Performance Metrics](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#performance-metrics) * [Differences between Option Alpha and Broker P/L](https://docs.optionalpha.com/technical-documentation/calculations/profit-and-loss#differences-between-option-alpha-and-broker-p-l) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Bot Event Loops | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/bot-event-loops#bot-event-loops) Bot Event Loops ------------------------------------------------------------------------------------------------------------------------------------ Bots have safeguards and limits that alert you when an automation encounters an error. These safeguards were created to protect traders and require you to think critically about your trade setup from entry to exit. Bot event loops typically occur in bots that run on event triggers. The error can happen if you’re not careful when using open position or close position actions inside an automation. Bots have [position limitsarrow-up-right](https://optionalpha.com/help/position-limits) and [capital allocation limitsarrow-up-right](https://optionalpha.com/help/capital-warnings) for an important reason. The limits prevent the bot from entering a “looping” scenario where it opens and closes positions beyond the limits you’ve set in the bot’s global settings. “Position opened” triggers tell the bot to run an automation once instantly after the bot opens a position. “Position closed” triggers tell the bot to run an automation as soon as a position is closed. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FjWSIafme5haWO77SrzZz%252Fimage.png%3Falt%3Dmedia%26token%3D8e124b78-f361-41cb-b6ce-410508a0d7c3&width=768&dpr=3&quality=100&sign=8da2ab95&sv=2) Event loops are a unique situation where positions are opened or closed because of related events and subsequently become stuck in a “loop.” For example, an event could automatically open a position when another is closed. Closing the position could trigger another event that immediately opens a new position, thereby causing the bot to enter and exit positions in an endless loop. The event loop will cause the bot to reach its daily and/or total position limit. The bot event loop error is a specific, deliberate error you can encounter if you’re not careful setting up your event automation actions Be sure to always think through the process when creating your bots, and don’t forget to [test your automationsarrow-up-right](https://optionalpha.com/help/testing-automations) and paper trade to avoid these situations! Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Capital Warnings | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/capital-warnings#capital-warnings) Capital Warnings --------------------------------------------------------------------------------------------------------------------------------------- The “Not Enough Available Capital” warning occurs when a trade is attempted and the bot does not have sufficient funds available to cover the position. Although there may be enough capital allocated to the bot for any single trade, some of that capital may already be in use for other opened trades. See the Capital section of the bot's Dashboard for a description of currently available funds. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252Fh48sK5dkMoNx2yBIllr5%252F66b26871943baac68502d345_63f921e7172f44017b6c3747_Not20capital.png%3Falt%3Dmedia%26token%3De31bf80e-e699-438c-985a-aa33e9412658&width=768&dpr=3&quality=100&sign=b20568a3&sv=2) You can always edit your bot's allocation in the Safeguards section of the Settings tab. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F66b26871943baac68502d337_66b26869a7f877638686ed0b_bot-safeguards.png&width=768&dpr=3&quality=100&sign=43db1791&sv=2) More details on position allocation can be found [here.arrow-up-right](https://docs.optionalpha.com/platform-1/automations/automation-behavior) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Missing or Invalid Input | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/missing-or-invalid-input#missing-or-invalid-input) Missing or Invalid Input --------------------------------------------------------------------------------------------------------------------------------------------------------------- When an automation encounters an [input](https://docs.optionalpha.com/tools/bots/inputs) with a missing value or an input that is incorrectly linked, an error alerts you that this input has an invalid, or missing, value. The most common example of this is when inputs are established outside of a [Symbol Loop or Position Loop](https://docs.optionalpha.com/tools/bots/loops) . Each loop supplies a default input for its position or symbol, which is intended to be used throughout the automation when referencing symbol or position, so the two are connected. If a symbol or position input is used in place of the Loops default action input when the automation processes, it encounters a _position_ or _symbol_ that does not stem from the loop and can not validate. In other words, the _position_ or _symbol_ it is referencing is not valid because it is not married to the loop. circle-info When building automations that utilize a position or symbol loop, it's important to remember to establish your Loop before the other decisions and then link any symbol or position value to the default action that is supplied with the loop. The error most commonly occurs when a symbol or position loop has been established and used throughout an automation, and the automation is subsequently modified, thereby breaking the link between the loop and inputs. If you've edited your automation and the input is impacted, you'll need to remove the existing input and re-link it to the loop. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FhkTa2NBgyKOu6G7dhgYs%252FCleanShot%25202026-03-20%2520at%252012.53.06.png%3Falt%3Dmedia%26token%3D69920289-1687-4239-8c2d-aa5b9599f22c&width=768&dpr=3&quality=100&sign=9545fc47&sv=2) Last updated 26 days ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Invalid Authorization Error | Option Alpha Each broker associated with your Option Alpha account can have only one set of credentials authorized. These credentials provide access to the accounts linked to that username and password. If you change your brokerage account settings, password, or authorize a new set of credentials after authorizing an account, the existing authorization will become invalid. If an account is no longer authorized, any attempts to trade in that account will result in an "Invalid Authorization" error. To avoid this error, it's crucial to authorize only one primary set of credentials. If any changes are made to the connected brokerage account, you must reauthorize the connection on Option Alpha. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Fcdn.prod.website-files.com%2F5fba23eb8789c3c7fcfb5f31%2F641b69730b813e35a59e17d6_Invalid%2520Authorization.png&width=768&dpr=3&quality=100&sign=44cef219&sv=2) ‍ If you plan to use multiple accounts at your brokerage, you must contact their support team and group them under one username login. You should then exclusively use this username to avoid any authorization-related errors. Last updated 1 month ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Trade Enforcements | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#trade-enforcements) Trade Enforcements --------------------------------------------------------------------------------------------------------------------------------------------- The autotrading platform employs a system of enforcements and safeguards in the form of Warnings and Errors to ensure the platform's stability. Warnings include Not Enough Capital, Pricing Anomaly, Daily and Total Position Limit, and No Expiration Available. These warnings do not count toward the [Excessive Error Failsafearrow-up-right](https://optionalpha.com/help/excessive-errors-failsafe) limit prior to a bot auto-shutdown. Errors include Leg Enforcements, Unable to Calculate Quantity, Daily Underlying Symbol Limit, and Broker Rejection errors for Overlapping Strikes, Price Exceeds Strike-Difference, and Options Approval Level among others. More information on the various warnings and errors you might encounter when using bots can be found inside the Help Center [Troubleshooting arrow-up-right](https://optionalpha.com/docs/troubleshooting) section. ### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#leg-enforcements) **Leg Enforcements** When specifying a type of position to open, the structure of that position will be enforced in accordance with the definition of that position. The auto trading platform will require option legs of a trade to have a structure that reflects the correct structure of that trade type. #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#leg-enforcement-for-credit-and-debit-spreads) **Leg Enforcement for Credit and Debit Spreads** A credit spread (short call spread or short put spread), by definition, is an options trade where the sold leg is at a higher delta than the delta of the leg purchased. And vice versa for a debit spread (long call spread or long put spread) where the leg purchased is at a higher delta than the sold leg. The auto trading platform will not permit you to select a "put credit spread" and structure it as if it were a put debit spread. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FtLQZd0L8M1UuJncZXYXb%252Fimage.png%3Falt%3Dmedia%26token%3Ded29701c-a2e8-4c52-9dff-14cdae401063&width=768&dpr=3&quality=100&sign=9598baac&sv=2) #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#leg-enforcement-for-iron-condors) **Leg Enforcement for Iron Condors** An Iron Condor is a delta-neutral strategy composed of two credit spreads, one on either side of the underlying price. The width of the iron condor can vary, but the structure will be the same and enforced by the auto trading platform. An Iron Condor will always have 4 different strike prices comprising the entire position. It will not be possible to "buy" an iron condor where the purchased deltas are higher than the sold deltas. The delta sold for both the call and the put will be at a higher respective delta than the deltas of the legs that are purchased. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FvMvtYk3kDXvk4JdwzOmx%252Fimage.png%3Falt%3Dmedia%26token%3Db5b630d1-946f-4e2f-8f27-0bf44bd7e594&width=768&dpr=3&quality=100&sign=d608db80&sv=2) #### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#leg-enforcement-for-iron-butterflies) **Leg Enforcement for Iron Butterflies** On the other hand, an Iron Butterfly is an options strategy designed to profit from decreasing implied volatility. It is made up of 3 strikes where the butterfly's body is created by selling two options, a call, and a put, of the exact same strike price. The wings are created by buying a call and a put that are a certain distance from the strikes which make up the body of the butterfly. This is key to understanding the auto trading platform's enforcement of strikes. An Iron Butterfly is unique from an Iron Condor in that the Iron Butterfly has two short strikes, one call, and one put, of the exact same delta. Where the Iron Condor has four strikes of any delta. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FiZPdwgo5axP4VIBWY5SN%252Fimage.png%3Falt%3Dmedia%26token%3D1dcfba3e-17c5-4b00-8276-75c7345e04ea&width=768&dpr=3&quality=100&sign=468cfddb&sv=2) circle-exclamation **The Iron Butterfly trade type implies strict enforcement that the middle strikes are equal.** ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FJfOFF9Yc9pNqmwjG3AAv%252Fimage.png%3Falt%3Dmedia%26token%3Dbd6f815a-8266-4311-9e34-9cd92a8d3525&width=768&dpr=3&quality=100&sign=222f4e91&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#unable-to-find-requested-option-leg) Unable to find Requested Option Leg In cases where the option being asked for is not available on the underlying chain, the automation will return an error for Unable to find Requested \[put/call\] Option. Typically, this error is thrown when attempting to select the _exactly_ offset, and exactly what you have asked for is not available. **Example:** **‍**Short Put Spread Short Put leg = -.50 delta or closest Long Put leg = $5 below the underlying price **exactly** Unless the underlying price minus $5 equals the exact value of an available strike an error would be thrown. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FOYMn496LJyVj4qniXNn4%252Fimage.png%3Falt%3Dmedia%26token%3D6cbda99e-859c-48ae-9900-005608859598&width=768&dpr=3&quality=100&sign=9c952d3b&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#unable-to-calculate-quantity-error) Unable to Calculate Quantity Error When the quantity is undeterminable or less than one, this error is generated. For example, If a trade inputs 0 for the number of shares in the Open Position action quantity field, the following error message will be thrown as 0 is not a tradeable amount. Additionally, you could see this in situations where an input for the quantity field is not properly saved. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FB87yMQQSWe3omLD6EpXn%252Fimage.png%3Falt%3Dmedia%26token%3Dd44a23ed-2394-4862-870a-20b74eb0d329&width=768&dpr=3&quality=100&sign=f4da842c&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#no-option-expiration-available-warning) No Option Expiration Available Warning When the bot attempts to open a position and the underlying does not have a contract at the specified expiration, the No Option Available warning will be thrown. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FHA81Oc1kPGVM75bu2iHK%252Fimage.png%3Falt%3Dmedia%26token%3D76cfe8c9-a860-4662-81e2-712acc895116&width=768&dpr=3&quality=100&sign=d19c8bbd&sv=2) Last updated 2 months ago Was this helpful? * [Trade Enforcements](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#trade-enforcements) * [Leg Enforcements](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#leg-enforcements) * [Unable to find Requested Option Leg](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#unable-to-find-requested-option-leg) * [Unable to Calculate Quantity Error](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#unable-to-calculate-quantity-error) * [No Option Expiration Available Warning](https://docs.optionalpha.com/technical-documentation/troubleshooting/trade-enforcements#no-option-expiration-available-warning) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # ATR | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/atr#atr) ATR ------------------------------------------------------------------------------------------- **The Average True Range (ATR)** is a technical indicator of volatility based on the average of a particular set of trading ranges over a defined number of periods. The ATR is the average of the true range for a set of periods. The greatest of one of three ranges is calculated as the true range for a period: the current high minus the current low, the current high minus the previous period’s close, or the current low minus the previous close. Once the true range is calculated, the average for a set lookback period is taken, typically 14 periods. A decline in ATR indicates a decrease in recent volatility. An increase in ATR indicates an increase in recent volatility. The source code for the ATR function is available [herearrow-up-right](https://app.optionalpha.com/ta/ATR.txt) . Copy /* Average True Range is the greatest of the following: * * val1 = distance from today's high to today's low. * val2 = distance from yesterday's close to today's high. * val3 = distance from yesterday's close to today's low. * * These value are averaged for the specified period using * Wilder method. This method has an unstable period comparable * to an Exponential Moving Average (EMA). */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # EMA | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/ema#ema) EMA ------------------------------------------------------------------------------------------- An exponential moving average (EMA) is the weighted average of a set of data points where new data points receive greater weight in the average calculation. An exponential moving average is a technical indicator of a trend that responds faster to new data points than a simple moving average because a multiplier is used to give preference to the new data points and reduce lag in responsiveness to price movements. The source code for the EMA function is available [herearrow-up-right](https://app.optionalpha.com/ta/EMA.txt) . Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # ROC | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/roc#roc) ROC ------------------------------------------------------------------------------------------- Rate of change (ROC) is a technical indicator of momentum that measures the percentage change in price from period to period. Rate of change is also referred to as “momentum” and is often used to confirm trends. For example, when a security reaches a new high but the rate of change does not, then there is a negative divergence between price and momentum. The source code for the ROC function is available [herearrow-up-right](https://app.optionalpha.com/ta/ROC.txt) . Copy /* The interpretation of the rate of change varies widely depending * which software and/or books you are refering to. * * The following is the table of Rate-Of-Change implemented in TA-LIB: * MOM = (price - prevPrice) [Momentum] * ROC = ((price/prevPrice)-1)*100 [Rate of change] * ROCP = (price-prevPrice)/prevPrice [Rate of change Percentage] * ROCR = (price/prevPrice) [Rate of change ratio] * ROCR100 = (price/prevPrice)*100 [Rate of change ratio 100 Scale] * * Here are the equivalent function in other software: * TA-Lib | Tradestation | Metastock * ================================================= * MOM | Momentum | ROC (Point) * ROC | ROC | ROC (Percent) * ROCP | PercentChange | - * ROCR | - | - * ROCR100 | - | MO * * The MOM function is the only one who is not normalized, and thus * should be avoided for comparing different time serie of prices. * * ROC and ROCP are centered at zero and can have positive and negative * value. Here are some equivalence: * ROC = ROCP/100 * = ((price-prevPrice)/prevPrice)/100 * = ((price/prevPrice)-1)*100 * * ROCR and ROCR100 are ratio respectively centered at 1 and 100 and are * always positive values. */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # CCI | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/cci#cci) CCI ------------------------------------------------------------------------------------------- The Commodity Channel Index​ (CCI) is a momentum-based oscillator used to help determine when an investment vehicle is reaching a condition of being overbought or oversold. This technical indicator measures the difference between the current price and the historical average. It assesses trend direction and strength, allowing traders to determine if they want to enter, exit, or avoid placing a trade. The source code for the CCI function is available [herearrow-up-right](https://app.optionalpha.com/ta/CCI.txt) . Copy /* Return CCI (Commodity Chanel Index) for n bars close price. *​ * CCI = (Typical Price − MA) / 0.015 * Mean Deviation * * where: * Typical Price = ∑P((H + L + C) / 3)) * P = number of bars (period) * MA = Moving Average = (∑P Typical Price) / P * Mean Deviation=(∑P | Typical Price - MA |) / P */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # CMO | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/cmo#cmo) CMO ------------------------------------------------------------------------------------------- The Chande momentum oscillator is a technical momentum developed by Tushar Chande. His formula calculates the difference between the sum of recent gains and the sum of recent losses and then divides the result by the sum of all price movements over the same time period. The indicator oscillates between +100 and -100 and is similar to other momentum indicators such as Welles Wilder’s RSI. It measures momentum on both up and down days and does not smooth results. This method triggers more frequent oversold and overbought occurrences. An instrument is considered to be overbought when the Chande momentum oscillator is above +50 and oversold when it is below -50. The oscillator can be used as a confirmation signal when it crosses above or below the 0 line. Trend strength can also be measured using the CMO as the oscillator's value denotes the strength or weakness of the expected trend. Bear in mind that the chosen time frame will affect the signals generated by the indicator. The source code for the CMO function is available [herearrow-up-right](https://app.optionalpha.com/ta/CMO.txt) . Copy /* CMO calculation is mostly identical to RSI. * * The only difference is in the last step of calculation: * * RSI = gain / (gain+loss) * CMO = (gain-loss) / (gain+loss) * * See the RSI function for potentially some more info * on this algo. */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # MACD | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/macd#macd) MACD ---------------------------------------------------------------------------------------------- The [moving average convergence/divergence (MACD)arrow-up-right](https://optionalpha.com/analysis/technical-indicators#macd) is a technical indicator of [momentumarrow-up-right](https://optionalpha.com/analysis/momentum-trend) that uses moving averages to determine a trend’s strength. The MACD uses three exponential moving averages (a short term, a long term, and the average difference between the short and long term) to show price momentum. The source code for the MACD function is found [here.arrow-up-right](https://app.optionalpha.com/ta/MACD.txt) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # MFI | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/mfi#mfi) MFI ------------------------------------------------------------------------------------------- The Money Flow Index (MFI) is a technical indicator that generates overbought or oversold signals using both price and volume data. An MFI reading above 80 is considered overbought and an MFI reading below 20 is considered oversold. MFI levels of 90 and 10 are also used as thresholds. The source code for the MFI function is available [herearrow-up-right](https://app.optionalpha.com/ta/MFI.txt) . Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # RSI | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/rsi#rsi) RSI ------------------------------------------------------------------------------------------- The relative strength index (RSI) is a technical indicator of momentum that measures the speed and change of price on a scale of 0 to 100, typically over the past 14 periods. Readings over 70 are considered overbought while readings below 30 are considered oversold. The source code for the RSI function is available [herearrow-up-right](https://app.optionalpha.com/ta/RSI.txt) . Copy /* Often documentation present the RSI calculation as follow: * RSI = 100 - (100 / 1 + (prevGain/prevLoss)) * * The following is equivalent: * RSI = 100 * (prevGain/(prevGain+prevLoss)) * * The second equation is used here for speed optimization. */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # ADX | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/adx#adx) ADX ------------------------------------------------------------------------------------------- **Average Directional Index** - The average directional index (ADX) is a technical analysis indicator used by some traders to determine the strength of a trend. According to the creator Welles Wilder, the trend has strength when ADX is above 25 and the trend is weak or the price is trendless when ADX is below 20. Non-trending values do not necessarily mean the price isn't moving, it very well could be, but the price could also be making a trend change or is too volatile for a clear direction to be present. ADX is considered a non-directional indicator and registers trend whether the price is going up or down. The default setting is 14 bars, although other time periods can be used to increase or decrease the trend strength reading. ADX is plotted as a single line with values ranging from a low of 0 to a high of 100. The source code for the ADX function is available [herearrow-up-right](https://app.optionalpha.com/ta/ADX.txt) . Copy /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * * Case 1: Case 2: * C| A| * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) * A| | D| * | D| * B| * * Case 3: Case 4: * C| C| * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) * A| | | * | | D| * B| | * D| * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 * | | -DM1 = 0 | | -DM1 = 0 * | D| | | * B| B| D| * * * Case 7: * * C| * A| | * | | +DM=0 * B| | -DM=0 * D| * * In case 3 and 4, the rule is that the smallest delta between * (C-A) and (B-D) determine which of +DM or -DM is zero. * * In case 7, (C-A) and (B-D) are equal, so both +DM and -DM are * zero. * * The rules remain the same when A=B and C=D (when the highs * equal the lows). * * When calculating the DM over a period > 1, the one-period DM * for the desired period are initialy sum. In other word, * for a -DM14, sum the -DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: * * Previous -DM14 * Today's -DM14 = Previous -DM14 - -------------- + Today's -DM1 * 14 * * (Same thing for +DM14) * * Calculation of a -DI14 is as follow: * * -DM14 * -DI14 = -------- * TR14 * * (Same thing for +DI14) * * Calculation of the TR14 is: * * Previous TR14 * Today's TR14 = Previous TR14 - -------------- + Today's TR1 * 14 * * The first TR14 is the summation of the first 14 TR1. See the * TA_TRANGE function on how to calculate the true range. * * Calculation of the DX14 is: * * diffDI = ABS( (-DI14) - (+DI14) ) * sumDI = (-DI14) + (+DI14) * * DX14 = 100 * (diffDI / sumDI) * * Calculation of the first ADX: * * ADX14 = SUM of the first 14 DX * * Calculation of subsequent ADX: * * ((Previous ADX14)*(14-1))+ Today's DX * ADX14 = ------------------------------------- * 14 * * Reference: * New Concepts In Technical Trading Systems, J. Welles Wilder Jr */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # KAMA | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/kama#kama) KAMA ---------------------------------------------------------------------------------------------- The Kaufman Adaptive Moving Average (KAMA) indicator belongs to the group of adaptive moving averages. Like all moving averages, the KAMA can be used to visualize the trend. This powerful trend-following indicator is based around the Exponential Moving Average (EMA) and is responsive to both trend and volatility. It closely follows price when noise is low and attempts to smooth out market noise when price fluctuates. The source code for the KAMA function is available [herearrow-up-right](https://app.optionalpha.com/ta/KAMA.txt) . Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # SMA | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/sma#sma) SMA ------------------------------------------------------------------------------------------- A simple moving average (SMA) is an arithmetic average of a set of data points where each data point is added together and then divided by the total number of data points. For example, a 10-period simple moving average finds the closing price of the last 10-periods, sums the 10 closing prices, and divides by 10 to calculate the average closing price of the previous 10 periods. New periods are then added to the calculation and the oldest period is deleted from the calculation. The source code for the SMA function is available [herearrow-up-right](https://app.optionalpha.com/ta/SMA.txt) . Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # STOCH | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/stoch#stoch) STOCH ------------------------------------------------------------------------------------------------- The [stochastic oscillatorarrow-up-right](https://optionalpha.com/analysis/technical-indicators#stochastic-oscillator) is a technical indicator of momentum that shows where the closing price for a period fits in the relative high-low range of a lookback period, typically 14 periods. The stochastic oscillator expresses the closing price for a period as a percentage of the recent high and low for a security. The most recent closing price is the most important data point in the calculation. The stochastic oscillator is plotted as two lines. The first line is the current stochastic oscillator percentage value, and the second line is a three-day simple moving average of the percentage value. These are known as %K and %D, respectively. Source code for the Stochastic Oscillator function is available [here.arrow-up-right](https://app.optionalpha.com/ta/STOCH.txt) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # WILLIAMS %R | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/williams-r#williams-r) WILLIAMS %R ----------------------------------------------------------------------------------------------------------------- **Williams %R**, or Williams Percent Range, is a momentum indicator that moves between 0 and -100 and measures overbought and oversold levels. The indicator is very similar to the Stochastic oscillator and is generally used in the same way. It was developed by Larry Williams, and it compares a stock’s closing price to the high-low range over a specific period, typically 14 days or periods. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # STOCH RSI | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/stoch-rsi#stoch-rsi) Stoch RSI ------------------------------------------------------------------------------------------------------------- **The Stochastic RSI (StochRSI)** is an indicator that ranges between zero and 100 and is created by applying the Stochastic oscillator formula to a set of relative strength index (RSI) values rather than to standard price data. Using RSI values within the Stochastic formula gives traders an idea of whether the current RSI value is overbought or oversold. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # DX | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/dx#dx) DX ---------------------------------------------------------------------------------------- The directional movement index (DX) is an indicator that identifies which direction the price of an asset is moving. The DX indicator is generally part of the Directional Movement Index (DMI) The indicator functions by comparing prior highs and lows and drawing two lines. A negative directional movement line (-DI) and a positive directional movement line (+DI). An optional third line called the Directional Index (DX) or sometimes Average Directional Index (ADX) can also be used to gauge the strength of the uptrend or downtrend. The source code for the DX function is available [herearrow-up-right](https://app.optionalpha.com/ta/DX.txt) . Copy /* * The DM1 (one period) is base on the largest part of * today's range that is outside of yesterdays range. * * The following 7 cases explain how the +DM and -DM are * calculated on one period: * * Case 1: Case 2: * C| A| * | | C| * | +DM1 = (C-A) B| | +DM1 = 0 * | -DM1 = 0 | -DM1 = (B-D) * A| | D| * | D| * B| * * Case 3: Case 4: * C| C| * | A| | * | +DM1 = (C-A) | | +DM1 = 0 * | -DM1 = 0 B| | -DM1 = (B-D) * A| | | * | | D| * B| | * D| * * Case 5: Case 6: * A| A| C| * | C| +DM1 = 0 | | +DM1 = 0 * | | -DM1 = 0 | | -DM1 = 0 * | D| | | * B| B| D| * * * Case 7: * * C| * A| | * | | +DM=0 * B| | -DM=0 * D| * * In case 3 and 4, the rule is that the smallest delta between * (C-A) and (B-D) determine which of +DM or -DM is zero. * * In case 7, (C-A) and (B-D) are equal, so both +DM and -DM are * zero. * * The rules remain the same when A=B and C=D (when the highs * equal the lows). * * When calculating the DM over a period > 1, the one-period DM * for the desired period are initialy sum. In other word, * for a -DM14, sum the -DM1 for the first 14 days (that's * 13 values because there is no DM for the first day!) * Subsequent DM are calculated using the Wilder's * smoothing approach: * * Previous -DM14 * Today's -DM14 = Previous -DM14 - -------------- + Today's -DM1 * 14 * * Calculation of a -DI14 is as follow: * * -DM14 * -DI14 = -------- * TR14 * * Calculation of the TR14 is: * * Previous TR14 * Today's TR14 = Previous TR14 - -------------- + Today's TR1 * 14 * * The first TR14 is the summation of the first 14 TR1. See the * TA_TRANGE function on how to calculate the true range. * * Calculation of the DX14 is: * * diffDI = ABS( (-DI14) - (+DI14) ) * sumDI = (-DI14) + (+DI14) * * DX14 = 100 * (diffDI / sumDI) * * Reference: * New Concepts In Technical Trading Systems, J. Welles Wilder Jr */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # GEX | Option Alpha ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#what-is-gamma-exposure-gex) What is Gamma Exposure (GEX)? Gamma is an option greek that measures the rate at which the delta for an option contract will change based on +/- $1 change in the underlying price. Since market makers seek to maintain a delta neutral (delta = 0) portfolio, gamma "exposure" gives insight into specific strikes where there is a high amount of gamma that could cause market makers to re-hedge to maintain a delta neutral portfolio. This insight can help traders make timely trades in anticipation of predictable price action. The charts in Option Alpha calculate gamma exposure (GEX) based on a +/- 1% move in the underlying price. ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#call-vs-put) **Call vs Put** The 'Call vs Put' view displays the direct call vs put GEX to highlight the amount of call strike and put strike gamma exposure, open interest and volume for each strike price. The green bars represent call GEX and the red bars put GEX. ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#absolute-gamma) Absolute Gamma Absolute Gamma is total Gamma for a strike price calculated by summing the positive call gex and negative put gex into 1 positive gex value. For example, if there is 9.6b call gamma exposure and -1b put gamma exposure, the absolute gamma is 10.6b. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F175493370211213370581.png&width=768&dpr=3&quality=100&sign=cfca354f&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#net-gamma-exposure) Net Gamma Exposure Net Gamma Exposure shows the combined total of positive call gex and negative put gex. For example, if there is 9.6b call gamma exposure and -1b put gamma exposure, the net GEX is 8.6b. ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#daily-volume-background-chart-colors) Daily Volume (background chart colors) The orange shading shows the total put volume for the day; the blue shading shows total call volume for the day. Grey is where they overlap. ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#gex-ratio) GEX Ratio The GEX ratio is the ratio of negative to positive gamma exposure, and it flips based on current ratio. It only includes displayed bars so it can be adjusted for only closest to the current price. circle-info **Example**: 2b neg and 3b pos = 3b / 2b = 1.5x positive to negative GEX ratio (green) 3b neg and 2b pos = -3b / 2b = -1.5x negative to positive GEX ratio (red) ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#gex-sentiment) GEX Sentiment GEX sentiment is the % of bars nearest to the current price that are positive. In this chart, there is 8.2 times as much negative gamma as positive and only 43% of the included bars are positive: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F175493350775516773171.png&width=768&dpr=3&quality=100&sign=2d8227a4&sv=2) In this chart, there is 6.5x as much positive gamma as negative and 55% of 40 bars nearest the money are positive with a net total gamma of 14.6b: ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2Foption-alpha.s3.amazonaws.com%2Fuploads%2F175493351292912099411.png&width=768&dpr=3&quality=100&sign=f2404ff5&sv=2) ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/gex#how-to-leverage-gex-as-a-trader) How to leverage GEX as a trader? For more information about how we use gamma exposure to trade, check out this [**Gamma Exposure playlist**arrow-up-right](https://www.youtube.com/playlist?list=PLhKnvfWKsu413dNhE8LrDNLlGL61bhwFt) on YouTube. Last updated 1 month ago Was this helpful? * [What is Gamma Exposure (GEX)?](https://docs.optionalpha.com/technical-documentation/indicators/gex#what-is-gamma-exposure-gex) * [Call vs Put](https://docs.optionalpha.com/technical-documentation/indicators/gex#call-vs-put) * [Absolute Gamma](https://docs.optionalpha.com/technical-documentation/indicators/gex#absolute-gamma) * [Net Gamma Exposure](https://docs.optionalpha.com/technical-documentation/indicators/gex#net-gamma-exposure) * [Daily Volume (background chart colors)](https://docs.optionalpha.com/technical-documentation/indicators/gex#daily-volume-background-chart-colors) * [GEX Ratio](https://docs.optionalpha.com/technical-documentation/indicators/gex#gex-ratio) * [GEX Sentiment](https://docs.optionalpha.com/technical-documentation/indicators/gex#gex-sentiment) * [How to leverage GEX as a trader?](https://docs.optionalpha.com/technical-documentation/indicators/gex#how-to-leverage-gex-as-a-trader) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # ULTIMATE OSCILLATOR | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/ultimate-oscillator#ultimate-oscillator) ULTIMATE OSCILLATOR ------------------------------------------------------------------------------------------------------------------------------------------- **The Ultimate Oscillator** was developed by Larry Williams in 1976 to measure the price momentum of an asset across multiple timeframes. It uses the weighted averages of three different timeframes, which makes the indicator have less volatility and produce fewer trade signals compared to other oscillators that rely on a single timeframe. Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # TRIMA | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/trima#trima) TRIMA ------------------------------------------------------------------------------------------------- The Triangular Moving Average (TRIMA) represents an average of prices but places weight on the middle prices of the time period. The calculations double-smooths the data using a window width that is one-half the length of the series. The source code for the TRIMA function is available [herearrow-up-right](https://app.optionalpha.com/ta/TRIMA.txt) . Copy /* TRIMA Description * ================= * The triangular MA is a weighted moving average. Instead of the * TA_WMA who put more weigth on the latest price bar, the triangular * put more weigth on the data in the middle of the specified period. * * Examples: * For TimeSerie={a,b,c,d,e,f...} ('a' is the older price) * * 1st value for TRIMA 4-Period is: ((1*a)+(2*b)+(2*c)+(1*d)) / 6 * 2nd value for TRIMA 4-Period is: ((1*b)+(2*c)+(2*d)+(1*e)) / 6 * * 1st value for TRIMA 5-Period is: ((1*a)+(2*b)+(3*c)+(2*d)+(1*e)) / 9 * 2nd value for TRIMA 5-Period is: ((1*b)+(2*c)+(3*d)+(2*e)+(1*f)) / 9 * * Generally Accepted Implementation * ================================== * Using algebra, it can be demonstrated that the TRIMA is equivalent to * doing a SMA of a SMA. The following explain the rules: * * (1) When the period is even, TRIMA(x,period)=SMA(SMA(x,period/2),(period/2)+1) * (2) When the period is odd, TRIMA(x,period)=SMA(SMA(x,(period+1)/2),(period+1)/2) * * In other words: * (1) A period of 4 becomes TRIMA(x,4) = SMA( SMA( x, 2), 3 ) * (2) A period of 5 becomes TRIMA(x,5) = SMA( SMA( x, 3), 3 ) * * The SMA of a SMA is the algorithm generaly found in books. * * Tradestation Implementation * =========================== * Tradestation deviate from the generally accepted implementation by * making the TRIMA to be as follow: * TRIMA(x,period) = SMA( SMA( x, (int)(period/2)+1), (int)(period/2)+1 ); * This formula is done regardless if the period is even or odd. * * In other word: * (1) A period of 4 becomes TRIMA(x,4) = SMA( SMA( x, 3), 3 ) * (2) A period of 5 becomes TRIMA(x,5) = SMA( SMA( x, 3), 3 ) * (3) A period of 6 becomes TRIMA(x,5) = SMA( SMA( x, 4), 4 ) * (4) A period of 7 becomes TRIMA(x,5) = SMA( SMA( x, 4), 4 ) * * It is not clear to me if the Tradestation approach is a bug or a deliberate * decision to do things differently. * * Metastock Implementation * ======================== * Output is the same as the generally accepted implementation. * * TA-Lib Implementation * ===================== * Output is also the same as the generally accepted implementation. * * For speed optimization and avoid memory allocation, TA-Lib use * a better algorithm than the usual SMA of a SMA. * * The calculation from one TRIMA value to the next is done by doing 4 * little adjustment (the following show a TRIMA 4-period): * * TRIMA at time 'd': ((1*a)+(2*b)+(2*c)+(1*d)) / 6 * TRIMA at time 'e': ((1*b)+(2*c)+(2*d)+(1*e)) / 6 * * To go from TRIMA 'd' to 'e', the following is done: * 1) 'a' and 'b' are substract from the numerator. * 2) 'd' is added to the numerator. * 3) 'e' is added to the numerator. * 4) Calculate TRIMA by doing numerator / 6 * 5) Repeat sequence for next output * * These operations are the same steps done by TA-LIB: * 1) is done by numeratorSub * 2) is done by numeratorAdd. * 3) is obtain from the latest input * 4) Calculate and write TRIMA in the output * 5) Repeat for next output. * * Of course, numerotrAdd and numeratorSub needs to be * adjusted for each iteration. * * The update of numeratorSub needs values from the input at * the trailingIdx and middleIdx position. * * The update of numeratorAdd needs values from the input at * the middleIdx and todayIdx. */ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # Indicators | Option Alpha The indicators used by the bots are supplied wholly by the vetted open-source library, [TA-Libarrow-up-right](https://ta-lib.org/) . For the curious, all function definitions and inputs are available in the downloadable source code. The definitions for each indicator may differ slightly from their interpretation in some brokerage platforms. The difference is brokers don't provide the source code - we do. ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators#indicator-values) Indicator Values All historical daily indicators in the auto trading platform are cached pre-market based on yesterday's close, which makes an indicator a true N-day indicator. circle-info The autotrading platform's indicators are based on a Daily (D) time frame. The _intraday_ option on the daily indicator shifts all indicator bars forward, and instead of using the most recent close as the final daily bar, it uses the current market price. This interpretation is more in-line with how a brokerage might display values on its platform. **Example:** RSI(30) would use the 29 days (N-1) of EOD (end of day) prices, and the 30th value (Nth) would be the intraday price at the time the automation is run. In contrast, a true intraday indicator would be plotted using an aggregation period, or time-series, of less than 1 day and use a lookback function to match the time series. **Example:** If you plotted a 30 **period** RSI on a 15-minute chart, your lookback would include the last 30, 15-minute bars. ### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators#iv-rank) IV Rank Implied Volatility (IV) is the parameter component of an option pricing model, such as the Black-Scholes model, which gives the market price of an option. Implied volatility shows how the marketplace views where volatility should be in the future. IV Rank is describing how the IV relates to where it has been over the past year (52 weeks) by the formula: iv\_r\=iv−iv\_low(year)iv\_high(year)−iv\_low(year)iv\\\_r = \\frac {iv-iv\\\_{low}(year)}{iv\\\_{high} (year)-iv\\\_{low}(year)}iv\_r\=iv\_high(year)−iv\_low(year)iv−iv\_low(year)​ The IV Rank of each security is calculated every morning and cached for use by the bots throughout the day. This data is supplied directly by our data provider. Implied Volatility is derived using the analytical formulas of the Black-Scholes model. Model-free price and implied rates are used as an input parameter to the model. circle-info The IVR number produced by the autotrading platform is provided directly by the data provider and may vary from your brokerage platform. This is due to the brokerage making its own proprietary calculations. #### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators#discrepancies-in-ivr) Discrepancies in IVR Although the IVR calculation is only comprised of 3 data points, you may notice variance between the reported IVR values by the bots, values reported by brokers, or values reported by other volatility sources. The reason why is two-fold. Recall that implied volatility is not directly observable, and is, therefore, a derived metric usually calculated using a closed-form options pricing model. The biggest unknown is the proprietary pricing model that's being applied to the raw data to derive IV by each IVR source. There are many pricing models to choose from BSM, Binomial, Trinomial, finite difference, Monte-Carlo, or even the ultra-academic "model-free" methods. Depending on which model is used, the reported implied volatility values will differ. Volatility sources rarely state which model is being used in the calculation. The primary reason for the difference in calculations is where those black box IV calculations place the high and low IV over the last 52 weeks, or 252 trading days. The IVR reported by the bots uses the high/low implied volatility from the set of all instantaneous IV tracked over the last 252 trading days. In other words, all intraday recorded IV is considered, which yields a much more accurate value for IVR. In contrast, other sources may use only the daily closing IV value over 252 trading days, then determine the high and low from that data set. It is also possible other sources are using the daily average, the high/low weekly average over 52 weeks, etc. Unless both the pricing model and the method of high/low determination are known, it is very difficult to compare IVR from different sources. #### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators#vix) VIX This compares the current real-time reading of the VIX to the referenced value. The VIX is a real-time market index representing the market’s expectations for volatility over the coming 30 days. The CBOE VIX index is a benchmark index where expected future volatility is calculated based on put and call option pricing in the S&P 500 index (SPX options). The VIX index is a 30-day representation of volatility expectations for the S&P 500. [More Information on VIXarrow-up-right](https://optionalpha.com/topics/market-indicators) #### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators#volume) Volume Volume is not a cached N-day indicator and is measured in real-time on a daily basis and displayed as the current day's cumulative volume. This cumulative volume will build throughout the day as more shares or contracts are traded. #### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators#std-dev) Std Dev The standard deviation formula is the [generic mathematical formulaarrow-up-right](https://en.wikipedia.org/wiki/Standard_deviation) in standard usage, comprised of closing values for the last _n_ days. 1 standard deviation on our platform is equivalent to the 30-day standard deviation of the underlying's price. Standard Deviation can be used as part of the decision recipe for \[Symbol\] price \[increased\] \[2 std devs\] since \[1 day ago\] ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252F2oU3qWeuZ3n3olJjFLpr%252F66b26b72a21ddd9c4432abb8_6238bf269e0101151bb1aa9b_Standard20Calculation.png%3Falt%3Dmedia%26token%3Db8e26eb4-113e-4b5a-b5c9-d949b8a217bc&width=768&dpr=3&quality=100&sign=4e8a28fe&sv=2) This decision is asking the following question, what is the 30-day std dev on the underlying? How does the price difference between dates X and Y compare to the sd30? The answer is read as, "The price move during the period in question encompassed the equivalent of 1.00 standard deviations" #### [hashtag](https://docs.optionalpha.com/technical-documentation/indicators#technical-signals) Technical Signals The technical indicators found in the Screener and automation decisions offer default technical signals for Buy, Sell, or Neutral states. The table below expands on the default settings and how the various technical states are determined for each indicator. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FexcF4fdrvZmYf9l7MNMR%252F66b26b72a21ddd9c4432abb0_6659d6045365899f543790b4_Option20platform20indicators.png%3Falt%3Dmedia%26token%3D4ba12f8d-fcc7-40a8-9f74-d5b43a0e19b8&width=768&dpr=3&quality=100&sign=c266beee&sv=2) Last updated 16 days ago Was this helpful? * [Indicator Values](https://docs.optionalpha.com/technical-documentation/indicators#indicator-values) * [IV Rank](https://docs.optionalpha.com/technical-documentation/indicators#iv-rank) Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # BOP | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/bop#bop) BOP ------------------------------------------------------------------------------------------- The Balance of Power indicator (BOP) measures the strength of buyers have to push prices higher against the power of sellers to move prices lower. When the indicator is in positive territory, the bulls are in charge; and conversely, the sellers control price when the indicator is negative. A reading near the zero line indicates a balance between the two and a possible trend reversal. Copy /* BOP = (Close - Open)/(High - Low) */ The source code for the BOP function is available [herearrow-up-right](https://app.optionalpha.com/ta/BOP.txt) . Some trading platforms offer a version of BOP with a moving average added and others do not. We offer Balance of Power exactly as TA-Lib provides **without a moving average**. As a result, when using BOP inside of your bots, there will be no difference in the value provided when assessing different lookback intervals. ![](https://docs.optionalpha.com/~gitbook/image?url=https%3A%2F%2F2799944806-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MYjluAVRcRcfh1YL43z%252Fuploads%252FP5sYObs1RXTNfpvZQEOh%252FBalance%2520Of%2520Power.png%3Falt%3Dmedia%26token%3Da2c5c4c7-336e-466d-9e0b-bc1d9c7306b7&width=768&dpr=3&quality=100&sign=f0a67143&sv=2) Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # MOM | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/mom#mom) MOM ------------------------------------------------------------------------------------------- The Momentum Indicator (MOM) is a leading indicator measuring a security's rate of change. It compares the current price with the previous price from a number of periods ago. The plot forms an oscillator that moves above and below 0. It is an unbounded oscillator with no lower or upper limit. The source code for the MOM function is available [herearrow-up-right](https://app.optionalpha.com/ta/MOM.txt) . Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon --- # BOLLINGER BANDS | Option Alpha [hashtag](https://docs.optionalpha.com/technical-documentation/indicators/bollinger-bands#bollinger-bands) BOLLINGER BANDS ------------------------------------------------------------------------------------------------------------------------------- [Bollinger bandsarrow-up-right](https://optionalpha.com/analysis/technical-indicators#bollinger-bands) are a chart overlay, volatility indicator that show the upper and lower range of normal price movement based on [standard deviationarrow-up-right](https://optionalpha.com/academic/models#standard-deviation) . The centerline of Bollinger bands is typically a 20-day simple moving average. The upper and lower bands are twice the 20-day standard deviation of price above and below the centerline. Source code for the Bollinger Bands (BBANDS) function is available [herearrow-up-right](https://app.optionalpha.com/ta/BBANDS.txt) Copy /* TA-LIB Copyright (c) 1999-2007, Mario Fortier * All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * - Neither name of author nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* List of contributors: * * Initial Name/description * ------------------------------------------------------------------- * MF Mario Fortier * JV Jesus Viver <[email protected]> * * * Change history: * * MMDDYY BY Description * ------------------------------------------------------------------- * 112400 MF Template creation. * 010503 MF Fix to always use SMA for the STDDEV (Thanks to JV). * 052603 MF Adapt code to compile with .NET Managed C++ * */ /**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ /* All code within this section is automatically * generated by gen_code. Any modification will be lost * next time gen_code is run. */ /* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ #include "TA-Lib-Core.h" /* Generated */ #define TA_INTERNAL_ERROR(Id) (RetCode::InternalError) /* Generated */ namespace TicTacTec { namespace TA { namespace Library { /* Generated */ #elif defined( _JAVA ) /* Generated */ #include "ta_defs.h" /* Generated */ #include "ta_java_defs.h" /* Generated */ #define TA_INTERNAL_ERROR(Id) (RetCode.InternalError) /* Generated */ #else /* Generated */ #include /* Generated */ #include /* Generated */ #include "ta_func.h" /* Generated */ #endif /* Generated */ /* Generated */ #ifndef TA_UTILITY_H /* Generated */ #include "ta_utility.h" /* Generated */ #endif /* Generated */ /* Generated */ #ifndef TA_MEMORY_H /* Generated */ #include "ta_memory.h" /* Generated */ #endif /* Generated */ /* Generated */ #define TA_PREFIX(x) TA_##x /* Generated */ #define INPUT_TYPE double /* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ int Core::BbandsLookback( int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ MAType optInMAType ) /* Generated */ /* Generated */ #elif defined( _JAVA ) /* Generated */ public int bbandsLookback( int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ MAType optInMAType ) /* Generated */ /* Generated */ #else /* Generated */ int TA_BBANDS_Lookback( int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ TA_MAType optInMAType ) /* Generated */ /* Generated */ #endif /**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/ { /* insert local variable here */ /**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ /* min/max are checked for optInTimePeriod. */ /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod = 5; /* Generated */ else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) /* Generated */ return -1; /* Generated */ /* Generated */ if( optInNbDevUp == TA_REAL_DEFAULT ) /* Generated */ optInNbDevUp = 2.000000e+0; /* Generated */ else if( (optInNbDevUp < -3.000000e+37) ||/* Generated */ (optInNbDevUp > 3.000000e+37) ) /* Generated */ return -1; /* Generated */ /* Generated */ if( optInNbDevDn == TA_REAL_DEFAULT ) /* Generated */ optInNbDevDn = 2.000000e+0; /* Generated */ else if( (optInNbDevDn < -3.000000e+37) ||/* Generated */ (optInNbDevDn > 3.000000e+37) ) /* Generated */ return -1; /* Generated */ /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( (int)optInMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInMAType = (TA_MAType)0; /* Generated */ else if( ((int)optInMAType < 0) || ((int)optInMAType > 8) ) /* Generated */ return -1; /* Generated */ /* Generated */ #endif /* !defined(_MANAGED) && !defined(_JAVA)*/ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/ /* insert lookback code here. */ UNUSED_VARIABLE(optInNbDevUp); UNUSED_VARIABLE(optInNbDevDn); /* The lookback is driven by the middle band moving average. */ return LOOKBACK_CALL(MA)( optInTimePeriod, optInMAType ); } /**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ /* * TA_BBANDS - Bollinger Bands * * Input = double * Output = double, double, double * * Optional Parameters * ------------------- * optInTimePeriod:(From 2 to 100000) * Number of period * * optInNbDevUp:(From TA_REAL_MIN to TA_REAL_MAX) * Deviation multiplier for upper band * * optInNbDevDn:(From TA_REAL_MIN to TA_REAL_MAX) * Deviation multiplier for lower band * * optInMAType: * Type of Moving Average * * */ /* Generated */ /* Generated */ #if defined( _MANAGED ) && defined( USE_SUBARRAY ) /* Generated */ enum class Core::RetCode Core::Bbands( int startIdx, /* Generated */ int endIdx, /* Generated */ SubArray^ inReal, /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ MAType optInMAType, /* Generated */ [Out]int% outBegIdx, /* Generated */ [Out]int% outNBElement, /* Generated */ cli::array^ outRealUpperBand, /* Generated */ cli::array^ outRealMiddleBand, /* Generated */ cli::array^ outRealLowerBand ) /* Generated */ #elif defined( _MANAGED ) /* Generated */ enum class Core::RetCode Core::Bbands( int startIdx, /* Generated */ int endIdx, /* Generated */ cli::array^ inReal, /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ MAType optInMAType, /* Generated */ [Out]int% outBegIdx, /* Generated */ [Out]int% outNBElement, /* Generated */ cli::array^ outRealUpperBand, /* Generated */ cli::array^ outRealMiddleBand, /* Generated */ cli::array^ outRealLowerBand ) /* Generated */ #elif defined( _JAVA ) /* Generated */ public RetCode bbands( int startIdx, /* Generated */ int endIdx, /* Generated */ double inReal[], /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ MAType optInMAType, /* Generated */ MInteger outBegIdx, /* Generated */ MInteger outNBElement, /* Generated */ double outRealUpperBand[], /* Generated */ double outRealMiddleBand[], /* Generated */ double outRealLowerBand[] ) /* Generated */ #else /* Generated */ TA_RetCode TA_BBANDS( int startIdx, /* Generated */ int endIdx, /* Generated */ const double inReal[], /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ TA_MAType optInMAType, /* Generated */ int *outBegIdx, /* Generated */ int *outNBElement, /* Generated */ double outRealUpperBand[], /* Generated */ double outRealMiddleBand[], /* Generated */ double outRealLowerBand[] ) /* Generated */ #endif /**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/ { /* Insert local variables here. */ ENUM_DECLARATION(RetCode) retCode; int i; double tempReal, tempReal2; ARRAY_REF(tempBuffer1); ARRAY_REF(tempBuffer2); /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ /* Generated */ /* Validate the requested output range. */ /* Generated */ if( startIdx < 0 ) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex); /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex); /* Generated */ /* Generated */ #if !defined(_JAVA) /* Generated */ if( !inReal ) return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* !defined(_JAVA)*/ /* Generated */ /* min/max are checked for optInTimePeriod. */ /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod = 5; /* Generated */ else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ /* Generated */ if( optInNbDevUp == TA_REAL_DEFAULT ) /* Generated */ optInNbDevUp = 2.000000e+0; /* Generated */ else if( (optInNbDevUp < -3.000000e+37) ||/* Generated */ (optInNbDevUp > 3.000000e+37) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ /* Generated */ if( optInNbDevDn == TA_REAL_DEFAULT ) /* Generated */ optInNbDevDn = 2.000000e+0; /* Generated */ else if( (optInNbDevDn < -3.000000e+37) ||/* Generated */ (optInNbDevDn > 3.000000e+37) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( (int)optInMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInMAType = (TA_MAType)0; /* Generated */ else if( ((int)optInMAType < 0) || ((int)optInMAType > 8) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ /* Generated */ #endif /* !defined(_MANAGED) && !defined(_JAVA)*/ /* Generated */ #if !defined(_JAVA) /* Generated */ if( !outRealUpperBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ /* Generated */ if( !outRealMiddleBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ /* Generated */ if( !outRealLowerBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ /* Generated */ #endif /* !defined(_JAVA) */ /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */ /* Generated */ /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/ /* Insert TA function code here. */ /* Identify TWO temporary buffer among the outputs. * * These temporary buffers allows to perform the * calculation without any memory allocation. * * Whenever possible, make the tempBuffer1 be the * middle band output. This will save one copy operation. */ #if defined(USE_SINGLE_PRECISION_INPUT) || defined( USE_SUBARRAY ) tempBuffer1 = outRealMiddleBand; tempBuffer2 = outRealLowerBand; #else if( inReal == outRealUpperBand ) { tempBuffer1 = outRealMiddleBand; tempBuffer2 = outRealLowerBand; } else if( inReal == outRealLowerBand ) { tempBuffer1 = outRealMiddleBand; tempBuffer2 = outRealUpperBand; } else if( inReal == outRealMiddleBand ) { tempBuffer1 = outRealLowerBand; tempBuffer2 = outRealUpperBand; } else { tempBuffer1 = outRealMiddleBand; tempBuffer2 = outRealUpperBand; } /* Check that the caller is not doing tricky things. * (like using the input buffer in two output!) */ if( (tempBuffer1 == inReal) || (tempBuffer2 == inReal) ) return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); #endif /* Calculate the middle band, which is a moving average. * The other two bands will simply add/substract the * standard deviation from this middle band. */ retCode = FUNCTION_CALL(MA)( startIdx, endIdx, inReal, optInTimePeriod, optInMAType, outBegIdx, outNBElement, tempBuffer1 ); if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement) == 0) ) { VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return retCode; } /* Calculate the standard deviation into tempBuffer2. */ if( optInMAType == ENUM_VALUE(MAType,TA_MAType_SMA,Sma) ) { /* A small speed optimization by re-using the * already calculated SMA. */ FUNCTION_CALL(INT_stddev_using_precalc_ma)( inReal, tempBuffer1, (int)VALUE_HANDLE_DEREF(outBegIdx), (int)VALUE_HANDLE_DEREF(outNBElement), optInTimePeriod, tempBuffer2 ); } else { /* Calculate the Standard Deviation */ retCode = FUNCTION_CALL(STDDEV)( (int)VALUE_HANDLE_DEREF(outBegIdx), endIdx, inReal, optInTimePeriod, 1.0, outBegIdx, outNBElement, tempBuffer2 ); if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) { VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); return retCode; } } /* Copy the MA calculation into the middle band ouput, unless * the calculation was done into it already! */ #if !defined(USE_SINGLE_PRECISION_INPUT) if( tempBuffer1 != outRealMiddleBand ) { ARRAY_COPY( outRealMiddleBand, tempBuffer1, VALUE_HANDLE_DEREF(outNBElement) ); } #endif /* Now do a tight loop to calculate the upper/lower band at * the same time. * * All the following 5 loops are doing the same, except there * is an attempt to speed optimize by eliminating uneeded * multiplication. */ if( optInNbDevUp == optInNbDevDn ) { if( optInNbDevUp == 1.0 ) { /* No standard deviation multiplier needed. */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) { tempReal = tempBuffer2[i]; tempReal2 = outRealMiddleBand[i]; outRealUpperBand[i] = tempReal2 + tempReal; outRealLowerBand[i] = tempReal2 - tempReal; } } else { /* Upper/lower band use the same standard deviation multiplier. */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) { tempReal = tempBuffer2[i] * optInNbDevUp; tempReal2 = outRealMiddleBand[i]; outRealUpperBand[i] = tempReal2 + tempReal; outRealLowerBand[i] = tempReal2 - tempReal; } } } else if( optInNbDevUp == 1.0 ) { /* Only lower band has a standard deviation multiplier. */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) { tempReal = tempBuffer2[i]; tempReal2 = outRealMiddleBand[i]; outRealUpperBand[i] = tempReal2 + tempReal; outRealLowerBand[i] = tempReal2 - (tempReal * optInNbDevDn); } } else if( optInNbDevDn == 1.0 ) { /* Only upper band has a standard deviation multiplier. */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) { tempReal = tempBuffer2[i]; tempReal2 = outRealMiddleBand[i]; outRealLowerBand[i] = tempReal2 - tempReal; outRealUpperBand[i] = tempReal2 + (tempReal * optInNbDevUp); } } else { /* Upper/lower band have distinctive standard deviation multiplier. */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) { tempReal = tempBuffer2[i]; tempReal2 = outRealMiddleBand[i]; outRealUpperBand[i] = tempReal2 + (tempReal * optInNbDevUp); outRealLowerBand[i] = tempReal2 - (tempReal * optInNbDevDn); } } return ENUM_VALUE(RetCode,TA_SUCCESS,Success); } /**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ /* Generated */ /* Generated */ #define USE_SINGLE_PRECISION_INPUT /* Generated */ #if !defined( _MANAGED ) && !defined( _JAVA ) /* Generated */ #undef TA_PREFIX /* Generated */ #define TA_PREFIX(x) TA_S_##x /* Generated */ #endif /* Generated */ #undef INPUT_TYPE /* Generated */ #define INPUT_TYPE float /* Generated */ #if defined( _MANAGED ) /* Generated */ enum class Core::RetCode Core::Bbands( int startIdx, /* Generated */ int endIdx, /* Generated */ cli::array^ inReal, /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ MAType optInMAType, /* Generated */ [Out]int% outBegIdx, /* Generated */ [Out]int% outNBElement, /* Generated */ cli::array^ outRealUpperBand, /* Generated */ cli::array^ outRealMiddleBand, /* Generated */ cli::array^ outRealLowerBand ) /* Generated */ #elif defined( _JAVA ) /* Generated */ public RetCode bbands( int startIdx, /* Generated */ int endIdx, /* Generated */ float inReal[], /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ MAType optInMAType, /* Generated */ MInteger outBegIdx, /* Generated */ MInteger outNBElement, /* Generated */ double outRealUpperBand[], /* Generated */ double outRealMiddleBand[], /* Generated */ double outRealLowerBand[] ) /* Generated */ #else /* Generated */ TA_RetCode TA_S_BBANDS( int startIdx, /* Generated */ int endIdx, /* Generated */ const float inReal[], /* Generated */ int optInTimePeriod, /* From 2 to 100000 */ /* Generated */ double optInNbDevUp, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ double optInNbDevDn, /* From TA_REAL_MIN to TA_REAL_MAX */ /* Generated */ TA_MAType optInMAType, /* Generated */ int *outBegIdx, /* Generated */ int *outNBElement, /* Generated */ double outRealUpperBand[], /* Generated */ double outRealMiddleBand[], /* Generated */ double outRealLowerBand[] ) /* Generated */ #endif /* Generated */ { /* Generated */ ENUM_DECLARATION(RetCode) retCode; /* Generated */ int i; /* Generated */ double tempReal, tempReal2; /* Generated */ ARRAY_REF(tempBuffer1); /* Generated */ ARRAY_REF(tempBuffer2); /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK /* Generated */ if( startIdx < 0 ) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex); /* Generated */ if( (endIdx < 0) || (endIdx < startIdx)) /* Generated */ return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex); /* Generated */ #if !defined(_JAVA) /* Generated */ if( !inReal ) return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ if( (int)optInTimePeriod == TA_INTEGER_DEFAULT ) /* Generated */ optInTimePeriod = 5; /* Generated */ else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ if( optInNbDevUp == TA_REAL_DEFAULT ) /* Generated */ optInNbDevUp = 2.000000e+0; /* Generated */ else if( (optInNbDevUp < -3.000000e+37) || (optInNbDevUp > 3.000000e+37) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ if( optInNbDevDn == TA_REAL_DEFAULT ) /* Generated */ optInNbDevDn = 2.000000e+0; /* Generated */ else if( (optInNbDevDn < -3.000000e+37) || (optInNbDevDn > 3.000000e+37) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #if !defined(_MANAGED) && !defined(_JAVA) /* Generated */ if( (int)optInMAType == TA_INTEGER_DEFAULT ) /* Generated */ optInMAType = (TA_MAType)0; /* Generated */ else if( ((int)optInMAType < 0) || ((int)optInMAType > 8) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ #if !defined(_JAVA) /* Generated */ if( !outRealUpperBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ if( !outRealMiddleBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ if( !outRealLowerBand ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ #endif /* Generated */ #if defined(USE_SINGLE_PRECISION_INPUT) || defined( USE_SUBARRAY ) /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealLowerBand; /* Generated */ #else /* Generated */ if( inReal == outRealUpperBand ) /* Generated */ { /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealLowerBand; /* Generated */ } /* Generated */ else if( inReal == outRealLowerBand ) /* Generated */ { /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealUpperBand; /* Generated */ } /* Generated */ else if( inReal == outRealMiddleBand ) /* Generated */ { /* Generated */ tempBuffer1 = outRealLowerBand; /* Generated */ tempBuffer2 = outRealUpperBand; /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ tempBuffer1 = outRealMiddleBand; /* Generated */ tempBuffer2 = outRealUpperBand; /* Generated */ } /* Generated */ if( (tempBuffer1 == inReal) || (tempBuffer2 == inReal) ) /* Generated */ return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam); /* Generated */ #endif /* Generated */ retCode = FUNCTION_CALL(MA)( startIdx, endIdx, inReal, /* Generated */ optInTimePeriod, optInMAType, /* Generated */ outBegIdx, outNBElement, tempBuffer1 ); /* Generated */ if( (retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) || ((int)VALUE_HANDLE_DEREF(outNBElement) == 0) ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return retCode; /* Generated */ } /* Generated */ if( optInMAType == ENUM_VALUE(MAType,TA_MAType_SMA,Sma) ) /* Generated */ { /* Generated */ FUNCTION_CALL(INT_stddev_using_precalc_ma)( inReal, tempBuffer1, /* Generated */ (int)VALUE_HANDLE_DEREF(outBegIdx), (int)VALUE_HANDLE_DEREF(outNBElement), /* Generated */ optInTimePeriod, tempBuffer2 ); /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ retCode = FUNCTION_CALL(STDDEV)( (int)VALUE_HANDLE_DEREF(outBegIdx), endIdx, inReal, /* Generated */ optInTimePeriod, 1.0, /* Generated */ outBegIdx, outNBElement, tempBuffer2 ); /* Generated */ if( retCode != ENUM_VALUE(RetCode,TA_SUCCESS,Success) ) /* Generated */ { /* Generated */ VALUE_HANDLE_DEREF_TO_ZERO(outNBElement); /* Generated */ return retCode; /* Generated */ } /* Generated */ } /* Generated */ #if !defined(USE_SINGLE_PRECISION_INPUT) /* Generated */ if( tempBuffer1 != outRealMiddleBand ) /* Generated */ { /* Generated */ ARRAY_COPY( outRealMiddleBand, tempBuffer1, VALUE_HANDLE_DEREF(outNBElement) ); /* Generated */ } /* Generated */ #endif /* Generated */ if( optInNbDevUp == optInNbDevDn ) /* Generated */ { /* Generated */ if( optInNbDevUp == 1.0 ) /* Generated */ { /* Generated */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + tempReal; /* Generated */ outRealLowerBand[i] = tempReal2 - tempReal; /* Generated */ } /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i] * optInNbDevUp; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + tempReal; /* Generated */ outRealLowerBand[i] = tempReal2 - tempReal; /* Generated */ } /* Generated */ } /* Generated */ } /* Generated */ else if( optInNbDevUp == 1.0 ) /* Generated */ { /* Generated */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + tempReal; /* Generated */ outRealLowerBand[i] = tempReal2 - (tempReal * optInNbDevDn); /* Generated */ } /* Generated */ } /* Generated */ else if( optInNbDevDn == 1.0 ) /* Generated */ { /* Generated */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealLowerBand[i] = tempReal2 - tempReal; /* Generated */ outRealUpperBand[i] = tempReal2 + (tempReal * optInNbDevUp); /* Generated */ } /* Generated */ } /* Generated */ else /* Generated */ { /* Generated */ for( i=0; i < (int)VALUE_HANDLE_DEREF(outNBElement); i++ ) /* Generated */ { /* Generated */ tempReal = tempBuffer2[i]; /* Generated */ tempReal2 = outRealMiddleBand[i]; /* Generated */ outRealUpperBand[i] = tempReal2 + (tempReal * optInNbDevUp); /* Generated */ outRealLowerBand[i] = tempReal2 - (tempReal * optInNbDevDn); /* Generated */ } /* Generated */ } /* Generated */ return ENUM_VALUE(RetCode,TA_SUCCESS,Success); /* Generated */ } /* Generated */ /* Generated */ #if defined( _MANAGED ) /* Generated */ }}} // Close namespace TicTacTec.TA.Lib /* Generated */ #endif /**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/ Last updated 2 months ago Was this helpful? Was this helpful? sun-brightdesktopmoon sun-brightdesktopmoon ---