How to create an Auto TrendLines Indicator for TradeStation and MultiCharts


In this tutorial, you’ll create an Auto TrendLines Indicator to automatically draw TrendLines in TradeStation and MultiCharts using EasyLanguage and PowerLanguage,

Firstly, we calculate the maximum and the minimum of the last X candles or days.

This is only an example, you can create your trendline indicator simply replacing the HighestHigh and LowestLow value.

In EasyLanguage is possible to determine the Min-Max with two functions:

HighestHigh = Highest(High,BackHigh);
LowestLow = Lowest(Low,BackLow);

Drawing TrendLines by hand could be a boring activity. With TradeStation, you can create a Trendline Indicator that automated the process.

TLID = TL_New(StartDate, StartTime, StartValue, EndDate, EndTime, EndValue);

TLID is a variable that contains the TrendLine ID. This is a unique identifier and is useful if you will draw many trendlines in your chart.

TL_New is a reserved word that uses six parameters to draw a new trendline.

Inputs:
BackHigh (20),
BackLow (20);

Vars:
TL_HIGH(1),
TL_LOW(2),
HighestHigh(0),
LowestLow(0);

HighestHigh = Highest(High,BackHigh);
LowestLow = Lowest(Low,BackLow);

If lastbaronchart or lastbaronchartEX then

Begin
TL_HIGH = TL_New(Date[BackHigh], Time[BackHigh], HighestHigh, Date, Time, HighestHigh);

TL_LOW = TL_New(Date[BackHigh], Time[BackHigh], LowestLow, Date, Time, LowestLow);

End;
01-Trendlines-TradeStation-Multicharts

TrendLine Indicator Tradestation

Very simple! Do you like to personalize the TrendLines?

You can choose the color, the size, and the style.

TradeStation EasyLanguage TrendLine Indicator Code:

Inputs:
BackHigh (20), 
BackLow  (20),
TL_HIGH_COLOR(DarkGreen),
TL_LOW_COLOR(DarkRed),
TL_HIGH_SIZE(2),
TL_LOW_SIZE(2),
TL_HIGH_STYLE(2),
TL_LOW_STYLE(2);



Vars:
TL_HIGH(1),
TL_LOW(2),
HighestHigh(0),
LowestLow(0),
TimeStorage(0);

HighestHigh = Highest(High,BackHigh);
LowestLow = Lowest(Low,BackLow);



If lastbaronchart or lastbaronchartEX then



Begin

TL_HIGH = TL_New(Date[BackHigh], Time[BackHigh], HighestHigh, Date, Time, HighestHigh);
		  TL_SetColor(TL_HIGH,TL_HIGH_COLOR);
		  TL_SetSize(TL_HIGH,TL_HIGH_SIZE);
		  TL_SetStyle(TL_HIGH,TL_HIGH_STYLE);


TL_LOW = TL_New(Date[BackHigh], Time[BackHigh], LowestLow, Date, Time, LowestLow);
         TL_SetColor(TL_LOW,TL_LOW_COLOR);
		 TL_SetSize(TL_LOW,TL_LOW_SIZE);
		 TL_SetStyle(TL_LOW,TL_LOW_STYLE);
End;


01-EasyLanguage-Trendlines-TradeStation-Multicharts

With the TradeStation TrendLine Indicator in Easyanguage you have to refresh the chart (Ctrl+R) when you want to redraw the trendlines.

Resources:

INVESTOPEDIA

Auto TrendLine Indicator Indicator Download

DOWNLOAD BUTTON

More from Finance Strategy System

ATR CALCULATOR for STOP LOSS INDICATOR

Bollinger Bands Indicator Volatility Breakout and Squeeze

SMOOTHING RSI INDICATOR with EMA

Market Correlation | Stock Market – Bond – Commodities

BOLLINGER BANDS – BANDWIDTH

NAAIM Exposure Index || What is and How Use It

The VIX Essential Tutorial || S&P500 Implied Volatility Index

Breakout and Pullback in Technical Analysis

Parabolic SAR Indicator – Technical Analysis Tutorial

Gold Trading Strategy with Stochastic Indicator

Recent Posts