Option Alpha Docs
  • Intro to Option Alpha
  • TOOLS
    • Bots
      • Creating a Bot
      • Safeguards
      • Automation Basics
      • Using Loops
      • Decisions
      • Automated Trades
      • SmartPricing
      • Exit Options
      • Using Tags
      • Using Inputs
      • Automation Scheduling
      • Bot Logs
      • Templates and Cloning
      • Managing Positions
      • Autotrading Best Practices
    • Trade Ideas
      • Manual Trading
    • 0DTE Oracle
    • Earnings Edge
    • Settings
      • Webhooks
      • Live Trading
        • Connecting to Tradier
        • Connecting to tastytrade
        • Connecting to TradeStation
        • Connecting to Schwab
  • PLATFORM
    • Infrastructure & Security
    • Automations
      • Automation Behavior
    • Data Feeds
    • Order Handling
    • Bot Limitations
    • Supported Ticker Symbols
      • Supported Browsers
      • Supported Countries
    • Ex Dividend & Earnings Dates
    • Troubleshooting
      • Testing Automations
      • Broker Rejection Errors
        • Invalid Authorization
        • Overlapping Strikes Failsafe
        • Duplicate Orders Error
      • Capital Warnings
      • Position Limit Warnings
      • Trade Enforcements
      • Pricing Anomaly Warning
      • Missing or Invalid Input
      • Daily Symbol Limit Error
      • Excessive Errors Failsafe
      • Bot Event Loops
      • Option & Expiration Availability
  • Calculations
    • Profit and Loss
    • Decision Properties
    • Decision Calculations
    • Parameter Selection
    • Probability
      • Probability Theory
      • Understanding Alpha and Expected Value
    • Indicators
      • ADX
      • ATR
      • BOLLINGER BANDS
      • BOP
      • CCI
      • CMO
      • DX
      • EMA
      • KAMA
      • MACD
      • MFI
      • MOM
      • ROC
      • RSI
      • SMA
      • STOCH
      • Stoch RSI
      • TRIMA
      • ULTIMATE OSCILLATOR
      • WILLIAMS %R
  • Resources
    • 'Fast Track' Video Series
    • Live & On-Demand Events
    • Videos
    • Education
    • Blog
    • Podcast
Powered by GitBook
On this page
  • Rate of Return Calculation
  • % Premium Calculation
  • Return % Calculation
  • Total P/L
  • Total P/L %
  • Day P/L
  • Day P/L %
  • Closed P/L
  • Win Rate

Was this helpful?

  1. Calculations

Decision Calculations

Overview of the calculations used by decision recipes to determine position value.

PreviousDecision PropertiesNextParameter Selection

Last updated 6 months ago

Was this helpful?

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.

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%

% Premium Calculation

The formula for % premium increase/decreased is:

changepercent=changepriceopenchange_{percent} = \frac {change} {price_{open}}changepercent​=priceopen​change​

wherechangepercentchange_{percent}changepercent​is equal to the net change in position value divided by the openPrice of the position, defined as:

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 here.

Return % Calculation

let {priceChange, openPrice} = position;
let returnPct = priceChange && openPrice ? priceChange / openPrice : 0;

//where priceChange = position.currentPrice - position.openPrice;

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%.

Total percent return can be a better indicator of return on investment because it shows growth relative to the initial investment.

Total P/L

The sum of open and closed P/L.

Total P/L %

The total P/L divided by the bot allocation.

Day P/L

The current intraday total P/L minus the previous days closing P/L value or $0 if no previous day.

Day P/L %

The day P/L divided by the previous day's closing net liquid or bot allocation if no previous day.

Closed P/L

The bot's P/L for all closed positions.

Win Rate

The bot's percentage of winning trades. Win Rate (win%) = number of wins divided by total number of closed trades.

Percentage return formula