TradeStation EasyLanguage Code

I use TradeStation and have written some functions, indicators, strategies, ect. Below is a list of my EasyLanguage creations and links so you can download and import them into your TradeStation.

I use Tradestation Version 6.401.00.0578, the code works on this version, but I don't know if it will on other/older versions.

Name Type Description
All All All of the code for easy mass import.



BodyHigh Function Returns the HIGH of candlestick body.
BodyLow Function Returns the LOW of candlestick body.
CandleBody Function Returns the height of a candlestick body.
DarkCloudCover Function Returns TRUE if Dark-cloud cover has formed.
A Dark-cloud cover is a two candlestick pattern that is a top reversal after an uptrend or, at times, at the top of a congestion band. The first bar of the two candlestick pattern has a strong white real body. The second bar's price OPENS above the prior sessions HIGH. By the end of the second session, the bar closes near the LOW. Second session closes within the prior bar's white body. The greater degree of penetration into the white real body, the more likely a top will occur. Some Japanese Technicians require more than a 50% penetration.
Doji Function Returns TRUE if a Doji has formed. A Doji occurs when the OPEN and CLOSE for that session are the same, or very close.
DownBar Function Returns TRUE if the candlestick is a down bar. A down bar is when the CLOSE < OPEN.
EngulfingPattern Function Returns TRUE if an Engulfing Pattern has formed.
An Engulfing Pattern is a major reversal signal with two opposite color real bodies composing the pattern. There are three criteria for an engulfing pattern
  1. The market has to be in a clearly definable uptrend or downtrend, even if the trend is short term.
  2. Two candlesticks comprise the engulfing pattern. The second real body must engulf the prior real body (it need not engulf the shadows.)
  3. The second real body of the engulfing pattern should be the opposite color of the first real body. (The exception to this rule is if the first real body of the engulfing pattern is a doji).
Hammer Function Returns TRUE if Hammer has formed.
A Hammer is a Bullish Reversal Pattern. The Hammer can be recognized by three criteria:
  1. The real body is at the lower end of the trading range. The color of the real body is not important.
  2. A long lower shadow should be twice the height of the real body.
  3. It should have no, or a very short, upper shadow.
HangingMan Function Returns TRUE if Hanging Man has formed.
A Hanging Man is a Bearish Reversal Pattern. The Hanging Man can be recognized by three criteria:
  1. The real body is at the upper end of the trading range.
  2. A long lower shadow should be twice the height of the real body.
  3. It should have no, or a very short, upper shadow.
InTradingRange Function This function provides an easy way to determine if a price is within a specified percentage of a trading range. Essentially, the user provides the size of the trading (number of bars to check) range and the percent that the price should be within the range. The function then finds the extremes of the range, and determines if the price is within the specified percentage of the requested extreme.
LowerShadow Function Returns the length of the lower shadow.
ScreenPixel Function This function is designed to return a vertical pixel location representing the pixel location of the Price if charted on the screen. This function is interesting to use in an indicator with two Data streams.
ShavenBottom Function Returns true if the current bar is a shaven bottom. A shaven bottom is a bar that has no LowerShadow.
ShavenHead Function Returns true if the current bar is a shaven head. A shaven head is when a bar that has no UpperShadow.
UpBar Function Returns TRUE if the candlestick is an up bar. An up bar is when the CLOSE > OPEN.
UpperShadow Function Returns the length of the upper shadow.

Last Updated: September 1, 2002