Click here to Login




Rules Manager


Rules Manager

1. Rules Manager

 

1.1. Introduction

The Rules manager allows you to manage and create easily and quickly as many rules as you want.

A rule is a formula that can be used in charting, simulation...
A list of rules is a list that contains one or many rules.
A rule can have one or several iterations.

You can create undefined variables within a rules and specify the start, the end and the increment value of these variables.
This process makes it easy to create hundreds of rules.

List of rules can be used in many situations.

Examples:
You can back-test rules to see how each rule performs.
You can use the optimizer, and run a genetic algorithm process on a list of rules to see which combination of rules performs best.
 
When creating a trading system, you can define already created rules as buy, sell, and short or cover entries.

1.2. Create a rule

Open the rule manager (Analysis -> Rules Manager)
Click on 'Add' to create a list of rules
Select the list of rules you have just created.

Here is how to create a rule.
If you rule is something like x > y or x = y, you just have to type the first component in the first input box, and the second one in the second input box.

Example: rsi (14) > 50 

 

A red flag means that there is an error in the formula, if everything is ok then the red drag will turn into a green one.

In the combo box you can select NA, and then type directly the formula in the first input

 

When you click on the icon next to the red flag, a small form will appears.
This form contains all functions definitions and parameters, use it to select the function you would like to include in your formula then click on OK.

 

The grid below the inputs boxes is used to transform one rule into several ones.

Example: instead of specifying rsi (14) > 50, you can type rsi (14) > a to make a line in the grid appears.

Type in the minimum, the maximum and the step value
In this example, we set a min of 50, a max of 90 and a step of 10, and this rule became a five iterations rule.

1.3. Rules Manager

 

Open the rule manager (Analysis -> Rules Manager)

 

  • Add: Create a list of rules, a dialog box will show up, you just have to enter a name and click on OK
  • Remove: Select a list of rules from the list of rules List then click on "Remove" to delete this list
  • Analyze: Analyze a list of rules (See below)
  • Mass Rules: Create mass rules (See below)
  • Close: Close the 'Rules Manager' form

 

1.4. Drag and drop

You can drag and drop rules or list of rules by selecting a rule or a list of rules and dragging it to the clipboard.
From the clipboard, you can drag the posted rules by clicking on 'copy'.

 

1.5. Mass Rules

'Mass rules' is a tool that will help you create many rules very quickly using masks.

Click on 'Mass Rules' button; a dialog box will appears.

Now you have two ways to add functions:

  • Add button
  • Add from time-series button 

 

The added functions will appear on the left list.
In our example, we added two functions: Inside() and Outside()

 

You can now create your masks and specify variables within masks if needed.

Type for example: mask > ref(mask, a) then click on Create, and make variable "a" varies from one to 10 with one as a step. We are about now to create 20 rules (2 rules and ten iterations for each rule)

After clicking on "Create Rules", two rules will be created (with 10 iterations for each rule)

Inside() > ref(Inside(), a)
Outside() > ref(Outside(), a)
 

1.6. Analyze rules

Analyze rules is a tool that will let you back-test your rules one by one before using them in ranking systems, simulation, neural networks...

The rules analyzer is not limited to analyzing the performance of trading rules,  it can also be used to analyze any market behavior that occur after the trading rule signal become valid.
If you are trading option you can for example analyze which rules or combination of rules leads to a stock or future higher volatility.

Select a list of rules then click on Analyze, the settings dialog box will appears.

1.6.1. Symbols & Periods


Specify the symbols and the simulation period.

1.6.2. Filter


Specify upper and lower limits for a position output, every position that have the output value outside these limits will be rejected.
You can also specify limits by selecting a maximum number of standard deviation for position outputs.

1.6.3. Outputs


Outputs are formulas that the back-tester calculates when he enters a new position. Example: Performance for the next 10 bars which corresponds to the formula "perf(open, -10)" 

The outputs form appears once you click on the "Select Outputs" button.

Defined outputs:
Performance, use a trailing stop: Enter a position then exit when drawdown reach –X Percent (Trailing stop)
Performance, use N-Bars stop: Enter a position then exit after X bars (N-Bars stop)
Performance, custom rule for exit + trailing stop: Enter a position then exit when drawdown reach –X Percent or when the specified rule is TRUE.
Performance, exit when rule is false: Enter a position then exit when the rule is no longer TRUE or valid.

The "Custom Output" lets you add your own advanced formula.
See (HELP: Advanced Rules; Output) for an example

1.6.4. Fixed Rule

You can specify a fixed rule that will be added to the rules to be analyzed.
Fixed rule can contain iterations.
Example:

Let us say we want to analyze theses rules:

  • RSI (14) > 10
  • Perf (close, 10) > a, where "a" varies from two to four, with a step of two
     

As a fixed rule, we have:
"close > cl" , where "cl" varies from 10 to 20 with a step of 10.

You will end up with a total of "1 + (1 * 2)" rules multiplied by 2 (fixed rules) for a total number of six rules.
Here is the list of all the rules that will be analyzed:

close > 10 && Rsi(14) > 10

close > 10 && Perf(close, 10) > 2

close > 10 && Perf(close, 10) > 4

close > 20 && Rsi(14) > 10

close > 20 && Perf(close, 10) > 2

close > 20 && Perf(close, 10) > 4

 

1.6.5. Metrics

Jscript.Net formula is used to create metrics.

Example of metric formula:

Fitness = OutputPerBar * (NbPositions > 100);

Set the output to zero if the number of position generated by the rules is lower than one hundred.
For each "metric formula", you can add additional metrics using the following function: Functions.AddMetric

 

1.6.6. Results

When analyzing rules completes, a grid containing the results appears.


Each line represents a rule or iteration.

Columns abbreviations:

·         Out PB: Average position outputs per bar

·         Output: Average position outputs

·         Bars held: Average number of bars per position

·         Positions: Number of positions

·         PP: Percentage of positive position output

·         Best: Best position output

·         Work: Worst position output

·         SDV: Standard deviation of position outputs

You can easily create new list of rules from the analyzed rules.


On the "Rules" column click on the right mouse button to make a menu appears.

Search:
Search for rules that contains a specific keyword, found rules will be checked.


Graph per Output:

Display a chart that plots the analyzer results per Output.


Group results per variable:

Display a chart that plots the analyzer results per variable value.






Manual

 

Back Parent

 

Download Manual in CHM or PDF format







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.