Portfolio Scripts

Portfolio scripts run in the context of the entire portfolio.

Add-On Scripts

Add-on scripts add functionality to the platform.

Sample Scripts

These sample scripts submit orders when the user activates the add-on. That's why the scripts are named after order types.

  • Market Order
  • Stop Order
  • Iceberg Order

Alert Scripts

Alert scripts execute custom actions when triggered by an alert.

Sample Scripts

These sample scripts submit orders when an alert is triggered. That's why the scripts are named after order types.

  • Market Order
  • Stop Order
  • Limit Order

 

On this page:

Commission Scripts

Commission scripts calculate the commission paid to a broker for each executed order, based on the broker's exact commission schedule.

Sample Scripts

  • Commission per Order
  • Commission per Unit
  • Commission by Instrument

Dynamic Allocation Scripts

Dynamic allocation scripts redistribute cash between portfolio strategies based on their performance (or some other heuristic).

Sample Scripts

  • Equally Balance Cash Monthly
  • Equally Balance Cash Weekly

Optimization Algorithm Scripts

Optimization algorithm scripts implement Optimizations in automated portfolios. They decide how many optimization runs to execute, and which parameter values to use in each run.

Sample Scripts

  • Brute Force
  • Monte Carlo
  • Genetic

Performance Metric Scripts

Performance metric scripts calculate performance statistics. They can be used to add information to a portfolio's Performance results, or as an optimization score when Optimizing a portfolio.

Sample Scripts

  • Net Profit
  • Average PnL
  • CAGR
  • Sharpe Ratio

Risk Management Scripts

Risk management scripts manage risk by modifying or cancelling trading strategy orders based on portfolio level risk analysis.

Sample Scripts

  • Fixed Equity Limit
  • Percentage Equity Limit

Slippage Scripts

Slippage scripts simulate market slippage by setting the final execution price of each simulated order fill.

Sample Scripts

  • Constant Tick Slippage
  • Random Tick Slippage

Tax System Scripts

Tax system scripts calculate and apply the capital gains taxes incurred by a portfolio.

Sample Scripts

  • Generic Tax System
  • United States Tax System