TradeStation Reserved Words

(All information herein is the property of TradeStation.
All terms and definitions can be found in the TradeStation manuals and help files.)

The most common Reserved Words you need to remember are:

#

(

)

*

+

-

/

.

[

]

<=

>=

Open

O

High

H

Low

L

Close

C

Bar

CurrentBar

 

Volume
V

OpenInt

I

 

 

 

 

 

Today

Yesterday

Tomorrow

Ago

Day

 

 

Above

Below

Crosses Over

Crosses Under

Crosses Above

Crosses Below

 

Alert

Buy

Sell

ExitLong

ExitShort

 

 

And

Or

If

Then

Else

Begin

End

Input

Variable

Inputs

Variables

Var

Vars

 

Condition0 … Condition99

Value0 … Value99

Contract(s)

Cost

 

 

 

Date

Time

Data1 … Data50

DownTo

While

 

 

Plot1 … Plot4

From

Point(s)

Print

 

 

 

Sunday

Monday

Tuesday

Wednesday

Thursday

Friday

Saturdayy

Symbols and their meanings:

Word or Symbol

Meaning

#

Character used to denote compiler directives

(

Open parenthesis, used in formulas

)

Close parenthesis, used in formulas

*

Multiplication sign

+

Addition sign

-

Subtraction sign

/

Division sign

Less than sign

<=

Less than or equal to sign

<> 

Not equal to sign

=

Equal to sign

Greater than sign

>=

Greater than or equal to sign

[

The square brackets are used to designate offsets.  To say “three bars ago” you would say [3].  Square brackets are also used in identifying array elements.  For example, MyArray[4] is element number four in the array called MyArray.  MyArray[4,2] would be the fourth element in the 2nd column of the array called MyArray.

]

Is the closed square bracket.  See above.

{

The curly bracket, also known as French Braces, is used to designate the beginning of a comment text area.  You may write notes of explanation or reminders about what you wanted to do with this section of code, and include it in curly brackets.  TradeStation ignores anything within the set of curly brackets, { … }

}

Is the closed comment brace.  See above.

 

 

Glossary of Reserved Words:

1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

1

#BEGINALERT

A compiler directive including all EasyLanguage instructions between #BeginAlert and #End in the analysis technique’s calculation when the Enable Alert check box is selected and the study is evaluating the last bar of a chart. All syntax between #BeginAlert and #End are ignored, including the calculation of MaxBarsBack, unless the Enable Alert check box is selected in charting and the analysis technique is evaluating the last bar of a chart. 

Example

#BeginAlert

If Close[50] > Close and ADX(Length) > ADX(Length)[1] then Alert("ADX Alert");

#End;

#BEGINCMTRY

A compiler directive that executes the EasyLanguage instructions between #BeginCmtry and #End only when using the Expert Commentary  tool to select a bar on a chart or a cell in a grid.

Note that all statements between the #BeginCmtry and #End are ignored, including calculation of MaxBarsBack, unless commentary is generated.

Example

{ Calling Accumulation Swing Index Expert Commentary }

#BeginCmtry

  Commentary(ExpertADX(Plot1));

#End;

#BEGINCMTRYORALERT

A compiler directive that executes the EasyLanguage instructions between #BeginCmtryOrAlert and #End only when the Enable Alert check box is selected when using the Expert Commentary tool to select a bar on a chart or a cell in a grid.

Note that all statements between #BeginCmtryOrAlert and #End are ignored, including calculation of MaxBarsBack, unless the Enable Alert check box is selected or commentary is generated.

Example

{ Calling Accumulation Swing Index Expert Commentary }

#BeginCmtryOrAlert

If Close[50] > Close and ADX(Length) > ADX(Length)[1] then Alert("ADX Alert");

  Commentary(ExpertADX(Plot1));

#End;

#END

A compiler directive used in conjunction with #BeginAlert, #BeginCmtry, and #BeginCmtryorAlert to terminate an alert or commentary statement.

Example

{ Calling Accumulation Swing Index Expert Commentary }

#BeginCmtryOrAlert

  If Close[50] > Close and ADX(Length) > ADX(Length)[1] then Alert("ADX Alert");

    Commentary(ExpertADX(Plot1));

#End;

A

1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

A

Skip word.

This word is ignored (“skipped”) in EasyLanguage and is not necessary.  These skipped words however, do make it easier to understand the purpose of the code.  By default, unnecessary words and sections marked as comments will appear dark green in the EasyLanguage PowerEditor.

Example

If a Close is > 100 Then …

the word "a" is not necessary and the code functions the same way regardless of its presence.

Above

This word is used to check for the direction of a cross between values.  It is used in conjunction with the reserved word “crosses" to detect when a value crosses above, or becomes greater than, another value.  A value (Value1) crosses above another value (Value2) whenever Value1 is greater than Value2 in the current bar, but Value 1 was equal to or less than Value 2 in the previous bar.  Above is a synonym for the reserved word “Over.”

Examples

If Plot1 Crosses Above Plot2 Then Buy This Bar;

If Value1 Crosses Above Value2 Then Buy This Bar;

AbsValue

Returns the absolute value of the input value “num,” a numeric expression.

Examples

Value1=AbsValue(-25.543) returns a value of 25.543

Value1=AbsValue( 25.778) returns a value of 25.778

Ago

Refers to values from another reference point.  Ago can also be referred to as an offset, and can be represented by using notation consisting of a number in square brackets where x is the number of points offset.

Examples

Value1=C[1];

Sets Value1 to the Closing price of the previous bar

Value1=Close of 1 Bar Ago;

Sets Value1 to the Closing price of the previous bar

Alert

True/False value will determine whether the study generates an alert condition.

A True value for Alert will only generate an alert when alerts have been enabled for the study in the Properties tab.

Alerts are only generated for the last bar.

Example

Alert = True will generate an alert if the Enable Alert check box are enabled under the Properties tab.

Additional Example

If you only wanted an alert to be triggered under certain conditions, you could use the following syntax:

If {Your Alert Criteria} Then Alert = True;

AlertEnabled

Returns True if alerts have been enabled in the Properties tab of an analysis technique.  False is returned if alerts are not enabled. 

Alerts are only generated for the last bar.

Example

AlertEnabled will return True if alerts have been enabled.

Additional Example

If you only wanted code to be evaluated only when the user had set the study to enable alerts, you could use the following syntax:

If AlertEnabled Then

  Begin

    {Your Code Here}

  End;

All

Used in conjunction with "share(s)" or "contract(s)" in trading strategies specifying that all shares/contracts are to be sold (for long positions) or covered (for short positions) when exiting the current position.

Example

If Condition1 then ExitLong all shares next bar at market;

An

Skip word.

This word is skipped in EasyLanguage and is not necessary.  These skipped words however, do make it easier to understand the purpose of the code.

By default, unnecessary words and sections marked as comments will appear dark green in the EasyLanguage PowerEditor.

Example

If an Open is > 100 Then …

the word "an" is not necessary and the code functions the same way regardless of its presence.

And

This boolean operator is used in condition statements to check multiple conditions.

AND requires that in order for a condition to be True, all conditions must be True.

Examples

If Plot1 Crosses Above Plot2 And Plot2 > 5 Then

AND is used here to determine if the direction of the cross of the values Plot1 and Plot2, and that Plot2 is greater than 5 are both True on the bar under consideration.  If either is False, the condition returns False.

If Value1 Crosses Above Value2 And Value1 > Value1[1] Then

AND is used here to determine if the direction of the cross of the variables Value1 and Value2, and that Value1 is greater that Value1 of one bar ago are both True on the bar under consideration. If either is False, the condition returns False.

Arctangent

Returns the arctangent value of the specified (Num) of degrees.

(Num) is a numeric expression to be used in the calculation.

The arctangent is the inverse of the tangent function.

(Num) should be the number of degrees in the angle.

Examples

ArcTangent(45) returns a value of 88.7270.

ArcTangent(72) returns a value of 89.2043.

Array

Reserved word used to declare variable names that can contain multiple values.

A variable declared as an array can hold more than one value at the same time.

The number of values that can be held by an Array is determined when the Array name is declared by a number in square brackets, following the variable name.

The initial value of an Array can be determined for all values by one number in parenthesis after the declaration.

Examples

Array: AnyName[4](0); declares the variable AnyName that can hold four distinct values and initializes them to zero.

Array: NewName[10](5); declares the variable NewName that can hold ten distinct values and initializes each value to five.

Arrays

Reserved word used to declare multiple variable names that can contain multiple values.

A variable declared as an array can hold more than one value at the same time.

The number of values that can be held by an Array is determined when the Array name is declared by a number in square brackets, following the variable name.

The initial value of an Array can be determined for all values by one number in parenthesis after the declaration.

Examples

Arrays: AnyName[4](0), AnotherName[4](0); declares the variables AnyName and AnotherName that can hold four distinct values each, and initializes all of the values to zero.

Array: OldName[10](5),NewName[10](5); declares the variables OldName and NewName that can hold ten distinct values and initializes each value to five.

ArraySize

Reserved for use with custom DLLs designed for EasyLanguage. Refer to the documentation in Omega Research Developer's Kit for more information about this and the EasyLanguage Tool Kit Library ELKIT32.DLL.

ArrayStartAddr

Reserved for use with custom DLLs designed for EasyLanguage. Refer to the documentation in Omega Research Developer's Kit for more information about this and the EasyLanguage Tool Kit Library ELKIT32.DLL.

Ask

Returns the ask value of an option or leg calculated by a Bid/Ask Model.

Example

If Ask of Option - Close of Option < .125 then

           Alert("Very Low Ask");

Asset

Refers to an option's underlying asset in OptionStation.

Example

Value1 = Volume of Asset;

AssetType

Evaluates a position leg to determine if it is an asset.

Example

If LegType of Leg(1) = AssetType Then {Your Operation Here}

AssetVolatility

Returns the volatility of the underlying asset.

If no value is available for AssetVolatility, then zero is returned.

Example

If AssetVolatility > 50 Then {Your Operation Here}

At

Skip word.

This word is skipped in EasyLanguage and is not necessary.  These skipped words however, do make it easier to understand the purpose of the code.

By default, unnecessary words and sections marked as comments will appear dark green in the EasyLanguage PowerEditor.

Example

Buy 100 Contracts at Market;  the word "at" is not necessary and the code functions the same way regardless of its presence.

At$

Used in trading strategies to anchor exit prices to the bar where the entry order was placed.  At$ must be used in conjunction with an entry order that has an assigned label.

Example

The following strategy buys when the 10-bar moving average crosses over the 20-bar moving average, placing a stop loss order 1 point under the Low of the bar where the cross over occurred by appending At$ to the ExitLong statement.

If Average(Close, 10) Crosses Over Average(Close,20) then

Buy ("MA Cross Over") next bar at market;

ExitLong from entry("MA Cross Over") At$ Low - 1 point stop;

AtCommentaryBar

Returns True if the user has selected this bar as the Expert Commentary Bar.  False is returned if the bar is not the Expert Commentary bar, or if the user has not inserted the Expert Commentary Tool. 

Example

AtCommentaryBar will return True if the bar has been selected with the Expert Commentary Tool.

Additional Example

If you only wanted begin a commentary section based on the selected bar, you could use the following syntax:

If AtCommentaryBar Then

           Begin

                 {Your Commentary Code Here}

           End;

AvgBarsLosTrade

Returns the Average number of bars that elapsed during losing trades for all closed trades.

Examples

AvgBarsLosTrade returns 3 if the number of bars elapsed during 4 losing trades were 4, 3, 6, and 2.

AvgBarsLosTrade returns 5 if the number of bars elapsed during 2 losing trades were 7 and 3.

AvgBarsWinTrade

Returns the Average number of bars that elapsed during winning trades for all closed trades.

Examples

AvgBarsWinTrade returns 3 if the number of bars elapsed during 4 winning trades were 4, 3, 6and 2.

AvgBarsWinTrade returns 5 if the number of bars elapsed during 2 winning trades were 7, and 3.

AvgEntryPrice

Returns the Average entry price of each open entry in a pyramided position.

AvgEntryPrice only returns the average entry price for open trades.

Examples

AvgEntryPrice returns 150 if three trades are currently open and were entered at a price of 130, 145 and 175.

AvgEntryPrice returns 50 if four trades are currently open and were entered at a price of 42, 53, 37 and 68.

AvgList

Returns the average value of the inputs.

(Num1) is a numeric expression representing a value to be used in the calculation.

(Num2) is a second numeric expression representing a value to be used in the calculation.

(Num3) is a third numeric expression representing a value to be used in the calculation, etc.

The AvgList calculates a simple average of all of the values of (Numx).  The sum of all values of Num divided by the number of members.

Examples

AvgList(45, 72, 86, 125, 47) returns a value of 75.

AvgList(18, 67, 98, 24, 65, 19) returns a value of 48.5.

B

1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

Bar

References the open, high, low and closing prices for a specific interval. The interval is determined by the data compression of the symbol.

Bar is normally used with the reserved word Ago to specify a value or condition (usually 1) "Bar Ago". When the data compression is set to Daily, this and the reserved word Day are identical.

Examples

Close of 1 Bar Ago returns the Close price of the previous bar.

ExitShort this bar on close orders a trading strategy to exit all long positions on the close of the current bar.

Additional Example

Buy ("Signal Name") next bar at open; will buy at the opening price of the next bar.

BarInterval

Reserved word that returns the number of minutes used for the time compression that an analysis technique is applied to.  BarInterval is only valid when used on minute-based charts.

Examples

Condition1 = BarInterval = 5 is a statement that will cause Condition1 to be true if the analysis technique is applied to a 5 minute chart.

CalcTime(Sess1StartTime, BarInterval) will add the time compression of a bar to the start time of the asset trading.

Additional Example

CalcTime(Sess1EndTime, -BarInterval) returns the time of the last bar before the close of the trading session.

Bars

Used to reference a set of price data based on the compression to which a technique is applied.

Bars is normally used with the reserved word Ago to specify a value or condition any number of "Bars Ago".

Examples

Close of 5 Bars Ago returns the Close price of the bar 5 bars previous to the current bar.

Average(Close, 10) of 5 bars ago returns the Average of the last 10 Close prices as calculated on the previous bar.

Additional Example

Buy ("Signal Name") next bar at open will buy when the formation of the current bar is complete, based on the type of compression of the bar.

BarsSinceEntry

Returns the number of bars since the specified entry.

(Num) is a numeric expression representing the number of positions ago.  This function can only be used in the evaluation of strategies.

Example

BarsSinceEntry(2) would return a value of 68 if it has been 68 bars since the entry that occurred 2 positions ago.

BarsSinceExit

Returns the number of bars since the specified exit.

(Num) is a numeric expression representing the number of positions ago. This function can only be used in the evaluation of strategies.

Example

BarsSinceExit(2) would return a value of 46 if it has been 46 bars since the exit that occurred 2 positions ago.

BarStatus

Used with multiple data series (same symbol, different data compressions) or ActivityBar studies to determine whether the current tick is the opening or closing tick of a bar in the other data series, or whether it is a trade ‘inside the bar.’ 

BarStatus (DataNum) ;

DataNum is used to specify the data series to evaluate. 1 refers to Data1, 2 to Data2 and so on. The data series must be applied to the chart. For example, to use BarStatus (2), a second data series must be applied to the chart.

This reserved word is generally used with ActivityBar studies. For example, it is useful to know when the closing tick of the ActivityBar is the last trade of the ‘big’ bar or a tick within the bar:

2 = the closing tick of the bar

1 = a tick within the bar

0 = an opening tick (valid only when referring to the open of the next bar)

-1 = an error in the execution of the reserved word

Example

To perform an operation when the ActivityBar is the last trade of the ‘big’ bar, you could write:

If BarStatus(1) = 2 Then {Your Operation Here}

… where Data1 is the price chart, and your analysis technique is an ActivityBar study.

Based

This word is a skip word retained for backward compatibility.

Begin

This word is used to begin a series of code that should be executed on the basis of an If… Then, If… Then… Else, For, or While statement.

Begin is only necessary if using more than one line of code after an If… Then, If… Then… Else, For, or While statement.

Each Begin must have a corresponding End.

Examples

If Condition1 Then

           Begin

           {Your Code Line1}

           {Your Code Line2, etc.}

           End; Begin is used here to include the execution of Line1 and Line2 only when Condtion1 is True.

If Condition1 Then

           Begin

           {Your Code Line1}

           {Your Code Line2, etc.}

           End

           Else

                 Begin

                 {Your Code Line3}

                 {Your Code Line4, etc.}

End;

Begin is used here twice to include the execution of Line1 and Line2 only when Condtion1 is True and execute Line3 and Line4 only when Condition1 is False.

Below

This word is used to check for the direction of a cross between values.

Used in conjunction with the "crosses" to detect when a value crosses below, or becomes less than another value.  A value (Value1) crosses below another value (Value2) whenever Value1 is greater than Value2 in the current bar but Value 1 was equal to or less than Value 2 in the previous bar.

Below is a synonym for Under.

Examples

If Plot1 Crosses Below Plot2 Then …

Below is used here to determine the direction of the cross of the values Plot1 and Plot2.

If Value1 Crosses Below Value2 Then…

Below is used here to determine the direction of the cross of the variables Value1 and Value2.

Beta

Returns the Beta value of a stock.

A Beta of 1 means that as the market moves, the stock should follow along.

Examples

Beta returns 3 if the stock should move up 3% for each 1% move of the market.

Beta returns .5 if the stock should move up half as much as the market.

Beta_Down

Returns the Beta_Down value of a stock.

A Beta_Down is the same as Beta, however used when the market is going down.

Examples

Beta_Down returns 3 if the stock should move 3% for each 1% move of the market.

Beta_Down returns .5 if the stock should move half as much as the market.

Beta_Up

Returns the Beta_Up value of a stock.

Beta_Up is the same as Beta, however used when the market is going up.

Examples

Beta_Up returns 3 if the stock should move 3% for each 1% move of the market.

Beta_Up returns .5 if the stock should move half as much as the market.

Bid

Returns the bid value of an option or leg calculated by a Bid/Ask Model.

Example

If Close of Option - Bid of Option < .125 then     Alert("Very Low Bid");

BigPointValue

Returns the dollar value represented by one full point of a security’s price.

BigPointValue reads the field Big Point Value specified in the Symbol Dictionary.

Examples

Close * BigPointValue returns the current value of an asset.

CurrentContracts * BigPointValue returns the value of a current position.

Additional Example

The initial amount needed to enter a trade can be given by:

Value1 = BigPointValue * EntryPrice;

Black

Sets the plot color or background color to Black.

Examples

Plot1(Value1, "Test", Black) plots Value1 with the name Test, and sets the color of Plot1 to Black.

TL_SetColor(1, Black) sets the color of a TrendLine with a reference number of 1 to Black.

BlockNumber

Returns the Block Number of the security block attached to the machine.

The BlockNumber function can be used to check for the presence of a particular security block before ploting an indicator.

Examples

If you wanted to only display an indicator when the user had block number 55522 attached to the machine, you could use the following syntax:

If BlockNumber = 55522 Then Plot1(Value1, "Indicator");

Blue

Sets the plot color or background color to Blue.

Examples

Plot1(Value1, "Test", Blue) plots Value1 with the name Test, and sets the color of Plot1 to Blue.

TL_SetColor(1, Blue) sets the color of a TrendLine with a reference number of 1 to Blue.

Book_Val_Per_Share

Returns the Book value per share of a stock.

Book_Val_Per_Share is calculated by dividing Common Shareholders Equity by the number of shares outstanding.

BOOL

Reserved for use with custom DLLs designed for EasyLanguage. Refer to the documentation in the TradeStation Developer's Kit for more information about this and the EasyLanguage Tool Kit Library ELKIT32.DLL.

BoxSize

Reserved word used to refer to the minimum change in price that is required for the addition of an X to the top or an O to the bottom of a Point & Figure column.

The BoxSize is set when creating a Point & Figure column.

BreakEvenStopFloor

This word is retained for backward compatibility.

This word has been replaced by the Signals Break Even Stop LX and Break Even Stop SX.

Buy

Used to generate an order for a Long Entry.

The earliest order entry that can be generated is for the close of the current bar.

Orders can be generated for:

·          this bar on Close

·          next bar at Market

·          next bar at PRICE Stop

·          next bar at PRICE Limit


An entry statement consists of: Entry/Exit order, Signal name, number of contracts, timing, Price, Market/Stop/Limit.

Examples

Buy ("LongEntry") 5 contracts this bar on close; generates an order to enter a long position of 5 contracts at the Close of the current bar.

Buy ("NextEntry") next bar at market; generates an order to enter a long position at the first price of next bar.

Additional Example

Buy ("MyTrade") next bar at 75 Stop; generates an order to enter a long position on the next bar at a price of 75 or higher.

By

Skip word.

BYTE

Reserved for use with custom DLLs designed for EasyLanguage. Refer to the documentation in the TradeStation Developer's Kit for more information about this and the EasyLanguage Tool Kit Library ELKIT32.DLL.

 

C

1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

C

Shortcut notation that returns the Close of the bar.

Anytime the Close of a bar is needed, the letter C can be used in an equivalent fashion.

Examples

C of 1 bar ago returns the Close price of the previous bar.

Average(C, 10) returns the Average of the last 10 Close prices.

Additional Example

To check that the last two bars have Close prices higher than the previous bar write:

If C > C[1] and C[1] > C[2] then Plot1(High,"ClosedUp");

Call

Used to determine if an option or leg analyzed is a call.

Example

If OptionType of Option = Call Then {Your Operation Here}

CallCount

Returns the number of calls in the option chain.

CallCount is used in navigating the option chain within OptionStation. OptionStation keeps an array of all available options for EasyLanguage calculations, and this Reserved Word can be used to help determine the makeup of that array.

Example

Value1 = CallCount of Asset;

CallITMCount

This word has been reserved for future use.

CallOTMCount

This word has been reserved for future use.

CallSeriesCount

Returns the number of call series available in the option chain.

CallSeriesCount is used in navigating the option chain within OptionStation. OptionStation keeps an array of all available options for EasyLanguage calculations, and this Reserved Word can be used to help determine the makeup of that array.

Example

Value1 = CallSeriesCount of Asset;

CallStrikeCount

Returns the number of strike prices available for calls in the option chain.

CallStrikeCount is used in navigating the option chain within OptionStation. OptionStation keeps an array of all available options for EasyLanguage calculations, and this Reserved Word can be used to help determine the makeup of that array.

Example

Value1 = CallStrikeCount of Asset;

Cancel

Cancel is used to cancel Alerts that have been previously triggered. 

Cancel must always be followed by “Alert” in EasyLanguage code.

Alerts are only generated for the last bar.

Example

Cancel Alert will cancel any alerts previously enabled.

Additional Example

If you wanted to cancel any alerts that have previously been enabled within the code based on certain criteria, you could use the following syntax:

If {Your Criteria Here} Then Cancel Alert;

Ceiling

Returns the lowest integer greater than the specified (Num).

(Num) is a numeric expression to be used in the calculation.

Examples

Ceiling(4.5) returns a value of 5.

Ceiling(-1.72) returns a value of -1.

CHAR

Reserved for use with custom DLLs designed for EasyLanguage. Refer to the documentation in the TradeStation Developer's Kit for more information about this and the EasyLanguage Tool Kit Library ELKIT32.DLL.

CheckAlert

Returns True on only the last bar if alerts have been enabled in the Properties tab of the study.  False is returned if alerts are not enabled, and every bar except the last bar. 

CheckAlert differs from AlertEnabled by only checking the value in the Properties tab of the study to see if alerts are enabled on the last bar.

Alerts are only generated for the last bar.

Example

CheckAlert will return True if alerts have been enabled and the bar is the last bar.

Additional Example

If you only wanted code to be evaluated only on the last bar and only when the user had set the study to enable alerts, you could use the following syntax:

If CheckAlert Then

           Begin

{Your Code Here}

           End;

CheckCommentary

Returns True if the user clicks on a chart with the Expert Commentary pointer on the specified bar.  False is returned if the pointer has not been inserted, or if the pointer was inserted on a different bar.

Example

CheckCommentary will return True if the Expert Commentary Tool has been inserted for the specified bar.

Additional Example

If you only wanted code to be evaluated for the bar where the user had inserted the Expert Commentary Tool, you could use the following syntax:

If CheckCommentary Then

           Begin

                 {Your Code Here}

           End;

Close

Reserved word used to return the last price of the specified time increment or group of ticks.  C and Close are synonymous. Close is also synonymous with Last.

Examples

Close of 1 bar ago returns the Close price of the previous bar.

Average(Close, 10) returns the Average of the last 10 Close prices.

Additional Example

To check that the last two bars have Close prices higher than the previous bar write:

If Close > Close[1] and Close[1] > Close[2] then Plot1(High,"ClosedUp");

Commentary

Sends the expression to the commentary window for the bar that is selected by the commentary pointer.

Commentary(My Expression) ;

where MyExpression is a single or a list of numerical, string or true/false expressions separated by commas, that are to be sent to the commentary window.

Example

The following will result in the string “This is one line of commentary” being sent to the commentary window. Any additional commentary sent will be placed on the same line.

Commentary(This is one line of commentary) ;

You can use the Commentary reserved word multiple times, and it will not include a carriage return at the end of each expression (or list of expressions) sent. In order to generate a message that includes carriage returns, you will have to use either the NewLine or CommentaryCL reserved word.

CommentaryCl

Sends the expression to the commentary window for the bar that is selected by the commentary pointer.

CommentaryCL(My Expression) ;

where MyExpression is a single or a list of numerical, string or true/false expressions separated by commas, that are to be sent to the commentary window.

Example

The following will result in the string “This is one line of commentary” being sent to the commentary window. Any additional commentary sent will be placed on the next line.

CommentaryCL(This is one line of commentary) ;

You can use the CommentaryCL reserved word multiple times, and it will include a carriage return at the end of each expression (or list of expressions) sent. In order to generate a message that does not include carriage returns, use the reserved word Commentary.

CommentaryEnabled

Returns True for every bar if the Expert Commentary pointer has been applied to the chart.  False is returned if the pointer has not been applied. 

Example

CommentaryEnabled will return True if the Expert Commentary Tool has been applied to the chart.

Additional Example

If you only wanted code to be evaluated only when the user had applied the Expert Commentary Tool to the chart, you could use the following syntax:

If CommentaryEnabled Then

           Begin

                 {Your Code Here}

           End;

Commission

Returns the commission setting in the applied strategy’s Costs tab.  This reserved word can only be used in the evaluation of strategies.

Example

Value1=Commission; returns a value of 17.50 if the commission under the strategy’s Costs tab has been set to 17.50.

CommodityNumber

Returns the value represented under Symbol Number in the Symbol Dictionary.

CommodityNumber returns the value specified in the Symbol Dictionary. If there is no value specified, CommodityNumber will return 0.

Examples

If the Symbol Number field is 149 for the S&P and 44 for the 30 year Treasury Bond:

CommodityNumber returns 149 when used on an analysis technique applied to S&P future data.

CommodityNumber returns 44 when used on an analysis technique applied to 30 year Treasury Bond data.

Additional Example

To force an analysis technique to run only on S&P future data, block the entire technique with

If CommodityNumber = 149 then begin

Contract

Reserved word used in conjunction with a numeric value specifying the number of units to trade within a trading strategy.

Contract is normally used in a Buy, Sell, or Exit statement.

Examples

Buy 1 contract next bar at market;

generates an order to buy one contract at the open of the next bar.

Sell 1 contract next bar at market;

generates an order to sell one contract at the open of the next bar.

Additional Example

To exit from only 1 contract when you have multiple long positions, write:

ExitLong 1 contract total next bar at market;

ContractMonth

Refers to the delivery/expiration month of any option, future, or position leg.

Example

If ContractMonth of option = 10 then Plot("October Expiration", "Expiration");

Contracts

Reserved word used in conjunction with a numeric value specifying the number of units to trade within a trading strategy.

Contract is normally used in a Buy, Sell, or Exit statement.

Examples

Buy 5 contracts next bar at market;

generates an order to buy five contracts at the open of the next bar.

Sell 3 contracts next bar at market;

generates an order to sell three contracts at the open of the next bar.

Additional Example

To exit from only 1 contract from multiple long positions, write:

ExitLong 1 contract total next bar at market;

ContractYear

Refers to the delivery/expiration year of any option, future, or position leg.

Example

If ContractMonth of option = 10 and ContractYear of option = 99 then Plot("October 99 Expiration", "Expiration");

Cosine

Returns the cosine value of the specified number of degrees.

Cosine(Num) ;

(Num) is a numeric expression representing the number of degrees for which you want the cosine value.

The cosine is a trigonometric function that for an acute angle is the ratio between the leg adjacent to the angle when it is considered part of a right triangle and the hypotenuse.

(Num) should be the number of degrees in the angle.

Examples

Cosine(45) returns a value of 0.7071.

Cosine(72) returns a value of 0.3090.

Cost

Returns the value of the cost of establishing a leg or position.

Example

Plot1(Cost of Leg(1), "Cost");

Cotangent

Returns the cotangent value of the specified (Num) of degrees.

(Num) is a numeric expression to be used in the calculation.

The cotangent is a trigonometric function that is equal to the cosine divided by the sine.

(Num) should be the number of degrees in the angle.

Examples

CoTangent(45) returns a value of 1.0.

CoTangent(72) returns a value of 0.3249.

CreateLeg

Used to create legs in a Search Strategy.

(Contract) is a numeric expression representing the number of contracts.

(LegType) represents the type of contract created (put or call).

CreateLeg sets the size and type of position created when the conditions for creating that leg are true in the Position Search Strategy.  If (Contract) is a positive number, the position purchases the leg. Conversely, if (Contract) is a negative number, the position writes the leg.

Examples

Createleg(1, Call) creates a leg by purchasing 1 call option.

CreateLeg(-2, Put) creates a leg by writing 2 put options.

Cross

This word is used to check for the crossover of two values.

Cross is always followed by Above, Below, Over, or Under.

Cross is equivalent to Crosses.

Examples

If Plot1 does Cross Above Plot2 Then Cross is used here to determine if the value of Plot1 does cross above the value of Plot2 on the bar under consideration.

If Value1 does Cross Above Value2 Or Value1 does Cross Below Value2 Then Cross is used here to determine if Value1 does cross above or below Value2 on the bar under consideration.

Crosses

This word is used to check for the crossover of two values.

Crosses is always followed by Above, Below, Over, or Under.

Crosses is equivalent to Cross.

Examples

If Plot1 Crosses Above Plot2 Then Crosses is used here to determine if the value of Plot1 crosses above the value of Plot2 on the bar under consideration.

If Value1 Crosses Above Value2 Or Value1 Crosses Below Value2 Then Crosses is used here to determine if Value1 crosses above or below Value2 on the bar under consideration.

Current

Reserved for future use.

Current_Ratio

Returns the Current Ratio of a stock.

Current_Ratio is calculated by dividing Total Current Assets by Total Current Liabilities.

Current_Ratio is not available for companies that do not distinguish between current- and long-term assets and liabilities

CurrentBar

Returns the number of the bar currently being evaluated.

Each bar on a chart (after the number of bars specified by the Maximum number of bars referenced by a study, known as MaxBarsBack) is assigned a number, which is incremented by 1 with each successive bar. For example, if your MaxBarsBack is set to 10, the 11th bar is CurrentBar number 1, the 12th bar is CurrentBar number 2, and so on.

CurrentBar can only be used to return the number of the current bar, for example, you cannot use:

CurrentBar [n]

… to obtain the bar number of the bar n bars ago. However, you can obtain the number of the bar n bars ago (for example, 5) by using:

CurrentBar - 5

Also, the CurrentBar reserved word is the same as the user function BarNumber. The only difference is that you can use the BarNumber function to reference past bars:

BarNumber [5]

Examples

You can use CurrentBar to determine how long ago a particular condition occurred:

IF Condition1 then

                     Value1 = CurrentBar;

IF CurrentBar > Value1 then

                     Value2 = CurrentBar – Value1;

Value2 would hold the number of bars ago Condition1 occurred.

CurrentContracts

Returns the number of contracts in the current position.

This function can only be used in the evaluation of strategies.

Positive values represent long positions, and negative values represent short positions.

Example

CurrentContracts returns a value of 1 if the strategy is currently long 1 contract.

CurrentDate

Returns the current date in the format YYMMDD or YYYMMDD.

Examples

CurrentDate returns a value of 991016 on October 16, 1999.

CurrentDate returns a value of 1011220 on December 20, 2001.

CurrentEntries

Returns the number of entries currently open.

This function can only be used in the evaluation of strategies.

Example

CurrentEntries returns a value of 3 if the strategy has made 3 entries in the current open position.

CurrentTime

Returns the current time in the format HHMM using military representation of hours. (0000 to 2359)

Examples

CurrentTime returns a value of 1718 at 5:18 pm.

CurrentTime returns a value of 0930 at 9:30 am.

Cusip

Returns a numeric expression representing the CUSIP number for stocks.

Value1 = CUSIP ;

You must assign the reserved word to a numeric variable in order to obtain the CUSIP number.

Note This word can only be referenced when writing analysis techniques for RadarScreen and OptionStation. This word is not available for use with EasyLanguage for use with charting applications such as TradeStation or SuperCharts.

Cyan

Sets the plot color or background color to Cyan.

There are 16 colors available in EasyLanguage. For more information, see EasyLanguage Colors and Their Corresponding Numeric Values.

Examples

Plot1(Value1, "Test", Cyan) plots Value1 with the name Test, and sets the color of Plot1 to Cyan.

TL_SetColor(1, Cyan) sets the color of a TrendLine with a reference number of 1 to Cyan.

 

D

1 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

D or Date

Shortcut notation that returns the Date of the bar.

Anytime the Date of a bar is needed, the letter D can be used in an equivalent fashion.

D returns the date in YYMMDD format.

Examples

D returns 990107 if the Date of the bar is January 7th, 1999.

D returns 990412 if the Date of the bar is April 12th, 1999.

Additional Example

To check the Time of the previous bar write:

D of 1 bar ago

DailyLimit

Returns the value represented under DailyLimit in the Symbol Dictionary.

DailyLimit represents the largest number of increments of the Price Scale that the price of a security can move before the exchange closes the session.

DarkBlue

Sets the plot color or background color to Dark Blue.

Examples

Plot1(Value1, "Test", Dark Blue) plots Value1 with the name Test, and sets the color of Plot1 to Dark Blue.

TL_SetColor(1, Dark Blue) sets the color of a TrendLine with a reference number of 1 to Dark Blue.

DarkBrown

Sets the plot color or background color to Dark Brown.

Examples

Plot1(Value1, "Test", Dark Brown) plots Value1 with the name Test, and sets the color of Plot1 to Dark Brown.

TL_SetColor(1, Dark Brown) sets the color of a TrendLine with a reference number of 1 to Dark Brown.

DarkCyan

Sets the plot color or background color to Dark Cyan.

There are 16 colors available in EasyLanguage. For more information, see EasyLanguage Colors and Their

Examples

Plot1(Value1, “Test", Dark Cyan) plots Value1 with the name Test, and sets the color of Plot1 to Dark Cyan.

TL_SetColor(1, Dark Cyan) sets the color of a TrendLine with a reference number of 1 to Dark Cyan.

DarkGray

Sets the plot color or background color to Dark Gray.

Examples

Plot1(Value1, “Test", Dark Gray) plots Value1 with the name Test, and sets the color of Plot1 to Dark Gray.

TL_SetColor(1, Dark Gray) sets the color of a TrendLine with a reference number of 1 to Dark Gray.

DarkGreen

Sets the plot color or background color to Dark Green.

Examples

Plot1(Value1, “Test", Dark Green) plots Value1 with the name Test, and sets the color of Plot1 to Dark Green.

TL_SetColor(1, Dark Green) sets the color of a TrendLine with a reference number of 1 to Dark Green.

DarkMagenta

Sets the plot color or background color to Dark Magenta.

Examples

Plot1(Value1, “Test", Dark Magenta) plots Value1 with the name Test, and sets the color of Plot1 to Dark Magenta.

TL_SetColor(1, Dark Magenta) sets the color of a TrendLine with a reference number of 1 to Dark Magenta.

DarkRed

Sets the plot color or background color to Dark Red.

There are 16 colors available in EasyLanguage. For more information, see EasyLanguage Colors and Their Corresponding Numeric Values.

Examples

Plot1(Value1, “Test", Dark Red) plots Value1 with the name Test, and sets the color of Plot1 to Dark Red.

TL_SetColor(1, Dark Red) sets the color of a TrendLine with a reference number of 1 to Dark Red.

Data

Reserved word used to specify a data stream within a multidata chart.

Data is normally used with a number between 1-50 that allows the specification or which data set is being referred to in terms of price values and functions calculations.

Examples

Close of Data3 returns the Close price of Data stream 3.

Low of Data10 returns the Low price of Data stream 10.

DataCompression

Returns a number indicating the compression setting of the price data an analysis technique is applied to.

The number returned is based on the data compression of the price data. DataCompression will return:

0 = TickBar

1 = Intra-day

2 = Daily

3 = Weekly

4 = Monthly

5 = Point & Figure

Examples

DataCompression returns 0 when applied to price data based on tick compression

DataCompression returns 2 when applied to price data based on daily compression

Additional Example

To assure that a statement is executed only on a daily chart we can write:

If DataCompression = 2 then ExitLong next bar at market;

DataInUnion

Reserved for future use.

Date

Reserved word used to return the Date of the current bar.

Date returns a numeric value in YYMMDD format.

Examples

Date returns 990107 if the day is January 7th, 1999.

Date returns 990412 if the day is April, 12th, 1999.

Additional Example

Date can be used to restrict strategies to certain trading days.

If Date < 990101 then buy this bar on close;

Limits a buy order to take place only on dates before 1999.

DateToJulian

Returns the Julian date for the specified calendar date.

DateToJulian(cDate) ;

(cDate) is a numeric expression representing the six or seven digit calendar date in the format YYMMDD or YYYMMDD respectively (1999 = 99, 2001 = 101).

If a specific date is entered for the numeric expression, it must be a valid date between January 1, 1901 and February 28, 2150, expressed in YYMMDD or YYYMMDD format.

Examples

DateToJulian(980804) returns a value of 36011 for the date August 4, 1998.

DateToJulian(991024) returns a value of 36457 for the date October 24, 1999.

Day

Reserved word used to represent a bar of data.

When your data compression is set to daily, the Reserved Words Bar and Day are the same.

Examples

Close of 1 day Ago returns the Close price of the previous bar.

ExitShort this day on close orders a trading strategy to exit all long positions on the close of the current bar.

Additional Example

Buy ("Signal Name") next day at open will buy during the formation of the next bar if a price meets the open price of the bar.

DayOfMonth

Returns the day of month for the specified calendar date.

DayOfMonth(cDate) ;

(cDate) is a numeric expression representing the six or seven digit calendar date in the format YYMMDD or YYYMMDD respectively (1999 = 99, 2001 = 101).

Examples

DayOfMonth(980804) returns a value of 4 for the date August 4, 1998.

DayOfMonth(1011024) returns a value of 24 for the date October 24, 2001.

DayOfWeek

Returns the day of week for the specified calendar date. (0 = Sun, 6 = Sat).

(cDate) is a numeric expression representing the six or seven digit calendar date in the format YYMMDD or YYYMMDD respectively. (1999 = 99, 2001 = 101)

Examples

DayOfWeek(980804) returns a value of 2 because August 4, 1998 is a Tuesday.

DayOfWeek(1011024) returns a value of 3 because October 24, 2001 is a Wednesday.

Days

Reserved word used for backwards compatibility.

Days has been replaced with the reserved word, Bar.

Examples

Close of 5 Days Ago returns the Close price of the bar 5 bars previous to the current bar.

ExitShort this day on close closes a position at the close of the bar.

Additional Example

Buy ("Signal Name") next bar at open will buy when the formation of the current bar is complete, based on the type of compression of the bar.

Default

This word is used in plot statements to set one of its styles (e.g., color) to the default value.

Example

Plot1(Value1, "Plot1", Default, Default, 5); Default is used here to designate the items as the user set default values.

DefineCustField

This word has been reserved for future use.

DEFINEDLLFUNC

Reserved for use with custom DLLs designed for EasyLanguage. Refer to the documentation in Omega Research Developer's Kit for more information about this and the EasyLanguage Tool Kit Library ELKIT32.DLL.

DeliveryMonth

Reserved word used for contracts that expire which returns the month of expiration.

The value returned represents any of the 12 calendar months according to the following table:

1        January

2        February

3        March

4        April

5        May

6        June

7        July

8        August

9        September

10      October

11&n