Difference between revisions of "User Rules"

From NakedMarkets
Jump to navigation Jump to search
Line 55: Line 55:


=== Using User Rules during Backtesting ===
=== Using User Rules during Backtesting ===
===== Setup Rules =====
The user-defined rules can be attached to the charts during the backtesting in order to save time.
The [[Setup Rules|Setup Rule]] has to be attached to a Chart to be executed.
All is detailed in this [[User Rules Attachment|dedicated page]].
<br>This can be done by drag&dropping the [[Setup Rules|Setup Rule]] from the left Pane to the desired Chart :
[[File:BacktestSetupRuleAttach2.png|600px|left|alt=BacktestSetupRuleAttach2|BacktestSetupRuleAttach2]]
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Once the [[Setup Rules|Setup Rule]] is attached to the Chart, the name of the Rule will be printed on the top-left corner.
<br>If the [[Setup Rules|Setup Rule]] has the [[Actions#Pause Backtest|Pause Backtest Rule]] as an Action, the Backtest will pause automatically when the [[Setup Rules#Setup Condition|Setup Condition]] is filled.
<br>If the [[Setup Rules|Setup Rule]] has an [[Entry Rules|Entry Rule]] as an Action, Naked Markets will create an order accordingly.
<br>
It's possible to list all Rules on a chart by right-clicking and selecting "List of rules" :
[[File:BacktestSetupRuleList.png|600px|left|alt=BacktestSetupRuleList|BacktestSetupRuleList]]
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Thus, you can select the desired Rule and edit it or detach it :
[[File:BacktestSetupRuleList2.png|600px|none|alt=BacktestSetupRuleList2|BacktestSetupRuleList2]]
<br>
<br>
===== Entry Rules =====
The [[Entry Rules|Entry Rule]] can be executed automatically by the related [[Setup Rules|Setup Rule]] or manually by attaching it to a Chart.
<br>This can be done by drag&dropping the [[Entry Rules|Entry Rule]] from the left Pane to the desired Chart :
[[File:BacktestEntryRuleAttach.png|600px|left|alt=BacktestEntryRuleAttach|BacktestEntryRuleAttach]]
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
===== Exit Rules =====
The [[Exit Rules|Exit Rule]] can be executed automatically by the related [[Entry Rules|Entry Rule]] or manually by attaching it to an Order.
<br>This can be done by drag&dropping the [[Exit Rules|Exit Rule]] from the left Pane to the desired opened Order in the bottom pane :
[[File:BacktestExitRuleAttach.png|600px|left|alt=BacktestExitRuleAttach|BacktestExitRuleAttach]]
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Once done, the Order will become red to confirm the attachment of the [[Exit Rules|Exit Rule]] on it.
 


=== Shortcuts ===
=== Shortcuts ===

Revision as of 08:54, 28 March 2022

Summary

The User Rules are the Rules created and modified by the user. These Rules can rely on the Default Rules, provided by the software, and/or on the User Rules themselves.
These Rules can be modified or deleted by the user.
A User Rule can't reference itself but can reference any other user-defined User Rules.

Rules types

The Rule Manager can define the following User Rules types :

  • Core Rules : this kind of rule can return a boolean expression (True or False) or a value (any number)
Usertree setuprule

Setup Rules : this kind of rule is used to define a condition and take an action accordingly

Usertree entryrule

Entry Rules : this kind of rule defines the way to enter the market

Usertree exitrule

Exit Rules : this kind of rule defines the way to exit the market


Rule creation

By clicking on the button "New Rule..." (bottom right-corner of the Rule Manager), you can create any type of Rule needed.
The Rule name helps to identify the Rule within the software. The Rule type allows you to define a corresponding Rule. And the Rule label is the information you wish to associate with this rule.

RuleManagerNewRule










You can add Default Rules or User Rules on an existing Rule by drag&dropping it on the main pane.

Rules organization

Since the Rule Manager can help defining complex and elaborate Rules, eventually a complete Trading System, it's important to organize the Rules structure.
Each User Rules can be placed in any folders created by the user in order to maintain lisibility. This Rule structure will be displayed during Backtest, to attach or drag&drop a Rule to a chart for example.

RulesManagerOrganization

















Using User Rules during Backtesting

The user-defined rules can be attached to the charts during the backtesting in order to save time. All is detailed in this dedicated page.

Shortcuts

It's possible to assign an Entry Rule to a keyboard shortcut in order to save time when you want to enter the Market.
This can be done in the User Settings Windows, under the Misc tab :

EntryRulesShortcut












The default shortcuts are Ctr+B for Buy Orders and Ctrl+S for Sell Orders but this can be changed, in the Hot Keys tab.