A library of trading indicators, strategies and code snippets for Pine Script programming language.
The template file layout an trend following trading system. [1] [2]
- Trend Following - An indicator that identify trend's direction, most likely an moving average.
- Trend Confirmation - Most trend following indicator are prone to whipsaw, so you what to confirm the movement with something like an momentum indicator.
- Entry/Exit - Now that you have an trend directional bias you may want to find an optimal entry/exit strategy this is where overbought/oversold indicator come in handy.
- Stop-Loss and Profit-Taking - We need to determine an method to take profit on a winning trade and an loss on an losing trade. [3]
- Position Sizing - To control risk and maximize gains we must determine what size of a position we are willing to risk. [4]
[1] https://www.babypips.com/learn/forex/design-your-trading-system
[2] https://www.investopedia.com/articles/forex/10/indicators-fx-traders-must-know.asp
[3] I provided an method using bollinger bands with an stop loss and three profit-taking price levels. Each time an tp level is hit you will reduce your position and move the stop-loss to the old price level.
[4] I use the formula: Position Size = Risk Amount / Distance to Stop Loss. https://medium.com/@cryptocreddy/comprehensive-guide-to-position-size-and-leverage-2e27764ce9e0
- Trend Following - Moving Average.
- Trend Confirmation - Waddah Attar Explosion.
- Entry/Exit - Fisher Transform.
[1] If you wish to see re-entry results increase the Trades Count setting.
A rewrite of Logical_Strat_Template_v0.2
@author MrhutQC, Ozine
@thanks DarkRico, FurryBoffin
- Trend Following - Higher Timeframe Moving Average.
- Trend Confirmation - Waddah Attar Explosion.
- Entry/Exit - Fisher Transform, Godmode Oscillator. https://www.tradingview.com/script/HL3vqXUM-Godmode-Oscillator-fresh-bread-generator-free-to-use/
- Trend Following - 2 Higher Timeframe Moving Average. [2]
- Trend Confirmation - 2 Lower Timeframe Moving Average. [2]
- Entry/Exit - Entry: 2 Moving Average, Connors RSI, Stochastic %K & %D and Bollinger BandWidth Exit: MACD and RSI
- Stop-Loss and Profit-Taking - Fix Percentage, ATR Percentage
[1] Strategy mainly use for backtesting setting for ProfitTrailer bot.
[2] Use for turning on the bot.
- Trend Following - A Moving Average.
- Trend Confirmation - Parabolic SAR
- Entry/Exit - None
- Stop-Loss and Profit-Taking - ATR
- Position Sizing - None
- Trend Following - Parabolic SAR.
- Trend Confirmation - WaveTrend Oscillator.
- Entry/Exit - IFish TCI Indicator
- Stop-Loss and Profit-Taking - None
- Position Sizing - None
- Trend Following - Percentage Difference of Moving Average and Source, IFish TCI. [1]
- Trend Confirmation - WaveTrend Oscillator
- Entry/Exit - Sigma Accumulate
- Stop-Loss and Profit-Taking - None
- Position Sizing - None
[1] IFish TCI has static moving average (zlema) due to error: Script has too many local scopes.
Fisher Transform with an changeable EMA alpha https://www.mesasoftware.com/papers/UsingTheFisherTransform.pdf
A rewrite of Godmode Oscillator https://www.tradingview.com/script/HL3vqXUM-Godmode-Oscillator-fresh-bread-generator-free-to-use/
@author LazyBear, xSilas, Ni6HTH4wK
TCI indicator presumed if the position of an close within a candlestick provides information on whether the uptrend is gaining or losing power.
A rewrite of Trend Confirmation Index http://www.fxcodebase.com/code/viewtopic.php?f=38&t=61051
@author Mario Jemic
A rewrite of WaveTrend Oscillator. https://www.tradingview.com/script/2KE8wTuF-Indicator-WaveTrend-Oscillator-WT/
@author LazyBear
Price Cross - When price cross the slow ma Two Cross - When fast ma cross the slow ma Tri Cross - When fast ma cross mid, slow ma
Inspire by Action Locator indicator https://www.tradingview.com/script/4DvAvqYu-ACTION-Locator-v2-0/
Show the different of fast/slow sigma (stdev) with money flow index. Blue bar - fast above slow Grey bar - fast under slow
An inverse fisher transformation of TCI indicator http://www.fxcodebase.com/code/viewtopic.php?f=38&t=61051
- alma - Arnaud Legoux Moving Average
- cvwma - Coefficient of Variation Weighted Moving Average https://www.tradingview.com/script/0dBtJvhu-Stratus-DW/
- dema - Double Exponential Moving Average
- donchian - Donchian Middle Channel
- ecema - Error Corrected EMA http://www.mesasoftware.com/papers/ZeroLag.pdf
- ema - Exponential Moving Average
- frama - Fractal Adaptive Moving Average http://www.mesasoftware.com/papers/FRAMA.pdf
- hull - Hull Moving Average
- jma - Jurik Moving Average https://www.tradingview.com/script/nZuBWW9j-Jurik-Moving-Average/
- kama - Kaufman Adaptive Moving Average
- lsma - Least Square Moving Average
- mcginley - McGinley Dynamic
- modframa - Modified Fractal Adaptive Moving Average http://etfhq.com/blog/2010/09/30/fractal-adaptive-moving-average-frama/#Mod
- rma - Running Moving Average https://en.wikipedia.org/wiki/Moving_average#Modified_moving_average
- sma - Simple Moving Average
- smma - Smoothed Moving Average
- supersmoother - SuperSmoother Filter http://www.mesasoftware.com/papers/PredictiveIndicatorsForEffectiveTrading%20Strategies.pdf
- tema - Triple Exponential Moving Average
- vama - Volatility Adjusted Moving Average https://www.tradingview.com/script/ZHGCH1jf-Volatility-Adjusted-Moving-Average-JD/
- vidya - Variable Index Dynamic Average https://www.tradingview.com/script/hdrf0fXV-Variable-Index-Dynamic-Average-VIDYA/
- vwma - Volume-Weighted Moving Average
- wma - Weighted Moving Average
- zlema - Zero Lag Exponential Moving Average https://www.fmlabs.com/reference/default.htm?url=ZeroLagExpMA.htm
[1] TradingView will slow down when their is a long chain of if/else statement, so have to split MA function.
- bollinger - Bollinger Bands
- keltner - Keltner Channels
- atr - Average True Range
- donchian - Bollinger Bands
- chandelier - Chandelier Exit
- adx - Average Directional Movement Index
- adxr - Average Directional Movement Index Rating
- apo - Absolute Price Oscillator
- aroonosc - Aroon Oscillator
- asi - Accumulative Swing Index https://library.tradingtechnologies.com/trade/chrt-ti-accumulative-swing-index.html
- bop - Balance Of Power
- cci - Commodity Channel Index
- cmo - Chande Momentum Oscillator
- crsi - Connors RSI https://www.tradingmarkets.com/media/2012/ConnorsRSI-Pullbacks-Guidebook.pdf [1]
- dx - Directional Movement Index
- imi - Intraday Momentum Index
- mfi - Money Flow Index
- ppo - Percentage Price Oscillator
- roc - Rate of change
- rsi - Relative Strength Index
- stoch - Stochastic K https://www.freestockcharts.com/help/Content/Indicators/Stochastics.htm [2]
- stochrsi - Stochastic Relative Strength Index [2]
- ultosc - Ultimate Oscillator
- willr - Williams %R
[1] Use PercentRank instead of ROC describe in ConnorsRSI Guidebook.
[2] Return K not %K: %K = sma(K, pk_len) %D = sma(%K, pd_len)
You may copy and/or modified this project source code on the condition that you released under the same license and keep copyright notice when distributing this project source code. TradingView template default header are license under Mozilla Public License 2.0
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © YOUR NAME
See CONTRIBUTING.md file.
If you like any of the project code consider donating.
BTC: 32LxoJWQvUJbZsJY2ZBqopoCCELigfzFy3
ETH: 0x9a0661d3FE5110a40685bdF9F329eF1f159F2482
XTZ: tz1PBFLc4PeQnkjneXKjS8o7rWNK5zNaLjGa
BNB: bnb1mtxsz94u4xvj5z5ste6t2n9y50fg0w4vy7u0v4
This project is licensed under the Mozilla Public License 2.0.
USE THE SOFTWARE AT YOUR OWN RISK. YOU ARE RESPONSIBLE FOR YOUR OWN MONEY. ALL TRADING INVOLVES HIGH RISK AND YOU CAN LOSE A SUBSTANTIAL AMOUNT OF MONEY, NO MATTER WHAT METHOD YOU USE. THE AUTHOR HAS NO RESPONSIBILITY FOR YOUR TRADING RESULTS. YOU SHOULD ALWAYS UNDERSTAND THAT PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.