Sign up here it's free and anyone can join! Already a member? login here.
Software

Optimization Scripts

A strategy portfolio can be assigned an optimization script to optimize a preselected group of numeric script parameters belonging to the portfolio scripts. (Trading strategy scripts, position sizing scripts, money management script…)

The optimization process runs the strategy portfolio again and again using different parameter values, while calculating a goal value at the end of each run. The selection of the parameter values for the next run as well as the calculation of the goal value for the last run, are defined in the optimization script itself.

Prior to running the optimization process the script parameters that require optimization are selected and each parameter is assigned a range of possible values. The combination of all possible values for all of the parameters selected for optimization creates a list of optimization vectors that can be used to initialize the portfolio script parameters.

For example:

If a trading strategy script parameter is selected for optimization with a low range value of 1, a high range value of 2 and a step value of 0.5 then the possible parameter values will be 1, 1.5 and 2.

If a position sizing script parameter is selected for optimization with a low range value of 10, a high range value of 11 and a step value of 0.25 then the possible parameter values will be 10, 10.25, 10.5, 10.75 and 11.

If both of these scripts are in the same strategy portfolio and there are no other scripts with parameters selected for optimization, then the optimization vectors for the portfolio will be:

<1,10>,<1,10.25>,<1,10.5>,<1,10.75><1,11>,<1.5,10>,<1.5,10.25>,<1.5,10.5>, <1.5,10.75> <1.5,11>,<2,10>,<2,10.25>,<2,10.5>,<2,10.75><2,11>

The IQBroker automated trading software ships with a library of premade optimization scripts that can be parameterized and customized without any programming, while custom scripts can be easily developed using the resource designer and IQLanguage.

Script Implementation

OnInitialize()
This function is called automatically when the script is first initialized.

OnSelectVector() As Number()
This function is called prior to each portfolio run to select the optimization vector values for the next portfolio run. The selected vector values are then used to argument the portfolio scripts parameters immediately prior to running it.

OnScoreVector() As Number
This function is called after each portfolio run to evaluate the performance of the portfolio and assign it a score based on its ability to meet a custom goal.

OnMaxVectors() As Integer
This function is called asynchronously to calculate the maximum number of vectors to be optimized.

Introduction to Optimization Scripts

This tutorial provides a complete introduction to optimization scripts.

Optimization Resources

These optimization resources are pre-installed with IQBroker.

ID Name Author Last Update
MCAPL Monte Carlo, Average P/L Admin 2009-06-17
MCAPLP Monte Carlo, Average P/L % Admin 2009-06-17
MCAPLPB Monte Carlo, Average P/L Per Bar Admin 2009-06-17
MCAPLPD Monte Carlo, Average P/L Per Day Admin 2009-06-17
MCAPCP Monte Carlo, Average Price Change % Admin 2009-06-17
MCAV Monte Carlo, Average Value Admin 2009-06-17
MCCAGR Monte Carlo, CAGR Admin 2009-06-17
MCMCL Monte Carlo, Maximum Consecutive Losing Admin 2009-06-17
MCMCW Monte Carlo, Maximum Consecutive Winning Admin 2009-06-17
MCMD Monte Carlo, Maximum Drawdown Admin 2009-06-17
MCMDP Monte Carlo, Maximum Drawdown % Admin 2009-06-17
MCE Monte Carlo, Equity Admin 2009-06-17
MCEX Monte Carlo, Exposure Admin 2009-06-17
MCLC Monte Carlo, Luck Coefficient Admin 2009-06-17
MCNP Monte Carlo, Net Profit Admin 2009-06-17
MCNPP Monte Carlo, Net Profit % Admin 2009-06-17
MCPL Monte Carlo, P/L Admin 2009-06-17
MCPR Monte Carlo, Payoff Ratio Admin 2009-06-17
MCPF Monte Carlo, Profit Factor Admin 2009-06-17
MCRF Monte Carlo, Recovery Factor Admin 2009-06-17
MCSR Monte Carlo, Sharpe Ratio Admin 2009-06-17
MCUI Monte Carlo, Ulcer Index Admin 2009-06-17
MCWLR Monte Carlo, Win Loss Ratio Admin 2009-06-17
EXAPL Exhaustive, Average P/L Admin 2009-06-17
EXAPLP Exhaustive, Average P/L % Admin 2009-06-17
EXAPLPB Exhaustive, Average P/L Per Bar Admin 2009-06-17
EXAPLPD Exhaustive, Average P/L Per Day Admin 2009-06-17
EXAPCP Exhaustive, Average Price Change % Admin 2009-06-17
EXAV Exhaustive, Average Value Admin 2009-06-17
EXCAGR Exhaustive, CAGR Admin 2009-06-17
EXMCL Exhaustive, Maximum Consecutive Losing Admin 2009-06-17
EXMCW Exhaustive, Maximum Consecutive Winning Admin 2009-06-17
EXMD Exhaustive, Maximum Drawdown Admin 2009-06-17
EXMDP Exhaustive, Maximum Drawdown % Admin 2009-06-17
EXE Exhaustive, Equity Admin 2009-06-17
EXE Exhaustive, Exposure Admin 2009-06-17
EXLC Exhaustive, Luck Coefficient Admin 2009-06-17
EXNP Exhaustive, Net Profit Admin 2009-06-17
EXNPP Exhaustive, Net Profit % Admin 2009-06-17
EXPL Exhaustive, P/L Admin 2009-06-17
EXPR Exhaustive, Payoff Ratio Admin 2009-06-17
EXPF Exhaustive, Profit Factor Admin 2009-06-17
EXRF Exhaustive, Recovery Factor Admin 2009-06-17
EXSR Exhaustive, Sharpe Ratio Admin 2009-06-17
EXUI Exhaustive, Ulcer Index Admin 2009-06-17
EXWLR Exhaustive, Win Loss Ratio Admin 2009-06-17

Home :: Company :: Software :: Download :: Purchase :: Forums :: Support :: Partners
Copyright © 2008 - 2009 IQ Broker Technologies, Ltd. All rights reserved.