Skip to content

Tutorial 173 | Markplex SuperTrend

Tutorial173-2

Tutorial 173 | SuperTrend indicator is a stop and reverse (SAR) indicator that trails price action. This implementation calculates the Average True Range (ATR) of the average price using the exponential moving average. A user input multiple of the ATR is added to or subtracted from the average price to give Upper and Lwr
respectively, depending on the direction. Direction is determined by the Close of a bar relative to the value of the SuperTrend, Upper and Lwr using the following code:

If C > SupTrend then 
Begin
Dir = 1;
PlotColor = Yellow;
//Print( " C > ST c ",c," SupTrend ", SupTrend," ",BarColor);
End
else if C < SupTrend then
Begin
Dir = -1;
PlotColor = Red;
// Print( "C <= ST "," ",BarColor );
End;

When the direction is up (Dir = 1), the SupTrend value can only increase. When the dirction is down, the SupTrend can only decrease.

There are many different interpretations of the so-called SuperTrend indicator. In this Markplex version the SuperTrend value is also tightened (i.e. moved closer to price) by using an acceleration factor which increases incrementally each bar by user input: AFStep up to a a maximum value of user input: MaxAF.

The indicator works best in trending markets but gets ‘whipsawed’ in other markets.

Tutorial173-1
Tutorial 173 can be used with TradeStation OR with MultiCharts.
See a video walk through of tutorial 173.

Download the tutorial 173 TradeStation EasyLanguage indicator

If you want to save yourself some typing,  the tutorial 173 code is available for immediate download for $19.95 by clicking the following button. You can pay using PayPal or credit card. The program works with TradeStation 9.5 and 10. 

The download consists of _Tutorial173 (the TradeStation EasyLanguage indicator developed in the tutorial).

See tutorial 43 which demonstrates how to import an ELD into TradeStation.

Using tutorial 173 with RadarScreen

The above video demonstrates how to set up Tutorial 173 (Markplex SuperTrend) in TradeStation RadarScreen. This involves making sure that “load additional data for accumulative calculations” is selected and an appropriate number of bars is entered.

“Load additional data” is required for calculations that use the value of the calculation the previous bar to give the value for the current bar. Tutorial 173 uses the exponential moving average as part of its calculation. If you open TradeStation’s XAverage function, you will see the calculation includes:

XAverage = XAverage[1] + SmoothingFactor * ( Price - XAverage[1] );

In other words, the exponential moving average for the current bar is equal to the exponential moving average for the previous bar plus the difference between the price of the current bar and the exponential moving average of the previous bar multiplied by a smoothing factor.

TradeStation recommend that the number of additional bars is equal to 4.5 multiplied by the Length input. In this video I estimated this to be 50.

See https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-5-indicator-works-fine-chart-not-radarscreen/

Link
A workspace showing tutorial 173 applied to a chart and to RadarScreen
A workspace showing tutorial 173 applied to a chart and to RadarScreen

THE TRADING APPS, INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES.

TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.

ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, TRADING APPS, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.