1. Scripting
.Net
Scripts extend QuantShare capabilities and make the application extremely
fexible. There
are two kinds of scripts, main script and specialized scripts. · Control the application behavior · Extract databases data · Insert, inspect, control and modify database data · Control the objects (composites, watch lists, list of rules...)
The specialized scripts allow the user to take control over some specific tasks. The application offers you the possibility to write scripts for the following tasks:
Money management: Contains five events, the first and last events happen once while the other events could happen many times during the backtesting. · OnStartSimulation: The simulator executes this script before starting the backtesting process. · OnNewTrade: The simulator executes this script before entering a new position. · OnCloseTrade: The simulator executes this script before exiting a position. · OnEndPeriod: The simulator executes this script at the end of each period or bar. (In end of day back-testing, a period is a day) · OnEndSimulation: The simulator executes this script when the back-testing process ends.
Example: Create a script that initialize an optimizable variable in the 'OnStartSimulation' event Create a script, in the 'OnNewTrade' event, that updates the number of shares to buy depending on the trading system drawdown and the optimizable variable defined in the 'OnStartSimulation' event
Example: Create a time-series metric for your trading system using the 'OnEndPeriod' and the 'OnEndSimulation' events
List of
rules analyzer metrics: Script
that let you create metrics to assess rules
Ranking
system analyzer metrics: Script
that let you create metrics to assess ranking systems
Simulation metrics: Script
that let you create metrics to assess simulations
Prediction model metrics: Script that let you create metrics to assess prediction models Example:
Calculate a custom metric that uses others already calculated
metrics.
Post-Parsing data: Script that let you manipulate parsed data just before the application stores it Example: Correct bad quotes
URL-Script: Script
that let you dynamically create URLs for the downloader to download. The data is
then passed to the Pre-Parsing and Post-Parsing scripts if they are
implemented.
Functions: Function scripts let you create QuantShare functions. These functions could be used in charting, simulation... Example: Correct a custom indicator that is not available in the QuantShare indicators list
1.2. Script Control
.Net script shares the same control; the control is an advanced text box control where you can type in your script. You can press on CTRL+SPACE at any moment to display the list of functions or variable that you can use in the current script. Each script contains its own functions and classes. You can click on the right icon to display information about the current script.
|
|