Welcome to The Structure of a Study

 

A study is an object that can be executed, passed around, or shared that describes how to calculate and display a technical stock indicator.  The advantage of this structure is a study can be passed around like a jelly bean and every part of the program knows how to use it.  A study is composed of three main sections, 1) The properties of the study, 2) The definition or how to calculate the study,  and 3) The view which describes how to plot the study on a chart and determines what constitutes a buy and sell signal.

 

Properties

 

These are the basic properties of a study which describes how to display a study.

 

 

Study Name - This is the main name of the study which is displayed in the main menus of the program to identify the study.

 

Short Study Name - This is an abbreviated name of the study used in the chart titles and prism column headers.

 

Sub Menu Name - If a name is present here, the study will be listed under this name as a submenu.  This allows easy categorization of studies in the menus

 

Window Type - This tells where the study will be display in a chart.  If it is the Chart Window it will be overlaid on the chart, if it is a study window, each time you add the study it will create a new panel on the chart.

 

Show In Menu - If false this study will not show up in the study menus throughout the program.  This should be true and is usually only turned off for internal system studies. Admin visible only.

 

Do Not Plot - When true the study will not be plotted.  This should be false and is usually only turned off for internal system studies. Admin visible only.

 

Center on Zero - This is for oscillator studies that move above and below zero.  When this is set to true, the study will always place the zero point in the middle of the chart panel.

 

Scale Type - This describes how to scale all the chart lines in the study. Below are the options for this property.

 

Adjustable Chart - Uses the highest and lowest value of each study chart line displayed in the chart to set the displayed range of the study chart lines.  In this mode the study chart line will always fill the chart panel and each chart line will have its own scale.

 

Adjustable History - Uses the highest and lowest value of each study chart line throughout the entire chart history, even if not displayed,  to set  the displayed range of each study chart line.   Each chart line will have its own scale.

 

Adjustable Study - Uses the highest and lowest value of all the study chart lines displayed in the chart to set the displayed range of the study chart lines.  In this mode the study chart line will always fill the chart panel and each chart line will have the same scale.

 

Adjustable from Zero - Uses the highest value of each chart line and zero for scaling.  This is good for studies like volume.

 

Fixed Price - Each chart line will plot with the exact same scale as chart price.  This is good for studies like moving averages on price.

 

Fixed - Allows you to set a high and low price and all chart lines will be scaled to the range.  This is good for studies like stochastics that goes from 0 to 100.

 

Scaling  Fixed High - Only used for "Fixed" scale type, sets the high range to plot a study.

 

Scaling  Fixed Low - Only used for "Fixed" scale type, sets the low range to plot a study.

 

Creation Date Time - A read only field indicating the last time the study was changed.

 

Definition and View

 

 

Definition

 

Inputs - These are the default input value that can be changed by the user.  For example, the default length of momentum is 27, if the value was placed in a formula it couldn’t be changed easily.  By using an input the user can change the value in many places throughout the program.  Below are the various properties of an input.

 

Input Name - The name of the input, this name can be used directly in a formula.

 

Input Value - This is the default value of the input, it can be either a number, a reference to number series,  the last stock trade,  or a symbol depending on how the Input Default Type is set.

 

Is Fractal - If true the input uses the value as a reference to a number series.  For a PhiCube study this would be  the appropriate four, five, or six series.  For any other study it would refer to the Fibonacci series.   For the Fibonacci series the references and number would be  1=2, 2=3, 3=5, 4=8, 5=13, 6=21, 7=34, 8=55, 9=89, 10=144, 11=233, 12=377, 13=610, 14=987, 15=1597.

 

Input Default Type - This tells the program what type of input is being used.

 

Number - The input is a number to be used in the calculation.

String - The input is a symbol to be used in the STOCK Operator.

Price - The input value will be ignored and will be replaced with the current last trade when calculating.  Useful for stop loss calculations.

 

Formulas - This is a list of formulas that describe how to calculate the study.  Each subroutine starts with a name that can be referenced by another subroutine,  chart line, fill, or signal. That is followed by an equal sign, then the formula, then by a semicolon.

 

Subroutine Name = xxxxxxxx ;

 

See "Building a Study with the Study Wizard" for more information.

 

View

 

Chart Lines - This describes how to plot a subroutine on the chart.

 

Line Name - This is the name of the line that will be displayed in the study title on the chart.  If you add an input name in parenthesis, a user will be able to change the input in the chart title. i.e. ROC(Length) will put ROC[27] in the study title and the input will be in a small edit box so the user can change the value on the chart.

 

Formula Name - This is the subroutine name from the formula section to plot on the chart.

 

Plot Type - This is how to plot the formula on the chart.

 

Line - connect the formula values as a line.

 

Bar - plot each formula value as a bar between the value and the lowest value in the scale.

 

Zero Bar - plot each formula value as a bar between the value and zero.

 

Side Bar - Divide up the total unique values of all the formula value according to the "Side Bar Number" in Preferences and plot how many values are in each range as a bar extending from the left side of the chart.

 

Points - plot each formula value as a small square on the chart.  Do not connect the values.

 

Line Presentation - This described the appearance of a chart line on the chart

 

Line Color - the color of the line.

 

Line Width - How many pixel wide the line is

 

Line Style - Determines if the line is to appear solid, dotted, or dashed.

 

Theme Line Color - If set to true this chart line will use a predefined color set in the preferences theme.  This allows automatic changing of colors when changing from a theme with a light back ground to one with a dark background and visa versa.

 

Line Color Alpha - This determines how transparent the line is.  A value of 255 is completely opaque, a value of 0 is completely transparent.

 

Show In Info Window - If true the value of the chart line under the info window cursor will be displayed in the info window.

 

Hide Line - If true, the chart line will no longer be visible on the chart.  This is used by the info window to toggle a chart line off and on.

 

Fill Areas

 

This allows decorative coloring of the chart.  It could be aesthetics or the color could reflect buy and sell points.  All fill areas are defined between two subroutine formulas and will only fill from low to high.

This is important because you can give different colors when one line is below another and another color when one line is above.

 

Fill Name - This is a name given to the fill, it isn't used anywhere but as a reference.

 

Upper Line Name - This is the name of the chart line to end filling between.

 

Lower Line Name - This is the name of the chart line to start filling between.

 

Fill Presentation - How to draw the fill between the two chart lines.

 

BackColor - This is the color to fill in between the two lines.  It is the only color used if Back Gradient Style is set to solid.

 

BackColors2 - If a Back Color Gradient is being used the color of the fill will be a blended gradient between the backcolor and backcolor2.

 

Back Gradient Style - How to display a blend gradient between backcolor and backcolor2.

 

Back Texture - You can select a bitmap to shade the fill area.

 

Text Color - not used in a fill.

 

BackColor Alpha - This determines how transparent the fill is.  A value of 255 is completely opaque, a value of 0 is completely transparent.  Most fills should have a low alpha to avoid overwhelming the chart.

 

Condition - unused.

 

Signals

 

This usually described what constitutes a buy or sell signal but can also be other conditions.

 

Condition Name - The name of the signal condition.  This is only used as a reference and is not used elsewhere in the program.

 

Formula Name - This is the name of the subroutine formula used to determine if a condition exists.  This formula must return a Boolean value meaning the formula must use a comparison operator like greater than.  If the Boolean value is true then the signal condition is true.

 

Optimize Type - The optimizer needs to know which signal condition is a buy and which one is a sell.  Set this to buy or sell.  It can also be set to generic for additional signal conditions outside of a buy or sell.

 

Text - This is the text to be displayed in a Prism Cell, use LONG for a buy unless you change the default prism long name in preferences.

 

Color - this is the color the signal will display in a prism or as color bars on a chart if Use Theme color is set to false.

 

Use Theme Color - If set true buy and sell conditions will use the default buy, sell, neutral colors in preferences.