Conditions
Description
|
Conditions are used for marking an event or state on a bar. They are binary. That is, they are either true or false for each bar.
|
Situational examples
|
Reversal days
Price crossing a moving average
Stochastic %K crossing %D
|
Formula components
|
Conditions are composed of bar, function, parameter, and study values.
Note: To enable you to quickly identify inserted conditions in your formulas, CQG inserts the letter “B” in front of the condition name.
|
Formula example
|
High(@) > High(@)[-1] AND Low(@) < Low(@)[-1]
Marks the outside bar on a chart. The outside bar is one with a higher high and lower low than the previous bar. (cqg.BarOutside)
|
Location
|
Formula Builder Conditions window
Toolbox
|
Used with
|
Condition alerts
Market Scan
Signal Evaluator
Trade systems
Note: Function-type studies rely on the use of a condition as a parameter. When these studies are plotted on a chart, the values returned depend on the occurrence of the defined condition, as well as the other parameters used.
|
Pre-defined formulas
|
CQG offers these formulas (parameters in parentheses):
B.BeginOfDay(@,6,55)
B.cqg.ADXHigh(@,10,20)
B.cqg.ADXLow(@,10,20)
B.cqg.BarInside
B.cqg.BarOutside
B.cqg.CAboveUBB
B.cqg.CBelowLBB
B.cqg.DDIF_XABOVE
B.cqg.DDIF_XBELOW
B.cqg.HVolLow(@,20,260,500,0.100)
B.cqg.ImpVolLow(@,250)
B.cqg.MA1XAboveMA2(@,21,55)
B.cqg.MACDCross
B.cqg.NewHigh(@,252)
B.cqg.ReversalDown(@,1)
B.cqg.ReversalUp
B.cqg.RSIHigh(@,9,20.000)
B.cqg.RSILow(@,9,20.000)
B.cqg.StochFalling
B.cqg.StochRising
B.cqg.StochXAbove(@,20.000,10)
B.cqg.StochXBelow(@,80.000,10)
B.cqg.VolumeLow(@,50)
B.cqg.YCurveSlopeC(@,0)
B.cqg.YCurveSlopeT(@,0)
B.OBV_PLUS1(@,7,55,15,0,7,55)
|
User Values
Definition
|
User values yield definite numbers. You can think of them as a way to store calculations (or even actual numbers).
They are dynamic parameters that when changed, change all instances of that user value throughout the system. Suppose you create a user value @price and set its value to mid. When you change the value of @price to high, all instances of @price across all applications are then calculated by the high and not the mid.
|
Formula components
|
Conditions are composed of bar, function, and parameter values.
Note: To enable you to quickly identify inserted User Values in your formulas, CQG inserts the letter “V” in front of the condition name.
|
Formula example
|
MA_DIFF_15_60: MA (@Exp15) – MA (@Exp60)
|
Location
|
Formula Builder User Values window
Toolbox
|
Used with
|
Signal Evaluator
Build other formulas from user values: QFormulas, conditions, custom studies, and trade systems.
User values appear as one of the choices in any study where price is a parameter.
|
Pre-defined formulas
|
V.Bars_Close
V.Close
V.cqg.RelRange
V.Next_Bars_Open
V.Previous_High
V.Previous_Low
|
18.To create new conditions or user values -
Click the New button on the Conditions or User Values tab from Formula Builder to open the Create a New Condition (or User Value) window.
-
Enter a condition (user value) name in the Create a New…window. User values cannot be named the same as a bar value, for example, Open, Close, and so forth.
-
Click OK to open Formula Builder.
-
Click the Toolbox button to define the new condition (user value).
-
Select the elements from the Formula Toolbox to insert into the new condition (user value).
To copy a condition or user value
You can modify an existing condition or user value to use it as the basis for a new user value or formula.
-
Click a Condition or User Value from the Available…. section on the relevant tab in Formula Builder.
-
Click the Copy button to open the Copy a User Value window.
-
Enter a different name for the Condition or User Value.
-
Click OK to close the Copy a …window.
The newly named formula appears in the Formula for… section and can be modified either directly or by selecting and inserting items from the Formula Toolbox.
19.To define condition and user value parameters (Parms Button)
The Parameters window allows you to save specific, often-used values to be easily inserted into a condition, user value, custom study. Parameters are listed on the Special tab of the Formula Toolbox.
To open this window, click the Parms button associated with the condition, user value, and custom study or trade system.
To view and edit parameters used -
Select the Condition, User Value, Custom Study, or Trade System for which you want to view parameters.
-
Click the Parms button. The standard parameters associated with the study are displayed.
-
Make desired changes to the parameters, including adding a column or row header.
-
Click OK.
To add a parameter -
Click the Parms button.
-
Click the New button.
-
Enter a name for the parameter.
-
Select the Int check box if the parameter is going to be an integer. Leave the box unchecked if the parameter is going to be a floating-point decimal number.
-
Enter a default value.
-
Enter column and row header names if desired.
-
Enter a note if desired.
-
Click OK.
To delete a parameter -
Select the Condition, User Value, Custom Study, or Trade System that contains the parameter you want to delete.
-
Click the Parms button.
-
Select the parameter you want to delete.
-
Click the Delete button.
To insert a parameter
After customizing and adding parameters, they can be inserted into a formula.
-
Click in the location you want to add the parameter in the Formula Editor.
-
Click the Toolbox button.
-
Go to the Special tab.
-
Click the parameter you want to add.
-
Click the Insert button.
-
Click Close.
Note: Each parameter can be inserted only into the condition for which it was defined. To re-use the same parameter for more than one condition, you must redefine the parameter.
20.Creating Conditions: Example -
Create a new condition.
-
Choose studies using the toolbox. In this example, we inserted SSK, then used the Special menu to add XABOVE. Finally, we added SSD.
The formula is added to the list:
-
Create new parameters for the condition (click Parms button).
-
Change parameter values. Highlight the entire condition in the formula editor window:
-
Click Setup.
-
Select new values.
-
Add the custom condition to a chart. Right-click on a bar or candlestick chart, and click Select conditions for marking Bar/Candl. Choose a color and/or symbol to add to chart.
Results :
21.Specify Conditions Window
The Specify Conditions window is used with several applications:
Portfolio Monitor and Instrument Monitor
Charts and Studies
DOMTrader (Show on Trading Interface button)
MarkIt
Market Scan
To create a new condition
Click the Define Condition button to open Formula Builder.
To add a condition
-
Click a condition on the list.
-
Click the Include button.
-
Optionally, modify the display. Click the symbol to open a symbol; click the colored square to open a color palette:
-
Optionally, modify the parameters by typing new values in the field. The parameters field is displayed only when a condition is selected for marking and that condition has parameters.
Click the Exclude button below the display parameters to remove the condition.
Click the Move Up and Move Down buttons to move the conditions up and down the list.
To create and manage folders
Right-click the Conditions list, then click Manage Folders to open the folder management window. You can also click the Folders button on the Utility toolbar|topic=Utility Toolbar.
Folder management here is the same as on Formula Builder. See: Manage Folders menu.
To add a condition to a folder, right-click a condition, then click Move to Folder.
Share with your friends: |