[Trendycator] Trendycator Strategy L/S

Trendycator Aggiornato   
This script is different from Trendycator Strategy because of long/short trades possibility.

This script proposes a simple and intuitive trend following strategy, better usage on those assets which are sufficiently liquid and don't go through random spikes.

This strategy is based on Trendycator Indicator.

Since it is a trend-following system, it works well during trends only and his intent is to find a primary trend and ride it for as long as possible.
We know that the biggest problem is how to understand if asset is in trend or not: for this purpose, the intuitive colors explained hereafter help Traders to understand when asset is in non trend.
It will never enter on the minimum and will never exit on the maximum but will always try to identify the central part of the trend, maintaining the position until the forces supporting the rise of the stock fail.

Usage details

Color interpretation
  • Green color mean that asset is in a UP Trend.
  • Red color mean that asset is in a Down Trend.
  • Gray color mean that indicator is not able to find any clear trend.

Trendycator use stochastic oscillator, which establish the trend and his strength.
As additional filter as noise removal the stochastic oscillator is smoothened using simple moving average.
Trendycator use as well price swing recognition which identify significant high and significant low breakouts.
When stochastic find trend with strength and significant breakout change color: green for up trend and red for down trend.
This mix of trend-following indicator and breakout system is made to avoid, as much as possible, false signal generated from side movement.

Add Strategy to a chart

This strategy works on any instrument but, you have to pay attention to some simple things when you apply the script: you have to properly set the size of trade.

Considering that the strategy include target and stop you must set at minimum 2 contracts (that is default) to make it works properly.
-If you use this strategy on Index, Futures, Forex you need to use “contracts”.
-If you use this strategy on Stock, you need to use “Eur”, or your local currency; in this way, Tradingview will do for you the calculation and buy the exact number of stock for the money you input. For example you can set 10.000 eur of order.

Strategy order explanation
Note: this strategy is designed to work either long and short.
-Entry order
The entry order is placed on Buy_Stop on High of the first bar when the Trendycator become green.
This High is a trigger level.
-Exit order
During trade strategy will try to sell 50% of the position in target (green line), and other 50% using dynamic trail stop (purple line).
*Trail stop is a percentage of instrument volatility calculated with ATR
Is included a fix percentage safety stop (red line): by default set to -10% from entry.

See below example

Important methodology note

This code will reverse long the position in case of open position is short but do not reverse short in case of open trade is long.

Displayed chart
In the lower right corner is displayed a chart that summarize for traders the important strategy information: Target price, Stop, Trailing Stop, last asset close, Percentage of gain of last operation.
Percentage of gain is calculated by this part of code: PercGain := (close / lastEntryPrice - 1) * 100

Strategy Settings

-Activate-Deactivate Target/Stop: with this input you can activate, or deactivate, the target and the static protection stop at -10%.
The strategy can work as well without it, simply entry on green and exit on red signal with add of trail stop.
Normally we prefer use the target as well, for this reason by default is activated.

-Target: you can set the target as percentage from entry level, eg. 10 mean 10% (this work only if activated).
-Protection Stop Fix: you can set the main stop as percentage from entry level, eg. 10 mean 10% (this work only if activated).
-Dynamic Volatility Stop: you can set the Trailing Stop as percentage of volatility calculated with ATR (this cannot be deactivated).
-Target Short: you can set the target as percentage from entry level Short, eg. 10 mean 10% (this work only if activated).
-Protection Stop Fix Short: you can set the main stop as percentage from entry Short level, eg. 10 mean 10% (this work only if activated).
-Dynamic Volatility Stop Short: you can set the Trailing Stop Short as percentage of volatility calculated with ATR (this cannot be deactivated).
-Trendycator (core of this system) usually doesn’t need to set anything.
This because we believe that the user have to searching for the charts where it works well and never "overfitting" the system on a chart.
Overfitting never work as a long time and in the first step for loosing money.
In Tradingview we decide to let the possibilities to set two specific parameters: "Period_UP" and "Period_DN".
The reason is because this can be adjusted slightly for testing in intraday, but we recommend to manipulate as less as possible.
Period UP/DN meaning: Period_UP are the number of bars considered for swing high detection and Period_DN is the number of bar that Trendycator use for swing low detection.

Important usage note
  • Trendycator was born and tested in weekly timeframe and works in daily as well. Intraday charts, normally have high volatility that is the opposite of trend; weekly, or daily bars reduce the noise.
  • Trendycator is tested, and used, in Etf and stocks.
  • Trendycator is tested, and used, for long operation only.
  • Trendycator is not tested in different timeframe from what explained above, or chart type different from bars (eg. Renko or Heikin Ashi).
  • Trendycator is not tested in instrument different from what listed above: like future or Forex.
  • Trendycator is not tested for short operation. Normally short have very strong movement in less time that is different from trend following concept.

Entry/Exit recommended filters
Investor and traders are free to use and interpretate Trendycator as they feel more confortable but, we recommend to apply some filters on entry and exit.
As you can see in example, we use a trigger for enter in position (not plotted by this indicator).
The high of first green bar is the trigger level for entry: the long position will be in Buy Stop above this level.
The low of first red bar is the trigger level for exit: the long position will be exit in Stop after this level.
Use this trigger criteria is useful to avoid, once more, the false signal.
*This strategy is including all above recommendations.

Bank charges and slippage
Showed result are only an example and we do not guarantee same results in future.
This result was obtained considering 3 Eur per order as Bank fee, which is in line with the major global online brokers.
We do not consider, in this example, any slippage because, as said before, we neve use and we never tested in future.
We think that when you invest in weekly or daily timeframe in trade that can last for months, few Eur or Dollar of slippage may intentionally not be considered.


Trendycator do not provide any guarantees regarding your ability to obtain results or earn money with our ideas, information, tools or strategies.
Nothing on our content makes any promise or guarantee of future results or earnings.
You alone are responsible for your decisions, actions and results in life, and using our code you agree that you will not attempt to hold us responsible for your decisions, actions or results, at any time, under any circumstances.
Note di rilascio:
Final version with graphic Gain indication
Note di rilascio:
Hided debug
Note di rilascio:
Chart Updated
Script su invito

L'accesso a questo script è riservato agli utenti autorizzati dall'autore, solitamente dietro pagamento di una commissione. Puoi aggiungerlo ai preferiti, ma sarai in grado di utilizzarlo solo una volta ricevuto il via libera da parte dell'autore. Per maggiori informazioni, puoi controllare le istruzioni qui sotto o contattare direttamente Trendycator.

Tieni a mente che questo è uno script su invito che non è stato sottoposto al controllo dei nostri moderatori, pertanto non è sicuro che rispetti il Regolamento. TradingView sconsiglia di acquistare la licenza per usare uno script fino a che non si ha fiducia al 100% nei confronti del venditore. In molti casi, esistono alternative gratuite ed open-source nella nostra Libreria pubblica.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Istruzioni dell'autore

Solo su invito su

Vuoi usare questo script sui tuoi grafici?

Avvertenza: leggi prima di richiedere l'accesso.