REV0LUTI0N

Supertrend Strategy

REV0LUTI0N Mis à jour   
This Supertrend strategy will allow you to enter a long or short from a supertrend trend change. Both ATR period and ATR multiplier are adjustable. If you check off "Change ATR Calculation Method" it will base the calculation off the sma and give you slightly different results, which may work better depending on the asset. Be sure to enter slippage and commission into the properties to give you realistic results.

I've also built in backtesting date ranges and the ability to trade only within certain times of day and have it close all trades at the end of that time frame. This is especially useful for day trading stocks. If you check off "Enter First Trade ASAP" then when using the time frame option it will enter the current trade. If however you uncheck that box and instead check off "Wait To Enter First Trade" it will wait for the trend to change and then enter.

You can also specify a % based take profit and stop loss. In most cases the stop loss is not needed because of the atr based stop that supertrend provides so you could check only take profit and see if it works best to take profit or to let supertrend trend change get you out. Also keep in mind that if you have "Enter First Trade ASAP" checked off and use the stop loss and/or take profit then it will re-enter the current trend again.

Finally there's custom alert fields so you can send custom alert messages for strategy entry and exit for use with automated trading services. Simply enter your messages in the fields within the strategy properties and then put {{strategy.order.alert_message}} in your alert message body and it will dynamically pull in the appropriate message.
Notes de version:
Added an EMA filter. To use this you must check off the "Enter First Trade ASAP" button so it will enter as soon as both the supertrend and ema conditions are met. Also uncheck "No EMA filter" and check off "Use EMA Filter".
Notes de version:
Fixed start/end backtesting date.
Notes de version:
Added the ability to exit trades in a different time frame than you enter trades. This is useful if you wanted to say enter trades only 0930-1030 but then hold the last trades until later and set the exit trades time from to 0930-1530. Then you would check off "Enable Close Trade At End Of Exit Time Frame" and it will close the last trade you enter at 1530.
Notes de version:
Added CMF filter so you can select a CMF length and have it only enter a long if CMF is above zero and only enter a short if CMF is below zero. Also adding headlines in the properties to make the indicator more user friendly.
Notes de version:
Added the ability to turn supertrend off. This is useful for situations where you want to use the other features of the indicator like ema and cmf and not supertrend. I also added the ability to choose the time frame for the EMA and CMF filters.
Notes de version:
New updates are the ability to use contrarian signals. This is useful for some assets where it proves easier to find losing settings. Simply uncheck "Trade Regular Signals" and check "Trade Contrarian Signals" and the strategy will automatically reverse the signals for you! Please note there's a separate take profit and stop loss section for contrarian since this needed its own area to work properly. Finally I added a note section at the top since in some cases you may have multiple copies of the strategy on one chart and need a quick note to differentiate something like what time frame that copy is for.
Notes de version:
Removed the multiple time frame selection from the ema and cmf filters since I discovered they do not perform the same live as in the back testing. I also made it so the one stop loss and take profit section works for both regular or contrarian trading.
Notes de version:
Added price source to the ema filter. This allows you to select the source of the price that is compared to the ema to determine if price is over or under the ema. I also added a source for the cmf filter.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?