Saturday, January 18, 2014

Supertrend Setup for Ninjatrader

Hello everyone !

Most of you may already know the Supertrend Indicator, it has been available for most platforms including Ninjatrader.
There are several versions, some of them free and including different calculation modes.
It is basically a trend detection systems very useful also for trailing stop management purposes.
On the following chart we can see the trend changes indicated by arrows when the line is calculated with the default settings ; an HMA(14) and a multiplier of 2.618

and on the following chart, the HMA is changed by the Median ;

Using an SMA :

Same SMA, but changing the multiplier from 2.618 to 1

As we can see, this is a very flexible and powerful indicator to define trend and reversals.
If we are in the Market, the indicator can be used to keep the trailing stop slightly below its line.
If we are looking for an Entry, once a trend change is detected ( red and blue arrows are painted ) we have several options :
  • Enter at Market
  • Wait for a pullback with a Limit Order Entry
If we decide to use the pullback entry option, then we need to define How to Calculate the Entry.

A suggested approach is using same line study used for the supertrend but with a slower period.
Lets review the SMA example where the supertrend is calculated with an SMA(8) and a multiplier of 2.618.
Now we add an SMA(17) ( dotted line ) and we have a complete trade setup :
Once we have a trend change ( arrow ) we place a limit order at the SMA.
On the following chart we can see a short at red dotted line and then a long at blue dotted line.
Entry time bars are marked with vertical lines :

Another example with HMA : supertrend with HMA(10) and Entry with HMA(50)

How to Manage the Trade

It is evident that this system will get the best results on impulsive and trending markets when we use runners.
When holding a position and using a trailing stop, at some time the trend will lose impulse and there will be a reversal.
For example, on the following Chart we can see a long filled after 4 or 5 bars of the arrow up :
If our trailing stop is big enough to survive all the way up and then we get a red arrow down we have several options ;
  • Close the long after a red down arrow is painted
  • Leave the position alone being managed by its trailing stop
  • Reverse the Long Position at New Short Entry ( red dots ) assuming the long trailing stop is not triggered.
On The Indicator Store we have a Custom TIS_Supertrend Indicator with all the User defined settings to define the Trend and also a user defined Entry as shown on previous Chart.

If you like the Supertrend possible Setups using the rules explained, it can be automated by Markers ; a Semi Automatic and also Full Automatic System that trades all possible trade setups described. 
It has the option of Early Exit; in case we are holding a position, and an inverse arrow ( trend change ) is painted we can decide if closing actual position or not.
If we decide not using early exit, then the current position will be exited at trailing stop or reversed at new entry.

Let me know if you have any question or suggestion...
Best Regards,
Pablo