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      November

12      December

Examples

DeliveryMonth will return 6 if the technique is applied to the S&P June contract.

DeliveryMonth will return 12 if the technique is applied to the Treasury Bond December contract.

Additional Example

You can exit from a trade on the first day of the month prior to expiration using:

IF DeliveryMonth = Month(Date) Then

ExitLong This Bar on Close;

DeliveryYear

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

The value returned by DeliveryYear is a four-digit year.

Examples

DeliveryYear will return 1998 if the technique is applied to the S&P June ‘98 contract.

DeliveryYear will return 1999 if the technique is applied to the Treasury Bond March ’99 contract.

Additional Example

You can exit from a trade on the first day of the year prior to expiration using:

IF DeliveryYear = Year(Date) Then

ExitLong This Bar on Close;

Delta

Returns the Delta value of an option, leg, or position.  The value of Delta can also be established in a Pricing Model by using Delta(Value).

Debit positions will return positive numbers and credit positions will return negative numbers.

Examples

If Delta of Option > HighVal Then

         Alert("High Delta");

In a Pricing Model, you can set the value of Delta by using the following syntax:

Delta(0);

Description

Returns a string containing the description of the symbol if it is available.  When any symbol is added to the GlobalServer portfolio, the description is automatically obtained from the Symbol Dictionary.  If the symbol has no description, this reserved word will return a blank string ("").

TextString = Description ;

You must assign the reserved word to a string variable in order to obtain the description. EasyLanguage does not provide pre-declared string variables; you must declare the string variable before you can assign a reserved word to it.

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.

Dividend

Returns the Dividend paid any number of periods ago.

Dividend (Num) ;

Dividend does not require an input, it returns the most recently reported dividend amount. However, by using an input, you can obtain the amount for a dividend other than the most recent.

Examples

Dividend returns the last dividend amount paid.

Dividend(2)returns the last dividend amount paid 2 periods ago.

Dividend_Yield

Returns the Indicated Annual Dividend Rate.

Dividend_Yield is generally calculated by the most recent cash dividend paid or declared multiplied by the dividend payment frequency, plus any regular dividends.

DividendCount

Returns the number of times that dividends have been reported in the time frame considered.

DividendCount counts the number of dividends paid during the time frame specified.

DividendDate

Returns the date on which a stock dividend was paid out.

DividendDate (Num) ;

DividendDate does not require an input, it returns the most recently reported dividend date. However, by using an input, you can obtain the date for a dividend other than the most recent.

Examples

DividendDate returns the date of the last reported dividend.

DividendDate(2)returns the date of the dividend 2 periods ago.

DividendTime

Returns the time at which a stock dividend was paid out.

DividendTime (Num) ;

DividendTime does not require an input, it returns the most recently reported dividend time. However, by using an input, you can obtain the time for a dividend other than the most recent.

Examples

DividendTime returns the time of the last reported dividend.

DividendTime(2)returns the time of the dividend reported 2 periods ago.

Does

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 Plot1 does Cross Over Plot2 Then the word "does" is not necessary and the code functions the same way regardless of its presence.

DOUBLE

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.

DownTicks

Returns the number of ticks on a bar whose value is lower than the tick immediately preceding it.

Returns the down volume of a bar when Trade Volume is used for the chart.

Examples

DownTicks returns 5 if there were 5 ticks on a bar whose value was lower than the tick immediately preceding it.

DownTicks returns 12 if there were 12 ticks on a bar whose value was lower than the tick immediately preceding it.

Additional Example

To check if a bar of data appears to reflect a steady downturn, compare DownTicks to UpTicks:

Value1 = DownTicks - Upticks;

DownTo

This word is used as a part of a For statement where the execution values will be decreasing to a finishing value.

Downto will always be placed between two arithmetic expressions.

Examples

For Value5 = Length Downto 0 Begin

         {Your Code Here}

End;

Downto is used here to indicate that for each value of Value5 from Length down to zero, the following Begin… End loop will be executed.

For Value5 = Length Downto 0 Begin

         {Your Code Here}

End;

Downto is used here to indicate that for each value of Value5 from Length down to zero, the following Begin… End loop will be executed.

DWORD

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.

E

EasyLanguageVersion

Returns the EasyLanguage version currently installed.

The EasyLanguage version for TradeStation 2000i is 5.1.

Examples

If you wanted to only display an indicator when the user had EasyLanguage 4.0 or later installed on the machine, you could use the following syntax:

If EasyLanguageVersion >= 4.0 Then

         Plot1(Value1, "Indicator");

Else

This word is used to execute a series of code based on a condition that has returned a value of False.

Else can only be used following an If… Then statement.

Examples

If Condition1 Then

         {Your Code Line1}

         Else

                     Begin

                     {Your Code Line2}

                     End; Else is used here to begin the code that will be executed if Condition1 returns a value of False.  No semicolon should be used after the single line of code following Then.

If Condition1 And Condition2 Then

         Begin

         {Your Code Line1};

         {Your Code Line2, etc.};

End

         Else

                     Begin

                     {Your Code Line3};

                     {Your Code Line4, etc.};

                     End; Else is used here to begin the code that will be executed if either Condition1 or Condition2 return a value of False.  No semicolon should be used after the End preceeding the Else statement. 

End

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

Each Begin must have a corresponding End.

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

Examples

If Condition1 Then

         Begin

         {Your Code Line1}

         {Your Code Line2, etc.}

         End; End is used here to exclude the execution of code beyond Line1 and Line2 as a part of the If… Then statement.

If Condition1 Then

         Begin

         {Your Code Line1}

         {Your Code Line2, etc.}

         End

         Else

                     Begin

                     {Your Code Line3}

                     {Your Code Line4, etc.}

End; End is used here twice to limit the execution to the two lines of each section that are intended based on Condition1.  No semicolon should be used after the End preceeding the Else statement.  If… Then… Else is part of a continuous section of code and only the End that finishes the If… Then… Else statement should be followed by a semicolon.

Entry

Reserved word used to specify the name of a Long or Short entry.

Entry names are not required.

Entry is exclusively used in an Exit condition to specify the Entry to exit from

Examples

ExitLong from entry ("MyTrade") next bar market; generates an order to exit the long position “MyTrade” on the first price of the next bar.

Exitshort from entry ("MyTrade") this bar on close; generates an order to exit the short position “MyTrade” at the close of the current bar.

Additional Example

ExitLong from entry ("MyTrade") next bar at 75 Stop; generates an order to exit the long position “MyTrade” on the next bar at a price of 75 or lower.

EntryDate

Returns the entry date for the specified position in the format YYYYMMDD.

(Num) is a numeric expression representing the number of positions ago.

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

Example

EntryDate(2) might return a value of 981005 if the entry date of 2 positions ago was October 5, 1998.

EntryPrice

Returns the entry price for the specified position.

(Num) is a numeric expression representing the number of positions ago.

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

Example

EntryPrice(2) might return a value of 101.19 as the entry price of 2 positions ago on a chart of Microsoft stock.

EntryTime

Returns the entry time for the specified position in military time format HHMM.

(Num) is a numeric expression representing the number of positions ago.

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

Example

EntryTime(2) might return a value of 1600 as the entry time of 2 positions ago on a daily chart of Microsoft stock.

EPS

Returns the reported earnings-per-share.

EPS (Num) ;

EPS does not require an input, it returns the most recently reported earnings-per-share. However, by using an input, you can obtain the earnings-per-share other than the most recent.

Examples

EPS returns the last reported earnings-per-share.

EPS(2)returns the earnings-per-share 2 periods ago.

EPS_PChng_Y_Ago

Returns the Year Ago Earnings Per Share Percent Change value.

EPS_PChng_YTD

Returns the Year to Date Earnings Per Share Percent Change value.

EPSCount

Returns the number of times that Earnings per Share have been reported in the time frame considered.

EPSCount counts the number of dividends paid during the time frame specified.

EPSDate

Returns the date on which Earnings per Share were reported.

EPSDate (Num) ;

EPSDate does not require an input; it returns the date on which the current earnings per share were reported. However, by using an input, you can obtain the date of an earnings per share report other than the most recent.

Examples

EPSDate returns the date of the last Earnings per Share report.

EPSDate(2)returns the date of the last Earnings per Share report 2 periods ago.

EPSTime

Returns the time at which the Earnings per Share were reported.

EPSTime (Num) ;

EPSTime does not require an input; it returns the time at which the current earnings per share were reported. However, by using an input, you can obtain the time of an earnings per share report other than the most recent.

Examples

EPSTime returns the time of the last Earnings per Share report.

EPSTime(2)returns the time of the last Earnings per Share report 2 periods ago.

ExitDate

Returns the exit date for the specified position.

ExitDate(Num) ;

(Num) is a numeric expression representing the number of positions ago.

This function can only be used in the evaluation of strategies, and you can reference up to 10 positions ago.

Example

ExitDate(2) might return a value of 981022 if the exit date of 2 positions ago was October 22, 1998.

ExitLong

Reserved word used to generate an order for a Long Exit.

The earliest exit order 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 exit statement consists of: Entry/Exit order, from Signal name, number of contracts, timing, Price, Market/Stop/Limit.

Examples

ExitLong 5 contracts this bar on close; generates an order to exit 5 contracts from a long position at the Close of the current bar.

ExitLong next bar at market; generates an order to exit all long positions at the first price of next bar.

Additional Example

ExitLong from entry ("MyTrade") next bar at 75 Stop; generates an order to exit the long position “MyTrade” on the next bar at a price of 75 or lower.

ExitPrice

Returns the exit price for the specified position.

ExitPrice(Num) ;

(Num) is a numeric expression representing the number of positions ago.

This function can only be used in the evaluation of strategies, and you can reference up to 10 positions ago.

Example

ExitPrice(1) might return a value of 107.750 as the exit price of the last position on a chart of Microsoft stock.

ExitShort

Reserved word used to generate an order for a Short Exit.

The earliest exit order 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 exit statement consists of: Entry/Exit order, from Signal name, number of contracts, timing, Price, Market/Stop/Limit.

Examples

ExitShort 5 contracts this bar on close; generates an order to exit 5 contracts from a short position at the Close of the current bar.

ExitShort next bar at market; generates an order to exit all short positions at the first price of next bar.

Additional Example

ExitShort from entry ("MyTrade") next bar at 75 Stop; generates an order to exit the short position “MyTrade” on the next bar at a price of 75 or higher.

ExitTime

Returns the exit time for the specified position in military time format HHMM.

ExitTime(Num) ;

(Num) is a numeric expression representing the number of positions ago.

This function can only be used in the evaluation of strategies, and you can reference up to 10 positions ago.

Example

ExitTime(3) might return a value of 1050 as the exit time of 3 positions ago on an intraday chart of Microsoft stock.

ExpirationDate

Returns the Date of Expiration of the asset to which a technique is applied.

ExpirationDate returns a four-digit year.

ExpirationMonth

Returns a numeric expression representing the expiration month of the symbol.   Where 1 is January and 12 is December.

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.

ExpirationRule

Returns a string containing the description of the expiration rule used for the symbol.

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.

ExpirationStyle

Returns a numeric expression representing the expiration style of an option. Where 0 is American and 1 is European. Debit positions return positive numbers and credit positions return negative numbers.

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.

ExpirationYear

Returns a numeric expression representing the 4 digit expiration year of the option.

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.

Expired

Returns a numeric expression where 0 is the option is expired and 1 is the option is not expired.

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.

ExpValue

Returns the exponential value of the specified (Num).

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

Examples

ExpValue(4.5) returns a value of 90.0171.

ExpValue(6) returns a value of 403.4288.

F

False

This word is used as the value for an input or untrue condition.

False can only be used in easy language as the value for a True/False input.

False is the value returned by an untrune or invalid condtition such as, 1 < 0.

Examples

Input:Test(False); would set the value of an input “Test” to a default value of False.

If 50 > 100 Then would result in a value of False and the statement following Then would not be executed.

File

Sends information to a specified file from a Print statement.

(str_Filename) is a string expression that must be a valid path and file name encompassed in quotes. 

The name of the file must be string literal as variables are not permitted as file names.

Example

If you wanted to send the date, time, and close information from a chart to a new ascii file named mydata and located in the data directory by applying an indicator, you could use the following syntax:

Print(File("c:\data\mydata.txt"), Date, Time, Close);

FileAppend

Sends information to an existing ASCII file specified by the user and adds the information to the bottom of the file.

FileAppend("str_Filename", "str_Text") ;

(str_Filename) is a string expression that is the path and file name for the existing ASCII text file to which you want to append the string of text. The path and file name should be enclosed in quotes. 

(str_Text) is the string expression to be appended to the file.

Variables are not permitted as file names.

If the file does not exist, it will be created.

To send numeric expressions to a file, it must first be converted to a string expression using the NumToStr function.

Example

To create indicator that would send the date to an ASCII file every time the symbol gapped up 10% on the open, you would write:

If Open > High[1] * 1.1 Then

FileAppend("c:\mydata.txt", "This symbol gapped up on " + NumToStr(Date, 0) +

NewLine);

FileDelete

Deletes the specified file.

(str_Filename) is a string expression that must be a valid path and file name encompassed in quotes.

The name of the file must be string literal as variables are not permitted as file names.

Example

If you wanted to delete a file when an analysis technique was initially applied, you could use the following syntax:

If BarNumber = 1 Then

         FileDelete("c:\mydata.txt");

FirstNoticeDate

Returns a numeric expression representing the EasyLanguage date of the first notice of the symbol.  The first notice date is defined by the expiration rules.

Example

If FirstNoticeDate then Alert("First Notice Expiration");

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.

FirstOption

Returns true/false indicating if an option is the first option initiating an option core calculation event. FirstOption is used in conjunction with a global variable to increase the efficiency of OptionStation core calculations.

Note  GVvalue0 - 99 are global variables used in Volatility Models, GPvalue0 - 99 are global variables used in Pricing Models, and GBvalue0 - 99 are global variables used in Bid/Ask models.

Example

If FirstOption then begin

GVvalue1 = .40;

ModelVolatilty(GVValue1);

FLOAT

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.

Floor

Returns the highest integer less than the specified (Num).

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

Examples

Floor(4.5) returns a value of 4.

Floor(-1.72) returns a value of -2.

For

For loops are used to conduct a repeated line or lines of code for a specified number of intervals.

 

For will always be followed by a variable name, the range to be repeated, and finally a Begin… End section containing the code to be executed based on the For expression.

Examples

For Value5 = Length To Length + 10 Begin

         {Your Code Here}

End; For is used here to initiate a loop that will be executed for each value of Value5 from Length to Length plus 10.

Variables: Sum(0), Counter(0);

Sum = 0;

For Counter = 0 To Length - 1 Begin

         Sum = Sum + Price[Counter];

End; For is used here to initiate the accumulation of the variable Sum for each value of Counter from 0 to Length minus one.

FracPortion

Returns the fractional portion of the specified (Num).

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

Examples

FracPortion(4.5) returns a value of 0.5.

FracPortion(-1.72) returns a value of –0.72.

FreeCshFlwPerShare

Returns the Free Cash Flow Per Share value.

FreeCshFlwPerShare is calculated by Cash From Operations - Capital Expenditures - Dividends Paid.

Friday

Returns the number 5 as the value for Friday.

The value returned is an integer representing Friday and is the same value returned by using the function DayOfWeek(Friday).

Example

Friday returns a value of 5 as the value for Friday.

From

Reserved word used in an Exit statement to specify the name of a Long or Short entry.

Entry names are not required.

From is exclusively used in an Exit condition along with “entry”, to specify the Entry to exit from

Examples

ExitLong from entry ("MyTrade") next bar market; generates an order to exit the long position “MyTrade” on the first price of the next bar.

Exitshort from entry ("MyTrade") this bar on close; generates an order to exit the short position “MyTrade” at the close of the current bar.

Additional Example

ExitLong from entry ("MyTrade") next bar at 75 Stop; generates an order to exit the long position “MyTrade” on the next bar at a price of 75 or lower.

Future

Used to reference the current futures contract in a Position Analysis window.

The current contract can only be referenced for data from the Global Server.

Example

If High of Future > 1000 then

         Alert("High is greater than 1000");

FutureType

Evaluates a position leg to determine if it is a future.

Example

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

 

G

G_Rate_EPS_NY

Returns the number of years over which the Earnings Per Share Growth Rate is calculated.

G_Rate_Nt_In_NY

Returns the number of years over which the Net Income Growth Rate is calculated.

G_Rate_P_Net_Inc

Returns the Net Income Growth Rate percentage for a stock.

Gamma

Returns the Gamma value of an option, leg, or position. The value of Gamma can also be established in a Pricing Model by using Gamma(Value).

Debit will positions will return positive numbers and credit positions will return negative numbers.

Examples

If Gamma of Option > LowVal Then

         Alert("Low Gamma");

In a Pricing Model, you can set the value of Gamma by using the following syntax:

Gamma(0);

GetBackgroundColor

Returns the numeric color value for the background color of the chart.

The value returned is a number from 1 to 16 for the 16 possible colors. 

Example

If you wanted to set a variable, Value1, to the color of the background, you could use the following syntax:

Value1 = GetBackgroundColor;

GetBotBound

Returns the bottom boundary of a ProbabilityMap array.

Example

If you wanted to set the variable, Value1, equal to the bottom boundary of the ProbabilityMap array, you could use the following syntax:

Value1 = GetBotBound;

GetCDRomDrive

Returns a string expression of the drive letter for the first CD Rom drive detected.

The value returned for a CD Rom drive of D would be “D”.

Example

The following sets the variable Drive equal to the first CD Rom drive detected.

Vars: Drive("D");

Drive = GetCDRomDrive;

GetCellColor

Returns the numeric color value of the specified Activtiy Bar cell.

(Price) is a numeric expression representing the price of the bar.

(Side) is a Rightside/Leftside expression that specifies which side of the bar to reference.

(WhichCell) is a numeric expression representing the column to (Side) of the bar a level (Price).

The specified cell must be applied to the chart to return a value.

Example

GetCellColor(Open, Leftside, 3) returns the numeric color value (7 for example if the cell is yellow) from the ActivityBar cell 3 cells to the left of the bar at price, open.

GetExchangeName

Returns the Name of the Exchange of the symbol to which the technique is applied.

Examples

GetExchangeName returns NYSE for IBM trading on the New York Stock Exchange

GetExchangeName returns CME for SP trading on the Chicago Mercantile Exchange

GetPlotBGColor

Returns the numeric background color of the cell to which a specified analysis technique is applied. 

(PlotNum) is a numeric expression representing a plot number.

GetPlotBGColor is only valid for indicators applied to grids.

The value returned is a number from 1 to 16 for the 16 possible colors.

Example

If you wanted to set a variable, Value1, to the color of the Plot1 background, you could use the following syntax:

Value1 = GetPlotBGColor(1);

GetPlotColor

Returns the numeric color value of a plot line in a chart or foreground color in a grid.

(PlotNum) is a numeric expression representing a plot number.

The value returned is a number from 1 to 16 for the 16 possible colors.

Example

If you wanted to set a variable, Value1, to the color of the Plot1 foreground, you could use the following syntax:

Value1 = GetPlotColor(1);

GetPlotWidth
Returns the numeric width value of a plot line in a chart.
(Plot) is a numeric expression representing a plot number.
The value returned is a number representing the assigned width of the specified plot line.
Example
If you wanted to set a variable, Value1, to the width of the Plot1 line on a chart, you could use the following syntax:
Value1 = GetPlotWidth(1);
GetPredictionValue

Returns the number of columns in a ProbabilityMap array.

(Column) is a numeric expression representing the desired column number from which to retrieve the prediction value.

(Price) is a numeric expression representing the desired price level from which to retrieve the prediction value.

It may be necessary to use the GetNumColumns, GetBotBound, and GetTopBound reserved words in order to verify that the requested prediction value is a possibility within the array.

Example

If you wanted to send the prediction value of the cell in column 5 and price 95.250 in the ProbabilityMap array to the Message Log, you could use the following syntax:

Print(GetPredictionValue(5, 99.250)," Predicted value");

GetRowIncrement

Returns the row increment value in a ProbabilityMap array.

Example

If you wanted to set the variable, Value1, equal to the row increment value in the ProbabilityMap array, you could use the following syntax:

Value1 = GetRowIncrement;

GetStrategyName

Returns the strategy name as a string value.

Remarks: 

This reserved word can only be used in the evaluation of strategies.

Example

GetStrategyName returns a value of “Moving XAvg Cross” when the Moving XAvg Cross strategy is applied.

GetSymbolName

Returns the Name of the symbol to which the technique is applied.

Return value is a string.

Returns the root, year, and contract month for futures symbols.

Examples

GetSymbolName returns IBM for International Business Machines trading on the New York Stock Exchange

GetSystemName

Reserved for backward compatibility. See GetStrategyName. Returns the strategy name as a string value.

This reserved word can only be used in the evaluation of strategies.

Example

GetSystemName returns a value of “Moving XAvg Cross” when the Moving XAvg Cross strategy is applied.

GetTopBound

Returns the top boundry of a ProbabilityMap array.

Example

If you wanted to set the variable, Value1, equal to the top boundary of the ProbabilityMap array, you could use the following syntax:

Value1 = GetTopBound;

Gr_Rate_P_EPS

Returns the Earnings Per Share Growth Rate for a stock.

Green

Sets the plot color or background color to Green.

 

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

Examples

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

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

GrossLoss

Returns the total dollar amount of all closed losing trades.

GrossLoss does not include the current open position, or the value of winning trades

Examples

GrossLoss returns -1000 if there are three losing trades of –500, -200 and -300.

GrossLoss returns 0 if there are no closed losing trades, even if the current position is losing.

GrossProfit

Returns the total dollar amount of all closed winning trades.

GrossProfit does not include the current open position, or the value of losing trades

Examples

GrossProft returns 1000 if there are three winning trades of 500, 200 and 300.

GrossProfit returns 0 if there are no closed winning trades, even if the current position is winning.

H

H

Reserved word used to return the high price of the specified time increment or group of ticks.

Any time the High of a bar is needed, the letter H can be used as an equivalent.

Examples

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

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

Additional Example

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

If High > High[1] and High[1] > High[2] then…Plot1(High,"Rising");

High

Reserved word used to return the high price of the specified time increment or group of ticks.

The letter H can be used as an equivalent to High.

Examples

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

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

Additional Example

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

If High > High[1] and High[1] > High[2] then

Plot1(High,"Rising");

Higher

Synonym for stop or limit orders depending on the context used within a strategy.

Higher means stop when used in the following context:

Buy next bar at MyEntryPrice or Higher;

ExitShort next bar at MyExitPrice or Higher;

Higher means limit when used in the following context:

Sell next bar at MyEntryPrice or higher;

ExitLong next bar at MyEntryPrice or higher;

Example

Buy next bar at Average(High,8) or higher;

HistFundExists

Returns True if Historical Fundamental information (EPS, Dividends and Stock Splits) exists, False if not.

HistorySettings

Returns a string with the description of the available history settings for a symbol.

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.

I

I

Shortcut notation that returns the Open Interest of a bar.

Anytime the Open Interest of a bar is needed, the letter I can be used in an equivalent fashion.

Examples

I of 1 bar ago returns the Open Interest of the previous bar.

Average(I, 10) returns the Average of the last 10 Open Interest values.

Additional Example

To check that the last two bars have Open Interest values higher than the previous bar write:

If I > I[1] and I[1] > I[2] then

Plot1(High,"Rising");

I_AvgEntryPrice

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

I_AvgEntryPrice only returns the average entry price for open trades.

I_AvgEntryPrice can only be used in a study.

I_AvgEntryPrice will only return a value if a strategy is applied to the same data.

Examples

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

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

I_ClosedEquity

Returns the profit or loss realized when a position has been closed.

I_ClosedEquity only returns the profit or loss for closed trades.

I_ClosedEquity can only be used in a study.

I_ClosedEquity will only return a value if a strategy is applied to the same data.

I_CurrentContracts

Returns the number of contracts held in all open positions.

I_CurrentContracts can only be used in a study.

I_CurrentContracts will only return a value if a strategy is applied to the same data.

Examples

I_CurrentContracts returns 3 if there are three open positions of one contract each.

I_CurrentContracts returns 10 if there are three open positions of 3, 4, and 3 contracts respectively.

I_MarketPosition

Returns the current Market Position.

I_MarketPosition returns the following numbers:

1        For a Long position

         -1          For a Short position

         0           For a Flat position

I_MarketPosition can only be used in a study.

I_MarketPosition will only return a value if a strategy is applied to the same data.

Examples

I_MarketPosition returns 1 if the current position is a Long position.

I_MarketPosition returns -1 if the current position is a Short position.

I_OpenEquity

Returns the current gain or loss while a position is open.

I_OpenEquity only returns the profit or loss for open positions.

I_OpenEquity can only be used in a study.

I_OpenEquity will only return a value if a strategy is applied to the same data.

If

This word is used to introduce a condition that will be evaluated to determine execution of additional code.

If can only be used to begin an If… Then or If… Then… Else statement.

In order to use an If… Then… Else statement, a Begin… End statement must follow Then as in the second example below.

Examples

If Condition1 Then

         {Your Code Line1} If is used here to start the If… Then statement.  The Line1 code will be executed if Condition1 returns a value of True.  If Condition1 is false, the Line1 code will not be executed.

If Condition1 And Condition2 Then

         Begin

         {Your Code Line1}

         {Your Code Line2, etc.}

         End

         Else

                     Begin

                     {Your Code Line3}

                     {Your Code Line4, etc.}

                     End; If is used here to start the If… Then… Else statement.  The Line1 and Line2 code will be executed if Condition1 and Condition2 return a value of True.  If Condition1 or Condition2 is false, the Line3 and Line4 code will be executed.

IncludeSignal

This word is used to include a trading signal in another trading signal.

The syntax is:

IncludeSignal:"Signal Name",InputNames;

Multiple input names should be separated by commas. The EasyLanguage PowerEditor evaluates the EasyLanguage in the trading signal from the top of the file to the bottom of the file. When the IncludeSignal Reserved Word is reached, the EasyLanguage PowerEditor evaluates the EasyLanguage in the referenced signal from top to bottom, then returns to the original signal and continues its top to bottom evaluation.

You can include as many signals as you want, although we recommend you create separate signals and mix and match them together in strategies using TradeStation StrategyBuilder. This is a more efficient way of grouping signals together and achieves the same purpose.

The use of signals in TradeStation 2000i eliminates the need for the IncludeSystem statement.

IncludeSystem

This word is retained for backward compatibility. TradeStation 2000i doesn’t have the 64K limit of its predecessor, and it has adopted modular strategy design where a strategy is made up of one or more trading signals. Therefore, when you create a trading strategy, you no longer use the word IncludeSystem.

You can include a signal within another signal using the reserved word IncludeSignal.

InitialMargin

Returns the Intial Margin Requirement of a position.

Example

If InitialMargin of Position > 500 Then {Your Operation Here}

Input

Reserved word used to declare an Input name used to represent user-defined values anywhere in a technique.

An input name can contain up to 20 alphanumeric characters plus the period ( . ) and the underscore ( _ ).

An input name can not start with a number or a period ( . ).

Inputs are constants that can not start a statement.

The default value of an Input is declared by a number in parenthesis after the input name.

Examples

Input: Length(10); declares the constant Length initializes the value to ten.

Input: Price(Close); declares the constant Price initializes the value to the Close of a bar.

Inputs

Reserved word used to declare multiple Input names, used to represent user-defined values anywhere in a technique.

An input name can contain up to 20 alphanumeric characters plus the period ( . ) and the underscore ( _ ).

An input name can not start with a number or a period ( . ).

Inputs are constants that can not start a statement.

The default value of an Input is declared by a number in parenthesis after the input name.

Examples

Input: Price(Close), Length(10); declares the constants Price and Length, initializing the values to the Close of the bar and ten, respectively.

Input: SlowMA(9), FastMA(4); declares the constants SlowMA and FastMA, initializing the values to nine and four, respectively.

Inst_Percent_Held

Returns the percent of common stock held by all the reporting institutions as a group.

Inst_Percent_Held is calculated by dividing Total Shares held by Institutions by Total Shares Outstanding and multiplying the result by 100.

InStr

Returns the location of String2 within String1.

InStr (String1, String2) ;

(String1) represents the string that will be evaluated.

(String2) represents the string to be located.

Returns the location of String2 within String1, represented as the number of characters from the left side. 

If the specified string (String2) is found more than once in String1, the value returned refers to only the first occurrence.

0 is returned if the specified string (String2) does not exist in the evaluated string (String1).

Examples

InStr("Net Profit in December", "Profit") returns the value 5, indicating that the string "Profit" begins at position 5 of String1.

InStr("Net Profit in December", "January") returns the value 0 since the string "January" does not exist in String1.

INT

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.

IntPortion

Returns the integer portion of the specified number.

IntPortion(Num) ;

(Num) is a numeric expression representing the number for which you want the integer portion.

Examples

IntPortion(4.5) returns a value of 4.

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

Is

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 "is" is not necessary and the code functions the same way regardless of its presence.

J

JulianToDate

Returns the calendar date for the specified Julian date.

JulianToDate(jDate) ;

(jDate) is a numeric expression representing the Julian date.

Examples

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

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

L

Shortcut notation that returns the Low of the bar.

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

Examples

L of 1 bar ago returns the Low price of the previous bar.

Average(L, 10) returns the Average of the last 10 Low prices.

Additional Example

To check that the last two bars have Low prices lower than the previous bar write:

If L < L[1] and L[1] < L[2] then

Plot1(High,"Falling");

LargestLosTrade

Returns the dollar value of the largest closed losing trade.

Examples

LargestLosTrade returns -500 if there are three losing trades of –500, -200 and -300.

LargestLosTrade returns 0 if there are no closed losing trades, even if the current position is losing.

LargestWinTrade

Returns the dollar value of the largest closed winning trade.

Examples

LargestWinTrade returns 500 if there are three winning trades of 500, 200 and 300.

LargestWinTrade returns 0 if there are no closed winning trades, even if the current position is winning.

Last_Split_Date

Returns the Date on which the last stock split was reported.

Last_Split_Fact

Returns the ratio of the last stock split.

Examples

Last_Split_Fact returns 2 if the last split ratio was 2:1.

Last_Split_Fact returns 1.5 if the last split ratio was 3:2.

LastCalcJDate

Returns the Julian date for the last completed bar.

Examples

LastCalcJDate returns a value of 36011 if the last bar was completed on August 4, 1998.

LastCalcJDate returns a value of 36173 if the last bar was completed on January 13, 1999.

LastCalcMMTime

Returns the time, in number of minutes since midnight, for the last completed bar.

Examples

LastCalcMMTime returns a value of 540 if the last bar was completed at 9:00 am.

LastCalcMMTime returns a value of 835 if the last bar was completed at 1:55 pm.

LastTradingDate

Refers to the last day an option, future, position leg, or asset may be traded.

Example

If DateToJulian( LastTradingDate ) - DateToJulian( Date ) < 5 thenAlert("Less than 5 trading days left");

LeftSide

Used to specify ActivityBar actions on the left side of the bar.

Example

GetCellChar(Close, Leftside, 3) Leftside is used to specify the left side of the ActivityBar.

LeftStr

Returns a string expression of (sSize) characters taken from (Str1) beginning with the leftmost character.

LeftStr (Str1, sSize) ;

(Str1) is the string expression to reduce. It must be enclosed in quotation marks.

(sSize) is the numeric expression indicating the number of characters that will be retained, counting from the beginning of the string expression.

None

Example

LeftStr("Net Profit", 3) returns the string expression “Net”.

Leg

Returns the requested information for the specified leg.

(Leg of Position) is a numeric expression representing a specific position leg.

Leg (Leg of Position) references the position leg specified by (Leg of Position).  Placing " of Leg(Leg of Position)" after any bar data element (Open, High, Low, Close, Volume, OpenInt, Date, Time, UpTicks, DownTicks, Ticks) or any option-related reserved word (e.g., Strike, ExpirationDate, Delta, Gamma, Theta, etc.) returns the specified value.

Examples

If Volume of Leg(1)  > HighVal Then {Your Operation Here}

If Close of Leg(1) = Highest(High of Leg(1),10) Then

         Alert("Highest High");

LegType

Returns the type of position leg: asset, future, call, or put.

Example

If LegType of Leg(1) = Call Then

         Plot1("Call", "Leg Type");

If LegType of Leg(1) = Put Then

         Plot2("Put", "Leg Type");

LightGray

Sets the plot color or background color to Light Gray.

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

Examples

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

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

Limit

Reserved word used in an Entry or Exit statement to specify how to fill an order.

Limit orders can only be executed on the next bar

Limit can be read as “this price or better”, meaning lower for a Long Entry and Short Exit, higher for a Short Entry and Long Exit.

Limit orders require a reference price.

Examples

Buy next bar at 75 Limit; generates an order to enter a long position on the next bar at a price of 75 or lower.

Sell next bar at 75 Limit; generates an order to enter a long position on the next bar at a price of 75 or higher.

Additional Example

ExitLong next bar at 75 Limit; generates an order to enter a long position on the next bar at a price of 75 or higher.

Log

Returns the logarithm for the specified (Num).

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

A logarithm is the exponent that indicates the power to which a number is raised to produce a given number.  This reserved word uses a base e system.

Log can only be calculated for positive numbers.

Examples

Log(4.5) returns a value of 1.5041.

Log(172) returns a value of 5.1475.

LONG

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.

Low

Represents the low price of the specified time increment or group of ticks.

L can be used in place of Low.

Examples

Low of 1 bar ago returns the Low price of the previous bar

Average(Low, 10) returns the Average of the last 10 Low prices

Additional

To check that the last two bars have Low prices lower than the previous bar, write:

If Low < Low[1] AND Low[1] < Low[2] Then

Plot1(Low, "Decline")

Lower

Synonym for stop or limit orders depending on context used within a strategy.

Lower means limit when used in the following context:

Buy next bar at MyEntryPrice or Lower;

ExitShort next bar at MyExitPrice or Lower;

Lower means stop when used in the following context:

Sell next bar at MyEntryPrice or Lower;

ExitLong next bar at MyEntryPrice or Lower;

Example

Buy next bar at the Average(Low,8) or lower;

LowerStr

Used to convert a string expression to lowercase letters.

LowerStr (“Str1”) ;

 (Str1) the string expression to change to lowercase letters. Make sure the string expression is enclosed in quotation marks.

None

Example

LowerStr("Net Profit”) returns the string expression “net profit”.

LPBOOL

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.

LPBYTE

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.

LPDOUBLE

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.

LPDWORD

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.

LPFLOAT

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.

LPINT

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.

LPLONG

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.

LPSTR

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.

LPWORD

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.

M

Magenta

Sets the plot color or background color to Magenta.

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

Examples

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

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

MakeNewMovieRef

Creates a new movie chain with the reference number specified.

The reference number should be a whole positive number.

Example

Print(MakeNewMovieRef = 1) creates a new movie chain with a reference number of 1.

Margin

Returns the margin setting in the applied strategy’s Costs tab.

This reserved word can only be used in the evaluation of strategies.

Example

Margin returns a value of 1500 if the margin under the strategy’s Costs tab has been set to 1500.00.

Market

Reserved word used to indicate the next trade or tick, not specific to the price.

Market is normally used in trading Signals.

Example

To enter a trade when the price of entry is not an issue:

Buy next bar at market;

MarketPosition

Returns a numeric value for a short or long position for the specified position.

(Num) is a numeric expression representing the number of positions ago.

-1 is returned for a short position, and 1 is returned for a long position.  0 is returned if the current position is specified, and you are not currently in the market.

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

Example

MarketPosition(0) returns a value of 0 if the current position is neutral.

MaxBarsBack

Reserved word used to represent the number of bars of data necessary to calculate the rules in any analysis technique.

The MaxBarsBack setting may prevent values from being displayed when an indicator is first applied. When enough data sets have been acquired to satisfy the MaxBarsBack setting, values will appear.

When analysis techniques are applied to more than one data set at a time (i.e. a multi-data chart), each data set must meet the MaxBarsBack requirement individually before values will be generated.

MaxBarsForward

Represents the number of bars to the right of the last bar on the chart.

MaxBarsForward returns the number of bars used for space to the right.

MaxConsecLosers

Returns the largest number of consecutive closed losing trades.

Examples

MaxConsecLosers returns 5 if the largest number of consecutive closed losing trades is 5.

MaxConsecLosers returns 2 if the largest number of consecutive closed losing trades is 2.

MaxConsecWinners

Returns the largest number of consecutive closed losing trades.

Examples

MaxConsecLosers returns 5 if the largest number of consecutive closed losing trades is 5.

MaxConsecLosers returns 2 if the largest number of consecutive closed losing trades is 2.

MaxContracts

Returns the maximum number of contracts held during the specified position.

(Num) is a numeric expression representing the number of positions ago.

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

Example

MaxContracts(2) returns a value of 3 if the second most recent position held a maximum of 3 contracts.

MaxContractsHeld

Returns the maximum number of contracts held at any one time.

MaxEntries

Returns the maximum number of entries of the specified position.

(Num) is a numeric expression representing the number of positions ago.

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

Example

MaxContracts(2) returns a value of 3 if the second most recent position had 3 entry signals.

MaxGain

Returns the Maximum Gain of the position.

Example

If MaxGain of Position < HighVal Then {Your Operation Here}

MaxIDDrawDown

Returns the largest drop in equity throughout the entire trading period.

MaxIDDrawDown returns the true number of dollars needed to sustain the largest equity dip.

Examples

MaxIDDrawDown returns 5000 if the largest equity dip throughout the entire trading period is 5000.

MaxIDDrawDown returns 2000 if the largest equity dip throughout the entire trading period is 2000.

MaxList

Returns the highest value of the specified 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.

Examples

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

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

MaxList2

Returns the second highest value of the specified 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.

Examples

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

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

MaxLoss

Returns the Maximum Loss of the position.

Example

If MaxLoss of Position > LowVal Then {Your Operation Here}

MaxPositionLoss

Returns the largest loss of the specified position.

(Num) is a numeric expression representing the number of positions ago.

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

Example

MaxPositionLoss(1) returns a value of –3750.00 if the second most recent position had a maximum loss of 3750.00.

MaxPositionProfit

Returns the largest gain of the specified position.

(Num) is a numeric expression representing the number of positions ago.

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

Example

MaxPositionProfit(1) returns a value of 29200.00 if the second most recent position had a maximum profit of 29200.00.

MessageLog

Sends information to the Message Log.

MessageLog (Parameters) ;

 (Parameters) may be a single string or numeric expression, or a multiple string or numeric expression, with each expression separated by a comma.

None

Examples

To send the date, time, and close information to the Message Log, you would use:

MessageLog(Date, Time, Close);

MidStr

Returns a string expression of (Siz) characters taken from (String) beginning with the (Pos) character measured from the left.

MidStr (“String”, Pos, Siz) ;

 (String) is the string expression to reduce. It must be enclosed in quotation marks.

(Pos) is the numeric expression indicating how many characters from the beginning of the string expression to remove.

(Siz) is the numeric expression indicating the number of characters to be retained. Any additional characters to the right of these are removed.

None

Example

MidStr("Net Profit in December", 5, 6) returns the string expression “Profit”.

MinList

Returns the lowest value of the specified 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.

Examples

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

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

MinList2

Returns the second lowest value of the specified 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.

Examples

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

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

MinMove

Returns a numeric expression representing the minimum movement allowed for a particular symbol. The minimum movement for a symbol is specified in the GlobalServer settings for each symbol. 

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.

Examples

MinMove * PriceScale returns the smallest increment between trades.

MinMove * PriceScale * BigPointValue returns the dollar value of the smallest change in price.

MIVonAsk

Returns the market implied volatility of an option or position leg based on the ask price defined by a Bid/Ask Model.

Example

If ModelVolatility of Option > MIVonAsk of Option * 1.2 then

         Alert("High Modeled Volatility");

MIVonBid

Returns the market implied volatility of an option or position leg based on the bid price defined by a Bid/Ask Model.

Example

If ModelVolatility of Option > MIVonBid of Option * 1.2 then

         Alert("High Modeled Volatility");

MIVonClose

Returns the market implied volatility of an option or position leg based on the closing price.

Example

If ModelVolatility of Option > MIVOnClose of Option * 1.2  then

         Alert("High modeled Volatility");

MIVonRawAsk

Returns the market implied volatility of an option or position leg based on the last ask price received from your datafeed.

Example

If ModelVolatility of Option > MIVonRawAsk of Option * 1.2 then

         Alert("High Modeled Volatility");

MIVonRawBid

Returns the market implied volatility of an option or position leg based on the last bid price received from your datafeed.

Example

If ModelVolatility of Option > MIVonRawBid of Option * 1.2 then

         Alert("High Modeled Volatility");

Moc

This word has been reserved for future use.

Mod

Stands for modulo, as in modulo arithmetic.  Returns the remainder for the specified calculation of (Num) divided by (Divisor).

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

(Divisor) is a numeric expression representing the divisor.

Examples

Mod(17, 5) returns a value of 2.

Mod(457, 9) returns a value of 7.

ModelPosition

Used to reference a modeled position in a Search Strategy.

Example

If you wanted to look for a Delta neutral position, you could use the following syntax:

Condition1 = Delta of ModelPosition < .1 And Delta of ModelPosition > -.1;

PositionStatus(Condition1);

ModelPrice

Used to reference the underlying price currently used by the Pricing or Volatility Model.

Example

If you wanted to calculate the dollar amount of the option being used, you could use the following syntax:

Value1 = ModelPrice * BigPointValue of Option;

ModelVolatility

References the volatility calculated by the Volatility Model.  The value of ModelVolatility can also be established in a Volatility Model by using ModelVolatility(Value).

(Value) is a numeric expression representing the volatility, when ModelVolatility is used to set a default value in a Volatility Model.

Debit will positions will return positive numbers and credit positions will return negative numbers.

Examples

If ModelVolatility > 75 Then

         Alert("High Modeled Volatility");

In a Volatility Model, you can set the value of ModelVolatility by using the following syntax:

ModelVolatility(30);

Monday

Returns the number 1 as the value for Monday.

The value returned is an integer representing Monday and is the same value returned by using the function DayOfWeek(Monday).

Example

Monday returns a value of 1 as the value for Monday.

MoneyMgtStopAmt

This word is retained for backward compatibility.

This word has been replaced by the Signals Initial $ Risk Stop LX and Initial $ Risk Stop SX.

Month

Returns the corresponding month for the specified calendar date. (1 = Jan, 12 = Dec)

(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

Month(990613) returns a value of 6 because 990613 represents June 13, 1999.

Month(1011220) returns a value of 12 because 1011220 represents December 20, 2001.

MULTIPLE

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.

N

Neg

Returns the negative value of the number specified.

Neg (Num) ;

Examples

Neg(17) returns -17.

Neg(-9) returns a value of -9.

Net_Profit_Margin

Returns the Net Profit Margin reported.

Net_Profit_Margin is calculated by dividing Income after Taxes by the Total Revenue and is expressed as a percentage.

NetProfit

Returns the total dollar amount of all closed trades, both winning and losing.

NetProfit can be computed by GrossProfit – GrossLoss.

Examples

NetProfit returns 1000 if there are four trades returning –500, 1200 and 300.

NetProfit returns 0 if there are no closed trades.

NewLine

Used to start a new line when appending to a file using the FileAppend reserved word. Also used to place a carriage return / linefeed command into expert commentary.

Use the + character to add NewLine to a string expression.

Example

FileAppend("c:\mydata.txt", "This symbol gapped up on " + NumToStr(Date, 0) + NewLine);

Next

Reserved word used to reference the upcoming set of price data based on the compression to which a technique is applied.

Next is normally used with the reserved word Bar to specify an action to take place on the "Next Bar".

Examples

Open of next day returns the Open price of the next bar.

Date of next bar returns the Date of the next bar.

Additional Example

To place an order to execute one bar into the future:

Buy next bar at market;

NoPlot

Removes the plot specified by (Plot) from the current bar in a chart or cell in a grid.

(Plot) is a numeric expression representing the specified plot number you want to remove from a bar in a chart or cell in a grid.

The value returned is a number representing the assigned width of the specified plot line.

Example

If you wanted to mark the high of a bar when the condition Close > Close[1] is true, but remove the mark if Close > Close[1] is not true for the next bar, you could use the following syntax:

If Close > Close[1] Then

           Plot1(High, "CloseUp")

Else

           NoPlot(1);

Not

This word has been reserved for future use.

NthMaxList

Returns the Nth highest value of the specified the inputs.

(N) is a numeric expression representing the rank number 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.

A value of 3 for (N) would return the third highest value of the specified inputs.

Examples

NthMaxList(3, 45, 72, 86, 125, 47) returns a value of 72.

NthMaxList(4, 18, 67, 98, 24, 65, 19) returns a value of 24.

NthMinList

Returns the nth lowest value of the specified the inputs.

(N) is a numeric expression representing the rank number 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.

A value of 3 for (N) would return the third lowest value of the specified inputs.

Examples

NthMinList(3, 45, 72, 86, 125, 47) returns a value of 72.

NthMinList(4, 18, 67, 98, 24, 65, 19) returns a value of 65.

Numeric

Reserved word used to define the type of input expected to be passed to a function.

 

 

Numeric can be used for inputs that can be either NumericSimple or NumericSeries.

Examples

Input: Price(Numeric); declares the constant Price as a Numeric value to be used in a function.

Input: Length(Numeric); declares the constant Length as a Numeric value to be used in a function.

NumericArray

NumericArray declares a function input as a numeric array being passed by value.

A function input is declared as a numeric array when it is passing in a numeric array by value.

Example

Input: PassedValues[n](NumericArray) indicates that a numeric array is being passed into the function by value through the Input PassedValues.

NumericArrayRef

NumericArrayRef declares a function input as a numeric array being passed by reference.

A Function Input is declared as a numeric array reference when it is passing in a numeric array by reference.

Example

PassedValues[n](NumericArrayRef) indicates that a numeric array is being passed into the function by reference through the Input PassedValues.

NumericRef

NumericRef declares a function input as a numeric value being passed by reference.

A function input is declared as a numeric reference when it is passing in a value by reference.

Example

PassedValue(NumericRef) indicates that a numeric value is being passed into the function by reference through the Input PassedValue.

NumericSeries

Reserved word used to define the type of input expected to be passed to a function.

NumericSeries is used for inputs that whose values can be referred to historically.

Examples

Input: Price(NumericSeries); declares the constant Price as a Numeric value to be used in a function, where historical values of Price are available.

Input: Length(NumericSeries); declares the constant Length as a Numeric value to be used in a function, where historical values of Length are available.

NumericSimple

Reserved word used to define the type of input expected to be passed to a function.

NumericSimple can not be used for inputs whose values can be referred to historically.

Examples

Input: Price(NumericSimple); declares the constant Price as a Numeric value to be used in a function, restricting Price to be a value that does not contain historical values.

Input: Length(NumericSimple); declares the constant Length as a Numeric value to be used in a function, restricting Length to be a value that does not contain historical values.

NumFutures

Returns the total number of futures contracts associated with a future symbol root or position leg.

Example

If you wanted to average the prices of all the futures available for a particular symbol root, you could use the following syntax:

Vars: Total(0), Avg(0);

For Value1 = 1 to NumFutures of Asset Begin

         Total = Total + Close of Future(Value1);

End;

NumLegs

Returns the total number of position legs associated with any position. A position leg may consist of an asset, future, or option.

Example

If you wanted to show the total number of legs of a position in an indicator, you could use the following syntax:

Plot1(NumLegs of Position, "NumLegs");

NumLosTrades

Returns the number of closed losing trades.

Examples

NumLosTrades returns 5 if the number of closed losing trades is 5.

NumLosTrades returns 2 if the number of closed losing trades is 25.

NumOptions

Returns the total number of position legs associated with any position. A position leg may consist of an asset.

Example

If you wanted to show the total number of options available in an indicator, you could use the following syntax:

Plot1(NumOptions of Asset, "NumOptions");

NumToStr

Converts the specified numeric expression to a string expression.

NumToStr(Num, Dec) ;

(Num) is the numeric expression that you want converted to a string expression.

(Dec) is the numeric expression indicating how many decimal places to retain in the string expression.

None

Example

NumToStr(1170.5, 2) returns the string expression “1170.50”.

NumWinTrades

Returns the number of closed winning trades.

Examples

NumWinTrades returns 5 if the number of closed winning trades is 5.

NumWinTrades returns 2 if the number of closed winning trades is 2

O

O

Shortcut notation that returns the Open of the bar.

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

Examples

O of 1 bar ago returns the Open price of the previous bar.

Average(O, 10) returns the Average of the last 10 Open prices.

Additional Example

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

If O > O[1] and O[1] > O[2] then

Plot1(High,"Rising");

Of

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 Close of Data1 = Highest(High, 14) Then the word "of" is not necessary and the code functions the same way regardless of its presence.

On

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 on Next Bar Open the word "on" is not necessary and the code functions the same way regardless of its presence.

Open

Reserved word used to return the first price of the specified time increment or group of ticks.

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

Examples

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

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

Additional Example

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

If Open > Open[1] and Open[1] > Open[2] then

Plot1(High,"Rising");

OpenInt

Reserved word used to return the Open Interest of the specified time increment or group of ticks.

Open Interest is the number of contracts/shares outstanding at the Close of a bar.

Examples

OpenInt of 1 bar ago returns the Open Interest of the previous bar.

Average(OpenInt, 10) returns the Average of the last 10 Open Interest values.

Additional Example

To check that the last two bars have Open Interest values higher than the previous bar write:

If OpenInt > OpenInt[1] and OpenInt[1] > OpenInt[2] then

Plot1(High,"Rising");

OpenPositionProfit

Returns the current gain or loss of the current open position.

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

Example

OpenPositionProfit returns a value of 86400.00 if the current open position on an S&P Futures chart had an open position profit of 86400.00.

Option

References the current option contract in a Position Analysis window.  Option can also be used as Option(OptionNum) to reference a specific option.

(OptionNum) is a numeric expression  representing a specific option contract.

Used to reference information of a specific option contract.  Placing "of Option(OptionNum)" after any bar data element (e.g., Open, High, Low, Close, Volume, etc.) or any option-related reserved word (e.g., Strike, ExpirationDate, Delta, etc.) returns the requested information for the option specified by (OptionNum).

When using (OptionNum), the total number of options available should be verified before using Option(OptionNum) to assure that (OptionNum) is set to a valid option.

Examples

Value1 = Close of Option;

You can set Value1 to the value of a specifc option by using the following syntax:

Value1 = Close of Option(5);

OptionType

Evaluates a option to determine if it is a call or put.

Example

If OptionType = Call Then {Your Operation Here}

Or

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

Or requires that in order for a condition to be True, one or more of multiple conditions must be True. 

Examples

If Plot1 Crosses Above Plot2 Or Plot2 > 5 Then Or is used here to determine if either the direction of the cross of the values Plot1 and Plot2, or that Plot2 is greater than 5 is True on the bar under consideration.  If either is True, the condition returns True.

If Value1 Crosses Above Value2 Or Value1 > Value1[1] Then Or is used here to determine if either the direction of the cross of the variables Value1 and Value2, or that Value1 is greater that Value1 of one bar ago is True on the bar under consideration. If either is True, the condition returns True.

Over

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 over, or becomes greater than another value.  A value (Value1) crosses over 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.

Over is a synonym for Above.

Examples

If Average(Close, 9) Crosses Over the Average(Close, 18) Then Over is used here to determine the direction of the cross of the values two moving averages on the bar under consideration.

If Value1 Crosses Over Value2 Then Over is used here to determine the direction of the cross of the variables Value1 and Value2 on the bar under consideration.

P

Pager_DefaultName

Returns the string value of the default Message Recipient as specified in the Messaging tab under the File - Desktop Options menu.

The string is returned in the format “Default Name”.

Example

Pager_DefaultName returns a value of “This is a test message for Default User” if that is the string specified in the Messaging tab under the Tools - Desktop Options menu.

Pager_Send

Sends the specified string value to the specified string name.

Pager_Send(“Str_Name”, “Str_Msg”) ;

(str_Name) is a string expression which specifies the recipient of the message.

(str_Msg) is a string expression containing the message that will be sent to the pager.

Paging must be enabled and installed for delivery of the message to be completed.

Example

The following sends the message “Buy 200 AMD at Market” to Joe Trader:

Pager_Send("Joe Trader", "Buy 200 AMD at Market") ;

PaintBar  

PlotPaintBar( BarHigh, BarLow [, BarOpen [, BarClose [, "<PlotName>"[, ForeColor[, Default[, Width]]]]]] );

BarHigh, BarLow, BarOpen and BarClose are numeric expressions representing the high, low, open and closing prices for the bar to be drawn by the PaintBar study, and <PlotName> is the name of the plot. ForeColor is an Easy Language color used for the plot (also referred to as PlotColor), Default (reserved for future use), and Width is a numeric value representing the width of the plot.

PercentProfit

Returns the percentage of all closed trades that were winners.

PercentProfit can be calculated by NumWinTrades / TotalTrades.

Examples

PercentProfit returns 80 if the 8 winning trades resulted from 10 total trades.

PercentProfit returns 25 if the 4 winning trades resulted from 16 total trades.

Place

This word is a skip word retained for backward compatibility.

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 PowerEditor.

PlayMovieChain

Plays the movie chain with the specified reference number.

The reference number should be a whole positive number.

Example

Print(PlayMovieChain(1)) plays the movie chain with a reference number of 1.

PlaySound

Plays the specified sound file.

The specified file should be a *.wav audio file.

Example

Print(PlaySound("c:\sounds\Thatsabuy.wav")) plays the sound file Thatsabuy.wav that resides in directory c:\sounds.

Plot

The reserved word Plot is used to obtain the value of the specified plot for the purposes of comparison or calculation.

Plot(n) 

EasyLanguage allows four plot statements per analysis technique, Plot1 through Plot4. The parameter (n) is a numeric expression 1 - 4 identifying the plot for which to obtain the value.

This reserved word enables you to use an input or a variable to specify dynamically the plot to reference.

You cannot use the reserved word Plot to draw values in a chart or grid; the reserved words Plot1 - Plot4 are used to display values. 

Example

The following statement uses a variable, Value1, to specify the plot number:

If Plot(Value1) crosses under Close then buy next bar on Open ;

Plot1

Displays the results of a mathematical calculation or an expression in a chart or grid.

Plot1(Value) ;

or

Plot1(Value, “str_name”, FGColor, BGColor, Width) ;

(Value) is the numeric expression to display in a chart, or numeric, string, or true/false expression to display in a grid. This is the only required parameter.

(str_Name) is the text string representing the plot’s name. The name of a plot is displayed in the Properties tab when you format the analysis technique using the Plot1 statement, in the status line and Data Window in a chart, and in the column heading of a grid. Optional parameter. If no name is specified, the name “Plot1” is used.

(FGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot foreground (when displaying a plot in a chart, you only specify the foreground color). See EasyLanguage colors for a list of available colors. Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

(BGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot background (applicable only when applying the analysis technique to a grid, this parameter is ignored when applied to a chart). Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

(Width) is a numeric value representing the width of the plot line when applying the analysis technique to a chart. This parameter is ignored when applied to a grid. Optional parameter. When no width is specified, the width specified in the Properties tab of the Format analysis technique dialog box is used.

When applying the analysis technique to a chart, you can displace the plot to the right or left. For example:

Plot1 [3] (Value1) ;

The above example calculates the plot value using the current bar but draws it on the chart 3 bars ago. Use a negative number to draw the value 3 bars ahead of the current bar. You cannot displace a plot in this way when applying the analysis technique to a grid.

Example

Plot1(Average(Close, 14), “Average”) ; 

The above example displays the average of the last 14 bars. The plot is named “Average” and it is displayed in the color(s) and width specified in the Properties tab of the Format dialog box.

Plot1(Average(Close, 14), “Average”, Default, Default, 3) ;

The above example displays the same average, the defaults are used for the colors, and the width is set to 3.

Plot1(Value1, “Average”, Value2, Value3, Value4) ;

The above example displays the value held in the variable Value 1. Not shown are the variable assignment statements you would have to use to assign values to the variables Value1 - Value4.  The plot is named “

Average” and the background and foreground colors as well as the width are specified. Using variables in place of the parameters allows you to manipulate the colors and width dynamically within the analysis technique. Therefore, you can set the colors and width to Default (to use the colors and width in the Properties tab) when you want, or set them to specific values.

Plot2

Displays the results of a mathematical calculation or an expression in a chart or grid.

Plot2(Value) ;

or

Plot2(Value, “str_name”, FGColor, BGColor, Width) ;

 (Value) is the numeric expression to display in a chart, or numeric, string, or true/false expression to display in a grid. This is the only required parameter.

(str_Name) is the text string representing the plot’s name. The name of a plot is displayed in the Properties tab when you format the analysis technique using the Plot1 statement, in the status line and Data Window in a chart, and in the column heading of a grid. Optional parameter. If no name is specified, the name “Plot2” is used.

 (FGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot foreground (when displaying a plot in a chart, you only specify the foreground color). See EasyLanguage colors for a list of available colors. Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

 (BGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot background (applicable only when applying the analysis technique to a grid, this parameter is ignored when applied to a chart). Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

(Width) is a numeric value representing the width of the plot line when applying the analysis technique to a chart. This parameter is ignored when applied to a grid. Optional parameter. When no width is specified, the width specified in the Properties tab of the Format analysis technique dialog box is used.

When applying the analysis technique to a chart, you can displace the plot to the right or left. For example:

Plot2 [3] (Value1) ;

The above example calculates the plot value using the current bar but draws it on the chart 3 bars ago. Use a negative number to draw the value 3 bars ahead of the current bar. You cannot displace a plot in this way when applying the analysis technique to a grid.

Example

Plot2(Average(Close, 14), “Average”) ; 

The above example displays the average of the last 14 bars. The plot is named “Average” and it is displayed in the color(s) and width specified in the Properties tab of the Format dialog box.

Plot2(Average(Close, 14), “Average”, Default, Default, 3) ;

The above example displays the same average, the defaults are used for the colors, and the width is set to 3.

Plot2(Value1, “Average”, Value2, Value3, Value4) ;

The above example displays the value held in the variable Value 1. Not shown are the variable assignment statements you would have to use to assign values to the variables Value1 - Value4.  The plot is named “

Average” and the background and foreground colors as well as the width are specified. Using variables in place of the parameters allows you to manipulate the colors and width dynamically within the analysis technique. Therefore, you can set the colors and width to Default (to use the colors and width in the Properties tab) when you want, or set them to specific values.

Plot3

Displays the results of a mathematical calculation or an expression in a chart or grid.

Plot3(Value) ;

or

Plot3(Value, “str_name”, FGColor, BGColor, Width) ;

 (Value) is the numeric expression to display in a chart, or numeric, string, or true/false expression to display in a grid. This is the only required parameter.

(str_Name) is the text string representing the plot’s name. The name of a plot is displayed in the Properties tab when you format the analysis technique using the Plot1 statement, in the status line and Data Window in a chart, and in the column heading of a grid. Optional parameter. If no name is specified, the name “Plot3” is used.

 (FGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot foreground (when displaying a plot in a chart, you only specify the foreground color). See EasyLanguage colors for a list of available colors. Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

 (BGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot background (applicable only when applying the analysis technique to a grid, this parameter is ignored when applied to a chart). Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

(Width) is a numeric value representing the width of the plot line when applying the analysis technique to a chart. This parameter is ignored when applied to a grid. Optional parameter. When no width is specified, the width specified in the Properties tab of the Format analysis technique dialog box is used.

When applying the analysis technique to a chart, you can displace the plot to the right or left. For example:

Plot3 [3] (Value1) ;

The above example calculates the plot value using the current bar but draws it on the chart 3 bars ago. Use a negative number to draw the value 3 bars ahead of the current bar. You cannot displace a plot in this way when applying the analysis technique to a grid.

Example

Plot3(Average(Close, 14), “Average”) ; 

The above example displays the average of the last 14 bars. The plot is named “Average” and it is displayed in the color(s) and width specified in the Properties tab of the Format dialog box.

Plot3(Average(Close, 14), “Average”, Default, Default, 3) ;

The above example displays the same average, the defaults are used for the colors, and the width is set to 3.

Plot3(Value1, “Average”, Value2, Value3, Value4) ;

The above example displays the value held in the variable Value 1. Not shown are the variable assignment statements you would have to use to assign values to the variables Value1 - Value4.  The plot is named “

Average” and the background and foreground colors as well as the width are specified. Using variables in place of the parameters allows you to manipulate the colors and width dynamically within the analysis technique. Therefore, you can set the colors and width to Default (to use the colors and width in the Properties tab) when you want, or set them to specific values.

Plot4

Displays the results of a mathematical calculation or an expression in a chart or grid.

Plot4(Value) ;

or

Plot4(Value, “str_name”, FGColor, BGColor, Width) ;

 (Value) is the numeric expression to display in a chart, or numeric, string, or true/false expression to display in a grid. This is the only required parameter.

(str_Name) is the text string representing the plot’s name. The name of a plot is displayed in the Properties tab when you format the analysis technique using the Plot1 statement, in the status line and Data Window in a chart, and in the column heading of a grid. Optional parameter. If no name is specified, the name “Plot4” is used.

 (FGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot foreground (when displaying a plot in a chart, you only specify the foreground color). See EasyLanguage colors for a list of available colors. Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

 (BGColor) is the EasyLanguage reserved word (or its numeric equivalent) identifying the color to assign to the plot background (applicable only when applying the analysis technique to a grid, this parameter is ignored when applied to a chart). Optional parameter. When no color is specified, the color specified in the Properties tab of the Format analysis technique dialog box is used.

(Width) is a numeric value representing the width of the plot line when applying the analysis technique to a chart. This parameter is ignored when applied to a grid. Optional parameter. When no width is specified, the width specified in the Properties tab of the Format analysis technique dialog box is used.

When applying the analysis technique to a chart, you can displace the plot to the right or left. For example:

Plot4 [3] (Value1) ;

The above example calculates the plot value using the current bar but draws it on the chart 3 bars ago. Use a negative number to draw the value 3 bars ahead of the current bar. You cannot displace a plot in this way when applying the analysis technique to a grid.

Example

Plot4(Average(Close, 14), “Average”) ; 

The above example displays the average of the last 14 bars. The plot is named “Average” and it is displayed in the color(s) and width specified in the Properties tab of the Format dialog box.

Plot4(Average(Close, 14), “Average”, Default, Default, 3) ;

The above example displays the same average, the defaults are used for the colors, and the width is set to 3.

Plot4(Value1, “Average”, Value2, Value3, Value4) ;

The above example displays the value held in the variable Value 1. Not shown are the variable assignment statements you would have to use to assign values to the variables Value1 - Value4.  The plot is named “

Average” and the background and foreground colors as well as the width are specified. Using variables in place of the parameters allows you to manipulate the colors and width dynamically within the analysis technique. Therefore, you can set the colors and width to Default (to use the colors and width in the Properties tab) when you want, or set them to specific values.

PM_GetNumColumns

Returns the number of columns in a ProbabilityMap array.

Example

If you wanted to set the variable, Value1, equal to the number of columns in the ProbabilityMap array, you could use the following syntax:

Value1 = PM_GetNumColumns;

PM_SetNumColumns

Sets the number of columns in a ProbabilityMap array.

(num) is a numeric expression representing the desired number of columns for the ProbabilityMap.

Example

If you wanted to set the input, Barcolumns, as the number of columns in the ProbabilityMap array, you could use the following syntax:

SetNumColumns(PM_BarColumns);

POB

This word is retained for backward compatibility.  (Price or Better)

POB has been replaced by Limit.

POB is a synonym for a limit order meaning "or higher" or "or lower", depending on the context used within a strategy.

Point

Reserved word that represents one increment of the Price Scale.

Point reflects a change in the decimal portion of a price.

Examples

Close + 1 point returns one increment of the Price Scale added to the Close price.

Low - 1 point returns the Low of the bar minus one increment of the Price Scale.

Additional Example

An exit statement can be written to prevent large losses by:

ExitLong This Bar at EntryPrice - 1 point Stop;

POINTER

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.

Points

Reserved word that represents multiple increments of the Price Scale.

Similar to the reserved word Point.

Represents multiple value change in the decimal portion of a price.

Examples

Close + 5 points returns the Close price plus five increments of the Price Scale added to it.

Low - 2 points returns the Low of the bar minus two increments of the Price Scale.

Additional Example

An exit statement can be written to prevent large losses by:

ExitLong This Bar at EntryPrice - 3 points Stop;

PointValue

Returns the dollar value represented by one increment of a security’s Price Scale.

PointValue can be calculated as Big Point Value divided by the Price Scale, as specified in the Symbol Dictionary.

Examples

PointValue returns 2.5 for the S&P 500 Future trading on the Chicago Mercantile Exchange.

PointValue returns .001 for IBM trading on the New York Stock Exchange.

Additional Example

The smallest dollar move of an asset can be calculated by:

Value1 = PointValue * MinMove;

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.

Pos

(num) is a numeric expression.

Returns the absolute value of num.

Examples

Pos(-5) returns 5.

Pos(350) returns 350.

Position

References a position in a Position Search Strategy.

Example

If you wanted to search for a Delta neutral position, you could use the following syntax:

Condition1 = Delta of Position < .1 And Delta of Position > -.1;

PositionStatus(Condition1);

PositionID

References the PositionID of the Position in a Search Strategy.

Example

If you wanted to plot the Position ID in an indicator, you could use the following syntax:

Plot1(PositionID of Position, "Position ID");

PositionProfit

Returns the current gain or loss of the specified position.

PositionProfit (Num) ;

 (Num) is a numeric expression representing the number of positions ago.

This function can only be used in the evaluation of strategies. PositionProfit does not require an input, it returns the gain or loss of the current position. However, by using the input Num, you can obtain the gain or loss for a previous position.

Example

PositionProfit(3) returns a value of -1.00 if the third most recent position on a chart had a loss of 1.00.

PositionStatus

Defines the true/false expression that must be true in order to create a position in a Position Search Strategy.

(Condition) is a true/false expression that determines when to create a position.

Example

If you wanted to create Search Strategy that searched for positions of in the money calls, you could use the following syntax:

CreateLeg(1, Call);

Condition1 = Close of asset > Strike of Leg(1);

PositionStatus(Condition1);

Power

Returns the number raised to the specified power.

Power(Num, Pow) ;

(Num) is the number to raise to the specified power

(Pow) is the power by which to raise the number

Examples

Pow(2,3) returns 8

Pow(4,5) returns 4096.

Price_To_Book

Returns the Primary EPS, excluding Extraordinary Items and Discontinued Operations.

Price_To_Book is calculated by the adjusted income available to common stockholders divided by the primary average shares outstanding.

PriceScale

Returns the precision to which a security trades.

PriceScale reads the field Price Scale specified in the Symbol Dictionary.

Returns the lower portion of the price scale fraction.

Examples

PriceScale returns 1/100 for the S&P 500 Futures.

PriceScale returns 1/4 for Corn Futures.

Print

Sends information to the Debug window in the EasyLanguage PowerEditor or, if specified, to an output location (a file or the default printer).

Print (Parameters) ;

Parameters is any number of valid string, numeric series, or numeric expression, each separated by a comma. To send output to a printer or file instead of the Debug Window, you must also specify output location.

If no output location is specified, the information is sent to the Debug window in the EasyLanguage PowerEditor.

To send information to a specified file instead of the Debug window, specify the file and path as the first parameter. Enclose the file name and path in quotation marks. To send the information to the default printer, include the word Printer as the first parameter.

You can format the numeric expressions displayed using the Print reserved word. To do so, use the following syntax:

Print( Value1:N:M );

Value 1 is any numeric expression, N is the minimum number of integers to use, and M is the number of decimals to use. If the numeric expression being sent to the Debug window has more integers than what is specified by N, the Print statement uses as many digits as necessary, and the decimal values are rounded to the nearest value. For example, assume Value1 is equal to 3.14159 and we have written the following statement:

Print(Value1:0:4);

The numeric expression displayed in the Debug window would be 3.1416. As another example, to format the closing prices, you can use the following statement:

Print(ELDateToString(Date), Time, Close:0:4);

Examples

The following statement sends the date, time, and closing price of the current bar to the Debug window:

Print(Date, Time, Close);

The following statement sends the same information to an ASCII file called Mydata.txt:

Print(File("c:\data\mydata.txt"),Date, Time, Close);

The following statement sends the information to the default printer instead:

Print(Printer, Date, Time, Close);

Printer

Sends information to the default printer from a Print statement.

The word "Printer" must be the first expression listed in the print statement followed by a comma, and then the requested information. Commas must be used to separate multiple expressions in a print statement.

Example

If you wanted to send the date, time, and close information to the printer when you applied an analysis technique, you could use the following syntax:

Print(Printer, Date, Time, Close);

Product

Returns the number representing the product being used.

The Product function returns values based on the following table.

Product Name             Product Number

TradeStation                           0

OptionStation                         

SuperCharts                            1

Examples

If you wanted to only display an indicator when the user applied the indicator to a TradeStation chart, you could use the following syntax:

If Product = 0 Then

         Plot1(Value1, "Indicator");

Profit

This word has been reserved for future use.

ProfitTargetStop

This word is retained for backward compatibility.

This word has been replaced by the Signals Profit Target LX and Profit Target SX.

Protective

This word has been reserved for future use.

Put

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

Example

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

PutCount

Returns the number of puts in the option chain.

PutCount 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 = PutCount of Asset;

PutITMCount

This word has been reserved for future use.

PutOTMCount

This word has been reserved for future use.

PutSeriesCount

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

PutSeriesCount 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 = PutSeriesCount of Asset;

PutStrikeCount

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

PutStrikeCount 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 = PutStrikeCount of Asset;

Q

q_7DayYield

Returns a numeric expression representing the net 7 day yield for a mutual fund.

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.

q_Ask

Returns a numeric expression representing the last ASK for a symbol.

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.

q_AskExchange

Returns a string expression representing the exchange the last bid was sent from    .

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.

q_AskSize

Returns a numeric expression representing the number of units offered at the best ask price.

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.

q_Bid

Returns a numeric expression representing the last bid price for a symbol.

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.

q_BidExchange

Returns a string expression representing the exchange the last bid was sent from    .

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.

q_BidSize

Returns a numeric expression representing the number of units bid at the best bid price.

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.

q_Close

Returns a numeric expression representing the price of the close of the last completed trading session.

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.

q_DatafeedID

Returns a numeric expression representing the datafeed ID.

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.

q_Date

Returns a numeric expression representing the EasyLanguage date of the last time any price of field of this symbol was updated.

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.

q_DateLastAsk

Returns a numeric expression representing the EasyLanguage date of the last ask transmitted by the datafeed.

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.

q_DateLastBid

Returns a numeric expression representing the EasyLanguage date of the last bid transmitted by the datafeed.

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.

q_DateLastTrade

Returns a numeric expression representing the EasyLanguage date of the last trade transmitted by the datafeed.

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.

q_DownVolume

Returns a numeric expression representing the down volume for the current trading day.

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.

q_ExchangeListed

Returns a string expression representing the exchange under which the symbol is listed.

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.

q_ExpirationDate

Returns a numeric expression representing the EasyLanguage date of the expiration date for the symbol.  The expiration date is defined by the expiration rule chosen for the symbol.

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.

q_Headline

Returns a string expression containing the last headline transmitted by the datafeed for this symbol.

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.

q_HeadlineCount

Returns a numeric expression representing the number of headlines transmitted by the datafeed on the current day.

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.

q_High

Returns a numeric expression representing the highest price traded during the current trading day.

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.

q_Hour

Returns a numeric expression representing the hour of the last time any price field of this symbol was updated.

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.

q_Last

Returns a numeric expression representing the last traded price of the symbol.

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.

q_LastTradingDate

Returns a numeric expression representing the EasyLanguage date of the last trading date for the symbol.   The last trading date is defined by the expiration rule chosen for the symbol.

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.

q_Low

Returns a numeric expression representing the lowest price traded during the current trading session.

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.

q_Margin

Returns a numeric expression representing the margin for a future.

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.

q_Minute

Returns a numeric expression representing the minutes of the last time any price field of this symbol was updated.

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.

q_MinutesDelayed

Returns a numeric expression representing the number of minutes this symbol is delayed.

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.

q_Month

Returns a numeric expression representing the month of the last time any price field of the symbol was updated.

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.

q_NetAssetValue

Returns a numeric expression representing the net asset value for a mutual fund.

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.

q_NetChange

Returns a numeric expression representing the net change for the previous day's close to the current's day last price.

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.

q_NewsCount

Returns a numeric expression representing the number of headlines transmitted by the datafeed on the current day.

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.

q_NewsDay

Returns a numeric expression representing the EasyLanguage date of the last headline transmitted by the datafeed for the symbol.

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.

q_NewsTime

Returns a numeric expression representing the time of the last headline transmitted by the datafeed for the symbol.

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.

q_Open

Returns a numeric expression representing the opening price of the symbol.

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.

q_OptionType

Returns a numeric expression representing the option type.

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.

q_PreviousClose

Returns a numeric expression representing the close of the previous trading session.

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.

q_PreviousDate

Returns a numeric expression representing the EasyLanguage date of the previous trading session.

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.

q_PreviousHigh

Returns a numeric expression representing the highest traded price for the previous trading day.

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.

q_PreviousLow

Returns a numeric expression representing the lowest traded price for the previous trading day.

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.

q_PreviousOpen

Returns a numeric expression representing the opening price of the previous trading day.

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.

q_PreviousOpenInterest

Returns a numeric expression representing the open Interest of the previous trading day.

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.

q_PreviousTime

Returns a numeric expression representing the time of the previous trading day.

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.

q_StrikePrice

Returns a numeric expression representing the strike price of the an option.

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.

q_Time

Returns a numeric expression representing the EasyLanguage time of the last time the symbol was updated.

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.

q_TimeLastAsk

Returns a numeric expression representing the time of the last ask price.

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.

q_TimeLastBid

Returns a numeric expression representing the time of the last bid price.  

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.

q_TimeLastTrade

Returns a numeric expression representing the time of the last trade price.

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.

q_TotalVolume

Returns a numeric expression representing the total trade volume of the trading day.

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.

q_TradeVolume

Returns a numeric expression representing the trade volume of the last trade.

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.

q_UnchangedVolume

Returns a numeric expression representing the unchanged volume for the current trading day.

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.

q_UpVolume

Returns a numeric expression representing the up volume for the current trading day.

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.

q_Year

Returns a numeric expression representing the year of the last trade.

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.

q_Yield

Returns a numeric expression representing the yield of a bond.

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.

Quick_Ratio

Returns the Quick Ratio value.

Quick Ratio is calculated by (Cash + Short Term Investments + Accounts Receivable) / Total Current Liabilities.

R

Random

Returns a random number in the range between 0 and (Num).

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

Examples

Random(35) might return a value of 21.26.

Power(142.56) might return a value of 136.23.

RawAsk

Returns the raw ask value received from the data provider.

Example

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

         Alert("Very Low Ask");

RawBid

Returns the raw bid value received from the data provider.

Example

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

         Alert("Very Low Bid");

Red

Sets the plot color or background color to Red.

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

Examples

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

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

Repeat

This word has been reserved for future use.

Ret_On_Avg_Equity

Returns the Return on Average Equity.

Ret_On_Avg_Equity is calculated by income available to common stockholders divided by the Average Common Equity and is expressed as a percentage..

RevSize

Returns the Reversal size of a Point & Figure chart.

The Reversal size of a Point & Figure chart is defined by the user on the Format Symbol dialog, Settings tab.

Examples

RevSize returns 3 if the reversal size is set to 3.

RevSize returns 1 if the reversal size is set to 1.

Rho

Returns the Rho value of an option, leg, or position. The value of Rho can also be established in a Pricing Model by using Rho(Value).

Debit will positions will return positive numbers and credit positions will return negative numbers.

Examples

If Rho of Option > HighVal Then

         Alert("High Rho");

In a Pricing Model, you can set the value of Rho by using the following syntax:

Rho(0);

RightSide

Used to specify ActivityBar actions on the right side of the bar.

Example

GetCellChar(Close, Rightside, 3) Rightside is used to specify the right side of the ActivityBar.

RightStr

Reduces the specified string expression.

RightStr (Str1, sSize) ;

(Str1) is the string expression that you want to reduce. It must be enclosed in quotation marks.

(sSize) is the numeric expression indicating the number of characters, counting from the end of the string expression, that will be retained. Any additional characters are removed.

None

Example

RightStr("Net Profit", 6) returns the string expression “Profit”.

Round

Returns (Num) rounded to (Prec) decimal places.

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

(Prec) is a numeric expression representing the number of decimal places to keep.

Examples

Round(142.3215, 2) returns a value of 142.32.

Round(9.5687, 3) returns a value of of 9.569.

S

Saturday

Returns the number 6 as the value for Saturday.

The value returned is an integer representing Saturday and is the same value returned by using the function DayOfWeek(Saturday).

Example

Saturday returns a value of 6 as the value for Saturday.

Screen

This word has been reserved for future use.

Sell

Reserved word used to generate an order for a Short 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

Sell ("ShortEntry") 5 contracts this bar on close; generates an order to enter a short position of 5 contracts at the Close of the current bar.

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

Additional Example

Sell ("MyTrade") next bar at 75 Stop; generates an order to enter a short position on the next bar at a price of 75 or lower.

SeriesCount

Returns the number of series available in the option chain.

SeriesCount 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 = SeriesCount of Asset;

Sess1EndTime

Returns the ending time of the first trading session for the security. 

Sess1EndTime returns the time in 24-hour format.

Examples

Sess1EndTime returns 1500 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

Sess1EndTime returns 1615 when applied to IBM trading on the New York Stock Exchange.

Additional Example

You can check the last bar of the day on an intraday chart with:

IF Time = Sess1EndTime THEN

ExitLong this bar on Close;

Sess1FirstBarTime

Returns the time of the First bar generated during the first session of trading of the day.

Sess1FirstBarTime returns the time in 24-hour format.

Examples

Sess1FirstBarTime returns 1000 when applied to IBM data with a 30 minute compression.

Sess1FirstBarTime returns 0825 when applied to US Treasury Bond Data with a 5 minute compression.

Sess1StartTime

Returns the starting time of the first trading session of the security.

Sess1StartTime returns the time in 24-hour format.

Examples

Sess1StartTime returns 0820 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

Sess1StartTime returns 0930 when applied to IBM trading on the New York Stock Exchange.

Additional Example

You can check the first bar of the day on an intraday chart with:

IF Time = CalcTime(Sess1StartTime, BarInterval) THEN

ExitLong this bar on Close;

Sess2EndTime

Returns the ending time of the second trading session for a security. 

Sess2EndTime returns the time in 24-hour format.

Examples

Sess2EndTime returns 0745 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

Sess2EndTime returns 0915 when applied to the S&P 500 Futures trading on the Chicago Mercantile Exchange.

Additional Example

You can check the last bar of the session on an intraday chart with:

IF Time = Sess2EndTime THEN

ExitLong this bar on Close;

Sess2FirstBarTime

Returns the time of the First bar generated during the second session of trading of the day.

Sess2FirstBarTime returns the time in 24-hour format.

Examples

Sess2FirstBarTime returns 1715 when applied to S&P 500 Futures data with a 30 minute compression.

Sess2FirstBarTime returns 1535 when applied to US Treasury Bond Data with a 5 minute compression.

Sess2StartTime

Returns the starting time of the second trading session of the security.

Sess2StartTime returns the time in 24-hour format.

Examples

Sess2StartTime returns 1530 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

Sess2StartTime returns 1645 when applied to the S&P 500 Futures trading on the Chicago Mercantile Exchange.

Additional Example

You can check the first bar of the second session on an intraday chart with:

IF Time = CalcTime(Sess2StartTime, BarInterval) THEN

ExitLong this bar on Close;

SetBotBound

Sets the bottom boundary of a ProbabilityMap array.

(Price) is a numeric expression representing the desired price level on the chart.

(Price) must represent a constant value.

Example

If you wanted to set the variable, MapBottom, as the bottom boundry of the ProbabilityMap array, you could use the following syntax:

SetBotBound(MapBottom);

SetBreakEven

SetBreakEven sets a built-in breakeven stop.

(FloorAmnt) is a numeric expression that represents the floor, or minimum equity needed for the stop to become active.

Example

In order to place a breakeven stop once a position has made a $250 profit, you would write:

SetStopPosition;

SetBreakEven(250);

SetDollarTrailing

Used to place a dollar risk trailing stop.

SetDollarTrailing(DollarValue) ;

 (DollarValue) is a numeric expression representing the dollar amount that you are willing to risk per position or per contract/share. 

Example

To place a dollar risk trailing stop at $500 for the entire position, write:

SetStopPosition;

SetDollarTrailing(500);

As the price rises, so does the placement of the stop. It is maintained at a dollar value that results in a total of $500 loss for the entire position. 

SetExitOnClose

SetExitOnClose exits a position at the last bar of the day for intraday charts.

Example

In order to exit all positions at the end of the day, you would write:

SetExitOnClose;

SetPercentTrailing

Used to place a percent risk trailing stop.

SetPercentTrailing(FloorAmt, Percent) ;

 (FloorAmnt) is a numeric expression representing the floor, or minimum equity needed to activate the stop. You can use 0, in which case, the stop is activated regardless of equity achieved.

(Percent) is a numeric expression representing the percentage of the maximum equity needed to be lost to close the trade.

Example

In order to place a percentage based trailing stop that exits a position once it has returned 15% of the maximum equity earned after the position has made $500, you would write:

SetStopPosition;

SetPercentTrailing(500,15);

SetPlotBGColor

Sets the background color of the cell(s) to which a specified analysis technique is applied. 

(PlotNum) is a numeric expression representing a plot number.

(BGColor) corresponds to the numeric value or EasyLanguage reserved word corresponding to the background color you want to assign to a plot when applying an indicator to a grid.

SetPlotBGColor is only valid for indicators applied to grids.

Example

If you wanted to set the background color of the cell for Plot1 to white, you could use the following syntax:

SetPlotBGColor(1, White);

SetPlotColor

Sets the plot line color in a chart, or the foreground color of the cell(s) in a grid to which a specified analysis technique is applied. 

(PlotNum) is a numeric expression representing a plot number.

(FGColor) corresponds to the numeric value or EasyLanguage reserved word corresponding to the plot line in a chart, or the foreground color in a grid you want to assign to a plot when applying an indicator.

SetPlotColor is valid for indicators applied to both charts and grids.

Example

If you wanted to set the foreground color for Plot1 to blue, you could use the following syntax:

SetPlotColor(1, Blue);

SetPlotWidth

Sets the width of the specified plot line in a chart. 

(PlotNum) is a numeric expression representing a plot number.

(Width) is a numeric expression representing the plot’s width.

SetPlotWidth can only be used to change the width of plot lines in charts.

Example

If you wanted to set the width of Plot1 to 5, you could use the following syntax:

SetPlotWidth(1, 5);

SetProfitTarget

SetProfitTarget sets a built-in profit target stop.

(DollarValue) is a numeric expression representing the dollar value of the profit target.

Example

In order to exit a position once the price has returned $400, you would write:

SetStopContract;

SetProfitTarget(400);

SetPredictionValue

Returns the number of columns in a ProbabilityMap array.

(Column) is a numeric expression representing the desired column number for the prediction value.

(Price) is a numeric expression representing the desired price level from for the prediction value.

(Value) is a numeric expression representing the value of prediction value from 0 to 100.

Example

If you wanted to set the prediction value of the cell in column 5 with a price of  95.250 to 86.53 in the ProbabilityMap array, you could use the following syntax:

SetPredictionValue(5, 92.250, 86.53);

SetRowIncrement

Sets the row increment value in a ProbabilityMap array.

Example

If you wanted to set the variable, RowHeight, as the row increment value in the ProbabilityMap array, you could use the following syntax:

SetRowIncrement(RowHeight);

SetStopContract

Instructs TradeStation to evaluate all stop values of a strategy on a per contract basis.

If SetStopPosition and/or SetStopContract are used multiple times, even in different signals within a strategy, the last instance is used. Therefore, in the example below, Signal2 is ignored.

Signal1: SetStopPosition;

Signal2: SetStopContract;

Signal3: SetStopPosition;

Example

If you want to place a stop loss order of $500 per contract, you would write:

SetStopContract;

SetStopLoss(500);

SetStopLoss

Used to place a stop loss order (money management stop).

SetStopLoss(DollarValue) ;

 (DollarValue) is a numeric expression representing the dollar amount that must be incurred before the position or contract/share is liquidated.

Example

You are long 10 shares and the entry price is 52. To exit your long position when you’re down $2/per contract or share, write:

SetStopContract ;

SetStopLoss (2) ;

Additional Example

You are long 500 shares, and the entry price is 12. To exit your long position when you’re down $1000 for the entire position, write:

SetStopPosition ;

SetStopLoss(1000);

In this case, when the price reaches 10, you are exited from your long position (500 x $2 = 1000).

SetStopPosition

Instructs TradeStation to evaluate all stop values of a strategy on a per position basis.

If SetStopPosition and/or SetStopContract are used multiple times, even in different signals within a strategy, the last instance is used. Therefore, in the example below, Signal2 is ignored.

Signal1:  SetStopPosition;

Signal2: SetStopContract;

Signal3: SetStopPosition;

Example

If you want to place a stop loss order of $1200 for the entire position, you would write:

SetStopPosition;

SetStopLoss(1200);

SetTopBound

Sets the top boundary of a ProbabilityMap array.

(Price) is a numeric expression representing the desired price level on the chart.

(Price) must represent a constant value.

Example

If you wanted to set the variable, MapTop, as the top boundry of the ProbabilityMap array, you could use the following syntax:

SetTopBound(MapTop);

SGA_Exp_By_NetSales

Returns the total revenue divided by the number of outstanding share.

Share

Reserved word used to specify the number of units to trade within a trading strategy.

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

Examples

Buy 1 share next bar at market;

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

Sell 1 share next bar at market;

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

Additional Example

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

ExitLong 1 share total next bar at market;

Shares

Reserved word used to specify the number of units to trade within a trading strategy.

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

Examples

Buy 5 shares next bar at market;

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

Sell 5 shares next bar at market;

generates an order to sell five shares at the open of the next bar.

Additional Example

To exit from only 5 contracts from multiple long positions, write:

ExitLong 5 shares total next bar at market;

Sign

Returns an integer based on the sign on (Num). 1 is returned for a positive value, -1 is returned for a negative value, and 0 is returned for zero.

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

Examples

Sign(56.23) returns a value of 1.

Sign(-9.5687) returns a value of -1.

Sine

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

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

The sine is the trigonometric function that for an acute angle is the ratio between the leg opposite 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

Sine(45) returns a value of 0.7071.

Sine(72) returns a value of 0.9511.

Skip

This word has been reserved for future use.

Slippage

Returns the slippage setting in the applied strategy’s Costs tab.

This reserved word can only be used in the evaluation of strategies.

Example

Slippage returns a value of .50 if the slippage under the strategy’s Costs tab has been set to .5.

SnapFundExists

Returns True if snapshot fundamental data exists in the data stream, False otherwise.

Spaces

Adds the specified number of blank spaces into the line of commentary or text output.

Spaces (Cnt) ;

 (Cnt) is the numeric expression indicating the number of spaces to be inserted.

None

Example

Print("Close" + Spaces(5) + NumToStr(Close, 3));

The above example results in five blank spaces between the string “Close” and the closing price.

Square

Returns the square of the specified (Num).

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

The square is a number raised to the 2nd power.

Examples

Square(6.23) returns a value of 38.8219.

Square(-9.5687) returns a value of 91.5600.

SquareRoot

Returns the square root of the specified (Num).

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

The square root is the number that must be raised to the 2nd power in order to produce a given number, (Num).

(Num) must be a positive number or zero.

Examples

SquareRoot(6.23) returns a value of 2.4960.

SquareRoot(121) returns a value of 11.

StartDate

Reserved word used with GlobalServer Expiration rules.

StockSplit

Returns the ratio of the stock split reported during a certain period.

StockSplit (Num) ;

StockSplit does not require an input, it returns the most recently reported stock split ratio. However, by using an input, you can obtain the ratio of a stock split report other than the most recent.

Examples

StockSplit returns the last split ratio reported.

StockSplit(2)returns the split ratio reported 2 periods ago.

StockSplitCount

Returns the number of times that stock splits have been reported in the time frame considered.

StockSplitCount counts the number of times that stock splits have been reported during the time frame specified.

StockSplitDate

Returns the date on which a stock split was reported.

StockSplitDate (Num) ;

StockSplitDate does not require an input, it returns the date of the most recently reported stock split. However, by using an input, you can obtain the date of a stock split report other than the most recent.

Examples

StockSplitDate returns the date of the last reported stock split.

StockSplitDate(2) returns the date of the last reported stock split 2 periods ago.

StockSplitTime

Returns the time of the last stock split report.

StockSplitTime (Num) ;

StockSplitTime does not require an input, it returns the time for the most recently reported stock split. However, by using an input, you can obtain the time of a stock split report other than the most recent.

Examples

StockSplitTime returns the time of the last stock split report.

StockSplitTime(2)returns the time of the stock split report 2 periods ago.

Stop

Used in an entry or exit statement to specify how to fill an order.

Stop orders can only be executed on the next bar.

Stop can be read as “this price or worse”, meaning higher for a Long Entry and Short Exit, lower for a Short Entry and Long Exit.

Stop orders require a reference price.

Examples

Buy next bar at 75 Stop;

Generates an order to enter a long position on the next bar at a price of 75 or higher.

Sell next bar at 75 Stop;

Generates an order to enter a short position on the next bar at a price of 75 or lower.

Additional Example

ExitLong next bar at 75 Stop;

Generates an order to exit a long position on the next bar at a price of 75 or lower.

Strike

Returns the strike price of an option or position leg.

Example

If OptionType of Option = Call AND Close of Asset > Strike of Option then

    Plot1( "Call in-the-money", "Option" )

Else

    Plot1( "Call out-of-the-money","Option" );

StrikeCount

Returns the number of strikes available in the option chain.

StrikeCount 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 = StrikeCount of Asset;

StrikeITMCount

This word has been reserved for future use.

StrikeOTMCount

This word has been reserved for future use.

String

Reserved word used to define the type of input expected to be passed to a function.

The type of value returned by a function.

Examples

Input: MyMessage(String);

declares the constant MyMessage as a String value to be used in a function.

Input: NewMessage(String);

declares the constant NewMessage as a String value to be used in a function.

StringArray

StringArray declares a function input as a string array being passed by value.

A function input is declared as a string array when it is passing in a  string array by value.

Example

Input: PassedValues[n](StringArray);

indicates that a string array is being passed into the function by value through the Input PassedValues.

StringArrayRef

StringArrayRef declares a function input as a string array being passed by reference.

A function input is declared as a string array reference when it is passing in a string array by reference.

Example

Input: PassedValues[n](StringArrayRef) indicates that a string array is being passed into the function by reference through the Input PassedValues.

StringRef

StringRef declares a function input as a string being passed by reference.

A Function Input is declared as a string reference when it is passing in a string by reference.

Examples

PassedValue(stringRef) indicates that a string is being passed into the function by reference through the Input PassedValue.

StringSeries

Reserved word used to define the type of input expected to be passed to a function.

StringSeries is used for inputs that whose values can be referred to historically.

Examples

Input: MyMessage(StringSeries); declares the constant MyMessage as a String value to be used in a function, where historical values of MyMessage are available.

Input: NewMessage(StringSeries); declares the constant NewMessage as a String value to be used in a function, where historical values of NewMessage are available.

StringSimple

Reserved word used to define the type of input expected to be passed to a function.

StringSimple can not be used for inputs whose values can be referred to historically.

Examples

Input: MyMessage(StringSimple); declares the constant MyMessage as a String value to be used in a function, restricting MyMessage to be a value that does not contain historical values.

Input: NewMessage(StringSimple); declares the constant NewMessage as a String value to be used in a function, restricting NewMessage to be a value that does not contain historical values.

StrLen

Counts and returns number of characters in the specified string expression.

StrLen(Str) ;

 (Str) is the string expression to count. It must be enclosed in quotation marks.

None

Example

StrLen(“Net Profit”) returns the numeric expression 10 for the number of characters in the string.

StrToNum

Converts the specified string expression to a numeric value.

StrToNum (“Str”) ; 

(Str) is the string expression to convert to a numeric expression. It must be enclosed in quotation marks.

If any non-numeric characters are included in the string expression, zero (0) is returned. The only exception is when non-numeric characters are located at the end of the string expression, in which case, they are dropped from the numeric expression.

Example

StrToNum(“1170.50”) returns the numeric expression 1170.50.

SumList

Returns the sum 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.

Examples

SumList(45, 72, 86, 125, 47) returns a value of 375.

SumList(18, 67, 98, 24, 65, 19) returns a value of 291.

Sunday

Returns the number 0 as the value for Sunday.

The value returned is an integer representing Sunday and is the same value returned by using the function DayOfWeek(Sunday).

Example

Sunday returns a value of 0 as the value for Sunday.

SymbolName

Returns a string expression representing the symbol name.  See also GetSymbolName.

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.

SymbolNumber

Returns a numeric expression representing the symbol number defined in the GlobalServer symbol portfolio.   See also CommodityNumber and Cusip.

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.

SymbolRoot

Returns a string expression representing the root of the symbol (for futures and options only).

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.

T

T

Shortcut notation that returns the Time of a bar.

Anytime the Time of a bar is needed, the letter T can be used in an equivalent fashion.  T returns the time in 24-hour format.

Examples

T returns 1600 if the Time of the bar is 4:00pm.

T returns 0930 if the Time of the bar is 9:30am.

Additional Example

To check the Time of the previous bar write:

T of 1 bar ago

Tangent

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

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

The tangent the trigonometric function that for an acute angle is the ratio between the leg opposite to the angle when it is considered part of a right triangle and the leg adjacent, also equal to the sine divided by the cosine.

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

Examples

Tangent(45) returns a value of 1.0.

Tangent(72) returns a value of 3.0776.

Target

This word has been reserved for future use.

TargetType

This word has been reserved for future use.

Text

This word is retained for backward compatibility.

Text_Delete

Deletes the specified text object.

Text_Delete (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

If the text cannot be deleted, TX_Delete returns an error code. When the text is successfully deleted, it returns 0. For a list of error codes, see Trendline and Text Error Codes.

Example

The following deletes the text object with the identification number 3:

Text_Delete(3);

To obtain the error code (or 0 when no error) returned by the reserved word, you can assign the reserved word to a numeric variable, as follows:

Value1 = Text_Delete(3) ;

Text_GetColor

Returns the numeric value corresponding to the color of the specified text object.

Text_GetColor (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

For a list of possible colors and their corresponding numeric values, see EasyLanguage Colors.

When the reserved word performs its operation successfully, it returns the numeric value corresponding to the color. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the numeric color value returned by the reserved word, you need to assign the reserved word to a numeric variable. The text object with the identification number 1 is yellow. Therefore, the following returns the value 7.

Value1 = Text_GetColor(1) ;

Text_GetDate

Returns the date where the specified text object’s left edge begins in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and higher).

Text_GetDate (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the date is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the date returned by the reserved word, you need to assign the reserved word to a numeric variable. The text object with the identification number 1 begins on February 14, 1999. The following returns 990214.

Value1 = Text_GetDate(1) ;

Text_GetFirst

Returns the identification number of the first text object drawn in the chart.

Text_GetFirst (Pref) ;

…where (Pref) is a numeric expression representing the origin of the text object for which you want to obtain the identification number:

1 = text created by an analysis technique

2 = text created by the text drawing object only, and

3 = text created by either the text drawing object or an analysis technique

Note Using a value other than 1, 2 or 3 causes the reserved word to assume a value of 3.

When the reserved word performs its operation successfully, the identification number is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

You must assign the reserved word to a numeric variable to obtain the identification number (or error code) returned by the reserved word. The following returns the identification number of the first text object drawn on the chart, regardless of how it was drawn.

Value1 = Text_GetFirst(3) ;

Text_GetHStyle

Returns the horizontal alignment setting for the specified text object.

Text_GetHStyle (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

The horizontal alignment settings are 0 for Left, 1 for Right or 2 for Centered. These correspond to the three selections in the HAlign drop-down list in the Style tab of the Format Text dialog box.

When the reserved word performs its operation successfully, a horizontal alignment setting 0 through 2 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the horizontal alignment setting returned by the reserved word, you need to assign the reserved word to a numeric variable. When the text object with the identification number 1 is centered, the following returns a value of 2.

Value1 = Text_GetHStyle(1) ;

Text_GetNext

Returns the identification number of a text of specified origin created immediately after the specified text.

Text_GetNext (TX_Ref, Pref) ;   

 (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

 (Pref) is a numeric expression representing the origin of the text for which you want to obtain the identification number:

1 = text created by an analysis technique

2 = text created by the text drawing object only, and

3 = text created by either the text drawing object or an analysis technique

Note Using a value other than 1, 2 or 3 causes the reserved word to assume a value of 3.

When the reserved word performs its operation successfully, the identification number for the text is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the identification number returned by the reserved word, you need to assign the reserved word to a numeric variable. The following returns the identification number of the text drawn on the chart after the text with the identification number 0, and by the text drawing object.

Value1 = Text_GetNext(0, 2) ;

Text_GetString

Returns the string value of the specified text object.

Text_GetString (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the text string is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following returns the text string used by the text object with the identification number 1. In order to obtain the text string, you must assign the reserved word to a string variable, as follows:

TextString = Text_GetString(1) ;

Note EasyLanguage doesn’t provide pre-declared string variables so you will have to declare your own string variable in order to assign the reserved word to it.

Text_GetTime

Returns the time at which the specified text object is anchored (based on its horizontal and vertical alignment), in the format HHMM.

Text_GetTime (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the time at which the text object is anchored is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following returns 1300 when the text object with the identification number 1 is anchored at 1:00pm. To obtain the time returned by the reserved word, you need to assign the reserved word to a numeric variable.

Value1 = Text_GetTime(0) ;

Text_GetValue

Returns the vertical axis (price) value at which the text object is anchored (based on its horizontal and vertical alignment).

Text_GetValue (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the price value at which the text object is anchored is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following returns a value of 41.543 when the text object with the identification number 5 is anchored at a price value of 41.543. To obtain the price value returned by the reserved word, you need to assign the reserved word to a numeric variable.

Value1 = Text_GetValue(5) ;

Text_GetVStyle

Returns the vertical alignment setting for the specified text object.

Text_GetVStyle (TX_Ref) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

The vertical alignment settings are 0 for Top, 1 for Bottom or 2 for Centered. These correspond to the three selections in the VAlign drop-down list in the Style tab of the Format Text dialog box.

When the reserved word performs its operation successfully, a vertical alignment setting 0 through 2 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the vertical alignment setting returned by the reserved word, you need to assign the reserved word to a numeric variable. When the text object with the identification number 1 is centered, the following returns a value of 2.

Value1 = Text_GetVStyle(1) ;

Text_New

Creates a new text object in the specified location. You specify the location by providing a date, time, and price value as well as the string to add to the chart.

Text_New (cDate, tTime, nPrice, “Str1”) ;

 (cDate) is the date at which the text object will start, in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and later), or a numeric expression representing the start point date.

(tTime) is the time at which the text object will start, in HHMM format, or a numeric expression representing the start point time.

(nPrice) is the value for the start point of the text object, or a numeric expression representing the start point value.

 (Str1) is the string expression providing the text to write on the chart at the specified location. The text must be enclosed in quotation marks.

Drawing objects are numbered by type in the order they are created, from 0 to n. Therefore, 0 is the identification number of the first drawing object of that type created, and n is the last object of the same type created.

When the reserved word performs its operation successfully, the reserved word returns the identification number for the new text object. When the reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following would write the text Stock Split on the chart at the current date and time, at the high price plus 20 points. You must assign the reserved word to a numeric variable in order to obtain the identification number for the text object.

Value1 = Text_New(Date, Time, High + 20, "Stock Split");

Note By default, text objects are anchored using the left horizontal and top vertical alignment settings. You can change this and any other formatting setting using the other Text Drawing reserved words.

Text_SetColor

Sets the color for the specified text object.

Text_SetColor (TX_Ref, Clr) ;

 (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

(Clr) corresponds to the numeric value or EasyLanguage reserved word corresponding to the color of the text object. See EasyLanguage Colors for a list of valid colors.

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To set the text object with the identification number 1 to yellow, you would write either of the following:

Text_SetColor(1, 7);

Text_SetColor(1, Yellow);

To obtain the error code (or 0 when no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = Text_SetColor(1, 7);

Text_SetLocation

Moves the specified text object to the specified location.

Text_SetLocation (TX_Ref, cDate, tTime, nPrice) ;

 (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

(cDate) is a the date at which the text object will be anchored, in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and later), or a numeric expression representing the start point date.

(tTime) is the time at which the text object will be anchored, in HHMM format, or a numeric expression representing the start point time.

 (nPrice) is the vertical axis (price) level at which the text object will be anchored, or a numeric expression representing the start point value.

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following moves the text object with the identification number 2 to January 14, 1999, 3:00pm, at 150.

Text_SetLocation(2, 990114, 1500, 150.00) ;

To obtain the error code (or 0 when no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = Text_SetLocation(2, 990114, 1500, 150.00) ;

Text_SetString

Specifies the text string to use in the specified text object.

Text_SetString (TX_Ref, “Str1”) ;

…where (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

…where (Str1) is the text string to write on the chart. The text string must be enclosed in quotation marks.

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following is used to change the string in the text object with the identification number 1 to New String.

Text_SetString(1, "New String") ;

To obtain the error code (or 0 when no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = Text_SetString(1, "New String") ;

Text_SetStyle

Specifies the anchor position (horizontal and vertical alignment settings) for the specified text object.

Text_SetStyle (TX_Ref, Horiz, Vert) ;

 (TX_Ref) is the identification number of the text object, or a numeric expression representing the identification number.

(Horiz) is the horizontal alignment setting for the text object, 0 for Left, 1 for Right, and 2 for Centered, or a numeric expression representing the setting.

(Vert) is the vertical alignment setting for the text object, 0 for Top, 1 for Bottom, and 2 for Centered, or a numeric expression representing the setting.

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following changes the anchor position (horizontal and vertical alignment settings) of the text object with the identification number 1 to the left center of the text object.

Text_SetStyle(1, 0, 2);

To obtain the error code (or 0 when no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = Text_SetStyle(1, 0, 2);

Than

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 High > than the Highest(Close, 14) Then the word "than" is not necessary and the code functions the same way regardless of its presence.

The

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 High > than the Highest(Close, 14) Then the word "the" is not necessary and the code functions the same way regardless of its presence.

Then

This word is used to introduce a condition that will be evaluated to determine execution of additional code.

The second part of an If… Then or If… Then… Else statement. If… Then statements allow you to check a true/false condition, and then take a specific action depending on the outcome of the condition.  If the condition is true, the action after “Then” is executed.

Examples

If Condition1 Then

(Your Code Line1} Then is used here to designate the Line1 as the code that will be executed based on the outcom of Condition1.  The Line1 code will be executed if Condition1 returns a value of True.  If Condition1 is false, the Line1 code will not be executed.

If Condition1 And Condition2 Then

         Begin

         {Your Code Line1}

         {Your Code Line2, etc.}

         End

Else

                     Begin

                     {Your Code Line3}

                     {Your Code Line4, etc.}

                     End; Then is used here to designate the Line1 as the code that will be executed based on the outcom of Condition1.  The Line1 and Line2 code will be executed if Condition1 and Condition2 return a value of True.  If Condition1 or Condition2 is false, the Line3 and Line4 code will be executed.

TheoreticalGrossIn

Returns the amount required (or received) in order to establish a position at its theoretical value.

Debit positions will return positive numbers and credit positions will return negative numbers.

Example

Plot1(TheoreticalGrossIn of Position, "TGI" );

TheoreticalGrossOut

Returns the amount required (or received) in order to close a position at its theoretical value.

Positive numbers will represent the amount received when closing the position and negative numbers will represent the amound that must be paid to close the position.

Example

Plot1(TheoreticalGrossOut of Position, "TGO" );

TheoreticalValue

Returns the modeled value of an option or position leg.

Example

If TheoreticalValue of Option < Close of Option then

  Alert("Over Priced Option");

Theta

Returns the Theta value of an option, leg, or position. The value of Theta can also be established in a Pricing Model by using Theta(Value).

Debit positions will return positive numbers and credit positions will return negative numbers.

Examples

If Theta of Option > HighVal Then

         Alert("High Theta");

In a Pricing Model, you can set the value of Theta by using the following syntax:

Theta(0);

This

Reserved word used to refer to the present bar.

This is normally used with Bar or Day to specify the current Bar or Day.

Examples

Buy This Bar on Close refers to a Long Entry placed on the Close of the current bar

Sell This Bar on Close refers to a Short Entry placed on the Close of the current bar

Thursday

Returns the number 4 as the value for Thursday.

The value returned is an integer representing Thursday and is the same value returned by using the function DayOfWeek(Thursday).

Example

Thursday returns a value of 4 as the value for Thursday.

Ticks

Reserved word that represents multiple increments of the Price Scale.

Ticks is similar to Points and can be used interchangeably.

Examples

Close + 5 ticks returns the Close price plus five increments of the Price Scale added to it.

Low - 2 ticks returns the Low of the bar minus two increments of the Price Scale.

Additional Example

An exit statement can be written to prevent large losses by:

ExitLong This Bar at EntryPrice - 3 ticks Stop;

TickType

What kind of tick triggered the option core event: Asset, Option, Future, or Model.

Time

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

Time returns the time in 24-hour format.

Examples

Time returns 1600 if the Time of the bar is 4:00pm.

Time returns 0930 if the Time of the bar is 9:30am.

Additional Example

To check the Time of the previous bar write:

Time of 1 bar ago

TL_Delete

Deletes the specified trendline from the chart.

TL_Delete (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

If the trendline cannot be deleted, TL_Delete returns an error code. When the trendline is successfully deleted, it returns 0. For a list of error codes, see Trendline and Text Error Codes.

Example

The following deletes the trendline with the identification number 3:

TL_Delete(3);

To obtain the error code (or 0 when no error) returned by the reserved word, you can assign the reserved word to a numeric variable, as follows:

Value1 = TL_Delete(Value1) ;

TL_GetAlert

Returns the alert status of the specified trendline object. 0 = no alert, 1 = Breakout Intrabar, 2 = Breakout on Close.

TL_GetAlert (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number of the trendline.

When the reserved word performs its operation successfully, it returns a value of 0, 1 or 2, indicating the alert status. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the alert status returned by the reserved word, you need to assign the reserved word to a numeric variable

. The following obtains the alert status for the trendline with the identification number 2.

Value1 = TL_GetAlert(2) ;

TL_GetBeginDate

Returns the date on which the specified trendline begins, in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and higher).

TL_GetBeginDate (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, it returns the date. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the date returned by the reserved word, you need to assign the reserved word to a numeric variable. The trendline with the identification number 6 begins on January 14, 1999. The following will return 990114.

Value1 = TL_GetBeginDate(6) ;

TL_GetBeginTime

Returns the time at which the specified trendline begins (in 24-hour format, HHMM).

TL_GetBeginTime (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, it returns the time. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the time returned by the reserved word, you need to assign the reserved word to a numeric variable. The starting point for the trendline with the identification number 2 is at 1:00pm. The following will return 1300.

Value1 = TL_GetBeginTime(2) ;

TL_GetBeginVal

Returns the vertical axis (price) value at which the specified trendline begins.

TL_GetBeginVal (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, it returns the price value. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the price value returned by the reserved word, you need to assign the reserved word to a numeric variable

. The trendline with the identification number 5 begins at a price of 41.543. The following will return 41.543.

Value1 = TL_GetBeginVal(5) ;

TL_GetColor

Returns the numeric value corresponding to the color of the specified trendline.

TL_GetColor (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

For a list of possible colors and their corresponding numeric values, see EasyLanguage Colors.

When the reserved word performs its operation successfully, it returns the numeric value corresponding to the color. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the numeric color value returned by the reserved word, you need to assign the reserved word to a numeric variable. The trendline with the identification number 1 is yellow. Therefore, the following returns the value 7.

Value1 = TL_GetColor(1) ;

TL_GetEndDate

Returns the date on which the specified trendline ends in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and higher).

TL_GetEndDate (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the date is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the date returned by the reserved word, you need to assign the reserved word to a numeric variable. The trendline with the identification number 1 ends on February 14, 1999. The following returns 990214.

Value1 = TL_GetEndDate(1) ;

TL_GetEndTime

Returns the time at which the specified trendline ends (in 24-hour format, HHMM).

TL_GetEndTime (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the time is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the time returned by the reserved word, you need to assign the reserved word to a numeric variable. The trendline with the identification number 3 ends at 10:00am. The following returns 1000.

Value1 = TL_GetEndTime(3) ;

TL_GetEndVal

Returns the vertical axis (price) value of the end of the specified trendline object.

TL_GetEndVal (TL_Ref) ;

 

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the price value is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the price value returned by the reserved word, you need to assign the reserved word to a numeric variable

. The trendline with the identification number 4 ends at a price of 41.543. The following returns a value of 41.543.

Value1 = TL_GetEndVal(4) ;

TL_GetExtLeft

Returns a value of true when the specified trendline is extended to the left, and a value of false when it is not extended to the left.

TL_GetExtLeft (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the true or false value is returned, indicating whether or not the trendline is extended left. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the true/false value returned by the reserved word, you need to assign the reserved word to a true/false variable. The trendline with the identification number 12 is not extended to the left. The following returns the value false.

Condition1 = TL_GetExtLeft(12) ;

TL_GetExtRight

Returns a value of true when the specified trendline is extended to the right, and a value of false when it is not extended to the right.

TL_GetExtRight (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

When the reserved word performs its operation successfully, the true or false value is returned, indicating whether or not the trendline is extended right. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the true/false value returned by the reserved word, you need to assign the reserved word to a true/false variable. The trendline with the identification number 12 is extended to the right. The following returns the value true.

Condition1 = TL_GetExtRight(12) ;

TL_GetFirst

Returns the identification number of the first trendline inserted in a chart.

TL_GetFirst (Pref) ;      

…where (Pref) is a numeric expression representing the origin of the trendline for which you want to obtain the identification number:

1 = trendline created by an analysis technique

2 = trendline created by the trendline drawing object only, and

3 = trendline created by either the trendline drawing object or an analysis technique

Note Using a value other than 1, 2 or 3 causes the reserved word to assume a value of 3.

When the reserved word performs its operation successfully, the identification number is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

You must assign the reserved word to a numeric variable to obtain the identification number (or error code) returned by the reserved word. The following returns the identification number of the first trendline drawn on the chart, regardless of how it was rawn.

Value1 = TL_GetFirst(3) ;

TL_GetNext

Returns the identification number of a trendline of specified origin created immediately after the specified trendline.

TL_GetNext (TL_Ref, Pref) ;      

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

 (Pref) is a numeric expression representing the origin of the trendline for which you want to obtain the identification number:

1 = trendline created by an analysis technique

2 = trendline created by the trendline drawing object only, and

3 = trendline created by either the trendline drawing object or an analysis technique

Note Using a value other than 1, 2 or 3 causes the reserved word to assume a value of 3.

When the reserved word performs its operation successfully, the identification number for the trendline is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the identification number returned by the reserved word, you need to assign the reserved word to a numeric variable. The following returns the identification number of the trendline drawn on the chart after the trendline with the identification number 0, and by the trendline drawing object.

Value1 = TL_GetNext(0, 2) ;

TL_GetSize

Returns the line thickness setting (weight) for the specified trendline.

TL_GetSize (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

Line thickness ranges from 0 (thinnest) to 6 (thickest). These correspond to the seven selections in the Weight drop-down list in the Style tab of the Format Trendline dialog box.

When the reserved word performs its operation successfully, a line thickness setting 0 through 6 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the line thickness value returned by the reserved word, you need to assign the reserved word to a numeric variable. When the trendline with the identification number 1 is drawn with the third heaviest weight. The following returns a value of 2.

Value1 = TL_GetSize(1) ;

L_GetStyle

Returns the line style setting for the specified trendline.

TL_GetStyle (TL_Ref) ;

…where (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

There are 5 possible line styles:

Style Name           Number

Tool_Solid       1 (solid)

Tool_Dashed    2 (dashed)

Tool_Dotted    3 (dotted)

Tool_Dashed2  4 (dashed pattern)

Tool_Dashed3  5 (dashed pattern)

These correspond to the five selections in the Style drop-down list in the Style tab of the Format Trendline dialog box.

When the reserved word performs its operation successfully, it returns the number corresponding to the line style setting. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the line style value returned by the reserved word, you need to assign the reserved word to a numeric variable. The trendline with the identification number 1 is drawn using a solid line style. The following returns 1.

Value1 = TL_GetStyle(1) ;

TL_GetValue

Returns the vertical axis (price) value of the specified trendline at the specific date and time.

TL_GetValue (TL_Ref, cDate, tTime) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

(cDate) is the date for which you want the value of the trendline, in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and later).

(tTime) is the time at which you want the value of the trendline (in 24-hour format, HHMM).

When the reserved word performs its operation successfully, the vertical axis (price) value is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To obtain the price value returned by the reserved word, you need to assign the reserved word to a numeric variable

. On January 7, 1999 at 4:00pm, the trendline with the identification number 5 intersects the price value of 53.350. The following returns 53.350.

Value1 = TL_GetValue(5, 990107, 1600) ;

TL_New

Creates a new trendline with the specified start and end points. To identify the start and end points, you provide the date, time and value for both.

TL_New (sDate, sTime, sVal, eDate, eTime, eVal) ;

 (sDate) is the date for the start point of the trendline, in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and later), or a numeric expression representing the start point date.

(sTime) is the time for the start point of the trendline (in 24-hour format, HHMM), or a numeric expression representing the start point time.

 (sVal) is the value for the start point of the trendline, or a numeric expression representing the start point value.

 (eDate) is the date for the end point of the trendline, in YYMMDD or YYYMMDD format (three digits are used to express the year 2000 and later), or a numeric expression representing the end point date.

 (eTime) is the time for the end point of the trendline (in 24-hour format, HHMM), or a numeric expression representing the end point time.

 (eVal) is the value of the end point of the trendline, or a numeric expression representing the end point value.

Drawing objects are numbered by type in the order they are created, from 0 to n. Therefore, 0 is the identification number of the first drawing object of that type created, and n is the last object of the same type created.

When the reserved word performs its operation successfully, the reserved word returns the identification number for the new trendline. When the reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following creates a trendline that begins a 9:30am on January 7, 1999 at a value of 45, and ends at 4:00pm on January 25, 1999 at a value of 37.250:

Value1 = TL_New(990107, 0930, 45, 990125, 1600, 37.250) ;

You must assign the reserved word to a numeric variable in order to obtain the identification number for the trendline.

TL_SetAlert

Sets the alert status for the specified trendline.

TL_SetAlert (TL_Ref, alertVal)  ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

 (alertVal) is the alert setting for the trendline:

0 = no alert

1 = Breakout Intrabar alert, and

2 = Breakout on Close alert

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following sets the alert of the trendline with the identification number 1 to Breakout Intrabar:

TL_SetAlert(1, 1);

To obtain the error code (or 0 when no error) returned by the reserved word, you can assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetAlert(1, 1);

TL_SetBegin

Sets the beginning of the specified trendline.

TL_SetBegin (TL_Ref, sDate, sTime, sVal) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

(sDate) is the starting date for the trendline (in YYMMDD or YYYMMDD format).

(sTime) is the starting time for the trendline (in 24-hour format, HHMM).

(sVal) is the starting value for the trendline.

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following sets the trendline with the identification number 4 to a value of 107.225 on February 21, 1999 at 10am.

TL_SetBegin(4, 990221, 1015, 107.225);

To obtain the error code (or 0 when no error) returned by the reserved word, you can assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetBegin(4, 990221, 1015, 107.225);

TL_SetColor

Sets the color for the specified trendline.

TL_SetColor (TL_Ref, Clr) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

(Clr) corresponds to the numeric value or EasyLanguage reserved word corresponding to the color of the trendline. See EasyLanguage Colors for a list of valid colors.

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

To set the color of the trendline with the identification number 1 to yellow, you would write either of the following:

TL_SetColor(1, 7);

TL_SetColor(1, Yellow);

To obtain the error code (or 0 when no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetColor(1, 7);

TL_SetEnd

Sets the end point of the specified trendline object based on the specified parameters.

TL_SetEnd (TL_Ref, eDate, eTime, eVal) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

(eDate) is the ending date of the trendline (in YYMMDD or YYYMMDD format).

(eTime) is the ending time of the trendline (in 24-hour format, HHMM).

(eVal) is the ending value of the trendline.

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following sets the end point of the first trendline created in a chart to a value of 207.125 on February 21, 1999 at 3:15pm.

TL_SetEnd(0, 990221, 1515, 207.125);

To obtain the error code (or 0 for no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetEnd(0, 990221, 1515, 207.125);

TL_SetExtLeft

Specifies whether or not to extend left the specified trendline.

TL_SetExtLeft (TL_Ref, tfExt) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

 (tfExt) specifies the extend status of the trendline:

True = extend left

False = do not extend left

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following turns off the extend left status of the second trendline created in a chart (i.e., the trendline will not extend left):

TL_SetExtLeft(1, False);

To obtain the error code (or 0 for no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetExtLeft(1, False);

TL_SetExtRight

Specifies whether or not to extend right the specified trendline.

TL_SetExtRight (TL_Ref, tfExt) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

 (tfExt) specifies the extend status of the trendline:

True = extend right

False = do not extend right

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following turns on the extend right status of the second trendline created in a chart (i.e., the trendline will extend right):

TL_SetExtRight(1, True);

To obtain the true/false value returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetExtRight(1, True);

TL_SetSize

Sets the width (line thickness) setting for the specified trendline object.

TL_SetSize (TL_Ref, Size) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

(Size) is the thickness value for the trendline.

Thickness widths range from 0 (the thinnest) to 6 (the thickest).

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following sets the size of the fifth trendline created in a chart to the fourth thickest width: 

TL_SetSize(4, 3) ;

To obtain the error code (or 0 when no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetSize(4, 3) ;

TL_SetStyle

Sets the line style setting for the specified trendline.

TL_SetStyle (TL_Ref, Style) ;

 (TL_Ref) is the identification number of the trendline, or a numeric expression representing the identification number.

(Style) is the line style setting for the trendline.

There are 5 possible line styles:

Style Name           Number

Tool_Solid       1 (solid)

Tool_Dashed    2 (dashed)

Tool_Dotted    3 (dotted)

Tool_Dashed2  4 (dashed pattern)

Tool_Dashed3  5 (dashed pattern)

When the reserved word performs its operation successfully, a 0 is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see Trendline and Text Error Codes.

Example

The following sets the line style of the fifth trendline created in a chart to Tool_Dotted (dotted):

TL_SetStyle(4, 3) ;

To obtain the error code (or 0 when no error) returned by the reserved word, you need to assign the reserved word to a numeric variable, as follows:

Value1 = TL_SetStyle(4, 3);

To

This word is used as a part of a For statement where the execution values will be increasing to a finishing value.

To will always be placed between two arithmetic expressions.

Examples

For Value5 = Length To Length + 10 Begin

         {Your Code Here}

End; To is used here to indicate that for each value of Value5 from Length to Length plus 10, the following Begin… End loop will be executed.

Variables: Sum(0), Counter(0);

Sum = 0;

For Counter = 0 To Length - 1 Begin

         Sum = Sum + Price[Counter];

End; To is used here to accumulate the variable Sum for each value of Counter from 0 to Length minus one.

Today

This word is retained for backward compatibility. Today is used to reference the most current bar, even when analyzing intra-day bars.  Today is no longer necessary as the following are equivalent:

Value1 = Close of Today;

Value1 = Close;

Tool_Black

This word is retained for backward compatibility.

Tomorrow references the next bar, even when analyzing intra-day bars.

Tomorrow is no longer necessary as the following are equivalent:

Buy at Open Tomorrow + Range Stop;

                                 Buy at Open Next Bar + Range Stop;

                                 Buy at Open[-1] + Range Stop;

Tool_Blue

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word Blue.

Tool_Cyan

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word Cyan.

Tool_DarkBlue

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkBlue.

Tool_DarkBrown

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkBrown.

Tool_DarkCyan

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkCyan.

Tool_DarkGray

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkGray.

Tool_DarkGreen

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkGreen.

Tool_DarkMagenta

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkMagenta.

Tool_DarkRed

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkRed.

Tool_DarkYellow

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word DarkYellow.

Tool_Dashed

Line style used for trendlines.

There are 5 line styles available for use in charting:

 

Style Name           Number

Tool_Solid       1 (solid)

Tool_Dashed    2 (dashed)

Tool_Dotted    3 (dotted)

Tool_Dashed2  4 (dashed pattern)

Tool_Dashed3  5 (dashed pattern)

Tool_Dashed2

Line style used for trendlines.

There are 5 line styles available for use in charting:

Style Name           Number

Tool_Solid       1 (solid)

Tool_Dashed    2 (dashed)

Tool_Dotted    3 (dotted)

Tool_Dashed2  4 (dashed pattern)

Tool_Dashed3  5 (dashed pattern)

Tool_Dashed3

Line style used for trendlines.

There are 5 line styles available for use in charting:

Style Name           Number

Tool_Solid       1 (solid)

Tool_Dashed    2 (dashed)

Tool_Dotted    3 (dotted)

Tool_Dashed2  4 (dashed pattern)

Tool_Dashed3  5 (dashed pattern)

Tool_Dotted

Line style used for trendlines.

There are 5 line styles available for use in charting:

Style Name           Number

Tool_Solid       1 (solid)

Tool_Dashed    2 (dashed)

Tool_Dotted    3 (dotted)

Tool_Dashed2  4 (dashed pattern)

Tool_Dashed3  5 (dashed pattern)

Tool_Green

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word Green.

Tool_LightGray

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word LightGray.

Tool_Magenta

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word Magenta.

Tool_Red

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word Red.

Tool_Solid

Line style used for trendlines.

There are 5 line styles available for use in charting:

Style Name           Number

Tool_Solid       1 (solid)

Tool_Dashed    2 (dashed)

Tool_Dotted    3 (dotted)

Tool_Dashed2  4 (dashed pattern)

Tool_Dashed3  5 (dashed pattern)

Tool_White

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word White.

Tool_Yellow

This word is retained for backward compatibility.

This word has been replaced by the Reserved Word Yellow.

Total

Reserved word used in an Exit statement to specify the number of contracts to exit from a Long or Short entry.

Specifying the number of contracts to exit from a position is not required in an Exit Statement.

Total is exclusively used in an Exit condition to specify the number of contracts to exit.

Examples

ExitShort 1 contract total next bar at market; generates an order to exit only one contract from a short position on the first price of the next bar.

ExitLong 1 contract total next bar at market; generates an order to exit only one contract from a long position on the first price of the next bar.

Additional Example

ExitLong 5 contracts total next bar at market; generates an order to exit only five contracts from a long position on the first price of the next bar.

TotalBarsLosTrades

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

Examples

TotalBarsLosTrade returns 73 if the number of bars elapsed during 4 losing trades were 40, 23, 6 and 4.

TotalBarsLosTrade returns 10 if the number of bars elapsed during 2 losing trades were 7, and 3.

TotalBarsWinTrades

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

Examples

TotalBarsWinTrade returns 73 if the number of bars elapsed during 4 winning trades were 40, 23, 6 and 4.

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

TotalTrades

Returns the total number of closed trades.

Examples

TotalTrades returns 7 if the number of closed trades is 7.

TotalTrades returns 5 if the number of closed trades is 5.

TrailingStopAmt

This word is retained for backward compatibility.

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

TrailingStopFloor

This word is retained for backward compatibility.

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

TrailingStopPct

This word is retained for backward compatibility.

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

True

This word is used as the value for an input or valid condition.

True can only be used in easy language as the value for a True/False input.

True is the value returned by a correct or valid condtition such as, 0 > 1.

Examples

Input:Test(True); would set the value of an input “Test” to a default value of True.

If 50 < 100 Then would result in a value of True and the statement following Then would be executed.

TrueFalse

Reserved word used to define the type of input expected to be passed to a function.

The type of value returned by a function.

TrueFalse can be used for inputs that can be either TrueFalseSimple or TrueFalseSeries.

Examples

Input: Switch(TrueFalse); declares the constant Switch as a TrueFalse value to be used in a function.

Input: Flag(TrueFalse); declares the constant Flag as a TrueFalse value to be used in a function.

TrueFalseArray

TrueFalseArray declares a function input as a true/false array being passed by value.

A Function Input is declared as a True/False array when it is passing in a TrueFalse array by value.

Example

Input: PassedValues[n](TrueFalseArray) indicates that a True/False array is being passed into the function by value through the Input PassedValues.

TrueFalseArrayRef

TrueFalseArrayRef declares a function input as a true/false array being passed by reference.

A Function Input is declared as a TrueFalse array reference when it is passing in a True/False array by reference.

Examples

PassedValues[n](TrueFalseArrayRef) indicates that a True/False array is being passed into the function by reference through the Input PassedValues.

TrueFalseRef

TrueFalseRef declares a function input as a True/False value being passed by reference.

A function Input is declared as a TrueFalse reference when it is passing in a value by reference.

Examples

PassedValue(TrueFalseRef) indicates that a True/False value is being passed into the function by reference through the Input PassedValue.

TrueFalseSeries

Reserved word used to define the type of input expected to be passed to a function.

TrueFalseSeries is used for inputs that whose values can be referred to historically.

Examples

Input: Switch(TrueFalseSeries); declares the constant Switch as a TrueFalse value to be used in a function, where historical values of Switch are available.

Input: Flag(TrueFalseSeries); declares the constant Flag as a TrueFalse value to be used in a function, where historical values of Flag are available.

TrueFalseSimple

Reserved word used to define the type of input expected to be passed to a function.

NumericSimple can not be used for inputs whose values can be referred to historically.

Examples

Input: Switch(TrueFalseSimple); declares the constant Switch as a TrueFalse value to be used in a function, restricting Switch to be a value that does not contain historical values.

Input: Flag(TrueFalseSimple); declares the constant Flag as a TrueFalse value to be used in a function, restricting Flag to be a value that does not contain historical values.

TtlDbt_By_NetAssts

Returns the total debt divided by total assets.

Tuesday

Returns the number 2 as the value for Tuesday.

The value returned is an integer representing Tuesday and is the same value returned by using the function DayOfWeek(Tuesday).

Example

Tuesday returns a value of 2 as the value for Tuesday.

U

Under

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 under, or becomes less than another value.  A value (Value1) crosses under another value (Value2) whenever Value1 is less than Value2 in the current bar but Value 1 was equal to or greater than Value 2 in the previous bar.

Under is a synonym for Below.

Examples

If Average(Close, 9) Crosses Under the Average(Close, 18) Then …

Under is used here to determine the direction of the cross of the values two moving averages on the bar under consideration.

If Value1 Crosses Under Value2 Then …

Under is used here to determine the direction of the cross of the variables Value1 and Value2 on the bar under consideration.

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 under, or becomes less than another value.  A value (Value1) crosses under another value (Value2) whenever Value1 is less than Value2 in the current bar but Value 1 was equal to or greater than Value 2 in the previous bar.

Under is a synonym for Below.

Examples

If Average(Close, 9) Crosses Under the Average(Close, 18) Then ….

Under is used here to determine the direction of the cross of the values two moving averages on the bar under consideration.

If Value1 Crosses Under Value2 Then Under is used here to determine the direction of the cross of the variables Value1 and Value2 on the bar under consideration.

UnionSess1EndTime

Returns the latest time of all the first session end times when a technique is applied to more than one data set.

UnionSess1EndTime returns the time in 24-hour format.

UnionSess1EndTime is normally used when a technique is applied to more than one data set (i.e. multi-data chart).

Examples

UnionSess1EndTime returns 1500 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

UnionSess1EndTime returns 1615 when applied to IBM trading on the New York Stock Exchange.

UnionSess1FirstBar

Returns the time of the earliest First bar generated during the first session of trading of the day.

UnionSess1FirstBarTime returns the time in 24-hour format.

UnionSess1FirstBarTime is normally used when a technique is applied to more than one data set (i.e. multi-data chart).

Examples

UnionSess1FirstBarTime returns 1000 when applied to IBM data with a 30 minute compression.

UnionSess1FirstBarTime returns 0825 when applied to US Treasury Bond Data with a 5 minute compression.

UnionSess1StartTime

Returns the earliest starting time of the first trading session when a technique is applied to more than one data set.

UnionSess1StartTime returns the time in 24-hour format.

UnionSess1StartTime is normally used when a technique is applied to more than one data set (i.e., multi-data chart).

Examples

UnionSess1StartTime returns 0820 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

UnionSess1StartTime returns 0930 when applied to IBM trading on the New York Stock Exchange.

UnionSess2EndTime

Returns the latest time of all the second session end times when a technique is applied to more than one data set.

UnionSess2EndTime returns the time in 24-hour format.

UnionSess2EndTime is normally used when a technique is applied to more than one data set (i.e. multi-data chart).

Examples

UnionSess2EndTime returns 0745 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

UnionSess2EndTime returns 0915 when applied to the S&P 500 Futures trading on the Chicago Mercantile Exchange.

UnionSess2FirstBar

Returns the time of the earliest First bar generated during the first session of trading of the day.

UnionSess2FirstBar returns the time in 24-hour format.

UnionSess2FirstBar is normally used when a technique is applied to more than one data set (i.e. multi-data chart).

Examples

UnionSess2FirstBar returns 1715 when applied to S&P 500 Futures data with a 30 minute compression.

UnionSess2FirstBar returns 1535 when applied to US Treasury Bond Data with a 5 minute compression.

UnionSess2StartTime

Returns the earliest starting time of the first trading session when a technique is applied to more than one data set.

UnionSess2StartTime returns the time in 24-hour format.

UnionSess2StartTime is normally used when a technique is applied to more than one data set (i.e. multi-data chart).

Examples

UnionSess2StartTime returns 1530 when applied to the US Treasury Bonds trading on the Chicago Board of Trade.

UnionSess2StartTime returns 1645 when applied to the S&P 500 Futures trading on the Chicago Mercantile Exchange.

Units

This word is retained for backward compatibility.

UNSIGNED

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.

Until

This word is reserved for future use.

UpperStr

Used to convert a string expression to uppercase letters.

UpperStr (“Str”) ;

(Str) the string expression to change to uppercase letters. Make sure the string expression is enclosed in quotation marks.

Example

UpperStr("sunny”) returns the string expression “SUNNY”.

UpTicks

Returns the number of ticks on a bar whose value is higher than the tick immediately preceding it.

Returns the Up volume of a bar when Trade Volume is used for the chart.

Examples

UpTicks returns 5 if there were 5 ticks on a bar whose value was higher than the tick immediately preceding it.

UpTicks returns 12 if there were 12 ticks on a bar whose value was higher than the tick immediately preceding it.

Additional Example

To check if a bar of data appears to reflect a steady upturn, compare UpTicks to DownTicks:

Value1 = Upticks - DownTicks;

V

V

Shortcut notation that returns the Volume of a bar.

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

Examples

V of 1 bar ago returns the Volume of the previous bar.

Average(V, 10) returns the Average of the last 10 Volume prices.

Additional Example

To check that the last two bars have Volume prices lower than the previous bar write:

If V < V[1] and V[1] < V[2] then Plot1(High,"Falling");

Variable(s) or Var(s)

Reserved word used to declare multiple variable names to be used in a technique.

A variable name can contain up to 20 alphanumeric characters plus the period ( . ) and the underscore ( _ ).

A variable name can not start with a number or a period ( . ).

The default value of a variable is declared by a number in parenthesis after the input name.

Examples

Variables: Countup(0), Countdown(10);

declares the variables Countup and Countdown and initializes their values to zero and ten, respectively.

Variables: MADiff(0), XMADiff(0);

declares the variables MADiff and XMADiff, initializing the values of both to zero.

VARSIZE

Reserved for use with custom DLLs designed for EasyLanguage.

VARSTARTADDR

Reserved for use with custom DLLs designed for EasyLanguage.

Vega

Returns the Vega value of an option, leg, or position. The value of Vega can also be established in a Pricing Model by using Vega(Value).

Debit will positions will return positive numbers and credit positions will return negative numbers.

Examples

If Vega of Option > HighVal Then

           Alert("High Vega");

In a Pricing Model, you can set the value of Vega by using the following syntax:

Vega(0);

VOID

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.

Volume

Reserved word used to return the Volume of the specified time increment or group of ticks.

V can be used in place of Volume.

Examples

Volume of 1 bar ago returns the Volume of the previous bar.

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

Additional Example

To check that the last two bars have Volume prices lower than the previous bar write:

If Volume < Volume[1] and Volume[1] < Volume[2] then Plot1(High,"Falling");

W

Was

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 Close was < than the Lowest(Close, 14) Then…

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

Wednesday

Returns the number 3 as the value for Wednesday .

The value returned is an integer representing Wednesday  and is the same value returned by using the function DayOfWeek(Wednesday ).

Example

Wednesday

…returns a value of 3 as the value for Wednesday.

While

This word initiates a While loop statement.

A While loop statement defines a set of instructions that are executed until a true/false expression returns false.  The number of iterations the While loop performs depends on the value returned by the true/false expression following While.

Example

While Condition1 Begin

           {Your Code Here};

End;

While is used here to initiate the code contained in the Begin… End section until Condition1 returns a value of False.  If Condition1 is false, the While loop is not executed.

White

Sets the plot color or background color to White.

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

Examples

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

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

WORD

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.

X

 

Y

Year

Returns the corresponding year for the specified calendar date. (1998 = 98, 2001 = 101)

(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

Year(990613) returns a value of 99 because 990613 represents June 13, 1999.

Year(1011220) returns a value of 101 because 1011220 represents December 20, 2001.

Yellow

Sets the plot color or background color to Yellow.

There are 16 colors available in EasyLanguage. For more information, see Appendix B: Styles.

Examples

Plot1(Value1, “Test", Yellow)

plots Value1 with the name Test, and sets the color of Plot1 to Yellow.

TL_SetColor(1, Yellow)

sets the color of a TrendLine with a reference number of 1 to Yellow.

Yesterday

This word is retained for backward compatibility.

Yesterday references the previous bar, even when analyzing intra-day bars.

Yesterday is no longer necessary as the following are equivalent:

Value1 = Close of Yesterday;

Value1 = Close of 1 Bar Ago;

Value1 = Close[1];

 

Z

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

 

ZigZag

xx

Hit Counter