MA+MA+ is a multi time frame moving average indicator with more than a dozen different moving averages (like KAMA, VAMA, JMA, HMA and much more).
More moving averages will be added on every update, hence Follow me to get notified.
MA+ Supports automatic (AUTO in settings) time frame multiplier. For example, if you set 'Auto Resolution Multiplier' to 6, and your base chart is 5 minutes, the moving averages will plot at 5 * 6 = 30 minutes.
You can still use 'User Defined' to use your own time frame without using the multiplier.
Use higher time frame than the base chart time frame to avoid repainting.
Default multiplier for higher time frame is 2.
Supports Signals 1 (rising MA) or -1 (falling MA) to attach to another indicator.
Bars are not colored by default.
Just for this great community, You can request in the comments other moving averages that do not exists in MA+.
JMA
Jsa Moving Average [CC]The Jsa Moving Average was created by George R. Arrington, Ph .D. (Stocks & Commodities V. 11:10 (427-431)) and it is an extremely simple formula but has very many great uses. For one thing it acts as support and resistance levels and it also acts like a trailing stop. It gives a wide enough berth during extended up or down trends to let you ride the wave up or down and when it gets close to the price it means that it is a choppy market. Buy when the indicator line is green and sell when it turns red.
Let me know if you would like to see me publish other indicators or if you want something custom done!
Note: I'm republishing this because the original script couldn't be found in searches so this will fix that.
888 BOT #backtest█ 888 BOT #backtest
This is an Expert Advisor 'EA' or Automated trading script for ‘longs’ and ‘shorts’, which uses only a Take Profit or, in the worst case, a Stop Loss to close the trade.
It's a much improved version of the previous ‘Repanocha’. It doesn`t use 'Trailing Stop' or 'security()' functions (although using a security function doesn`t mean that the script repaints) and all signals are confirmed, therefore the script doesn`t repaint in alert mode and is accurate in backtest mode.
Apart from the previous indicators, some more and other functions have been added for Stop-Loss, re-entry and leverage.
It uses 8 indicators, (many of you already know what they are, but in case there is someone new), these are the following:
1. Jurik Moving Average
It's a moving average created by Mark Jurik for professionals which eliminates the 'lag' or delay of the signal. It's better than other moving averages like EMA, DEMA, AMA or T3.
There are two ways to decrease noise using JMA. Increasing the 'LENGTH' parameter will cause JMA to move more slowly and therefore reduce noise at the expense of adding 'lag'
The 'JMA LENGTH', 'PHASE' and 'POWER' parameters offer a way to select the optimal balance between 'lag' and over boost.
Green: Bullish, Red: Bearish.
2. Range filter
Created by Donovan Wall, its function is to filter or eliminate noise and to better determine the price trend in the short term.
First, a uniform average price range 'SAMPLING PERIOD' is calculated for the filter base and multiplied by a specific quantity 'RANGE MULTIPLIER'.
The filter is then calculated by adjusting price movements that do not exceed the specified range.
Finally, the target ranges are plotted to show the prices that will trigger the filter movement.
Green: Bullish, Red: Bearish.
3. Average Directional Index (ADX Classic) and (ADX Masanakamura)
It's an indicator designed by Welles Wilder to measure the strength and direction of the market trend. The price movement is strong when the ADX has a positive slope and is above a certain minimum level 'ADX THRESHOLD' and for a given period 'ADX LENGTH'.
The green color of the bars indicates that the trend is bullish and that the ADX is above the level established by the threshold.
The red color of the bars indicates that the trend is down and that the ADX is above the threshold level.
The orange color of the bars indicates that the price is not strong and will surely lateralize.
You can choose between the classic option and the one created by a certain 'Masanakamura'. The main difference between the two is that in the first it uses RMA () and in the second SMA () in its calculation.
4. Parabolic SAR
This indicator, also created by Welles Wilder, places points that help define a trend. The Parabolic SAR can follow the price above or below, the peculiarity that it offers is that when the price touches the indicator, it jumps to the other side of the price (if the Parabolic SAR was below the price it jumps up and vice versa) to a distance predetermined by the indicator. At this time the indicator continues to follow the price, reducing the distance with each candle until it is finally touched again by the price and the process starts again. This procedure explains the name of the indicator: the Parabolic SAR follows the price generating a characteristic parabolic shape, when the price touches it, stops and turns (SAR is the acronym for 'stop and reverse'), giving rise to a new cycle. When the points are below the price, the trend is up, while the points above the price indicate a downward trend.
5. RSI with Volume
This indicator was created by LazyBear from the popular RSI.
The RSI is an oscillator-type indicator used in technical analysis and also created by Welles Wilder that shows the strength of the price by comparing individual movements up or down in successive closing prices.
LazyBear added a volume parameter that makes it more accurate to the market movement.
A good way to use RSI is by considering the 50 'RSI CENTER LINE' centerline. When the oscillator is above, the trend is bullish and when it is below, the trend is bearish.
6. Moving Average Convergence Divergence (MACD) and (MAC-Z)
It was created by Gerald Appel. Subsequently, the histogram was added to anticipate the crossing of MA. Broadly speaking, we can say that the MACD is an oscillator consisting of two moving averages that rotate around the zero line. The MACD line is the difference between a short moving average 'MACD FAST MA LENGTH' and a long moving average 'MACD SLOW MA LENGTH'. It's an indicator that allows us to have a reference on the trend of the asset on which it is operating, thus generating market entry and exit signals.
We can talk about a bull market when the MACD histogram is above the zero line, along with the signal line, while we are talking about a bear market when the MACD histogram is below the zero line.
There is the option of using the MAC-Z indicator created by LazyBear, which according to its author is more effective, by using the parameter VWAP (volume weighted average price) 'Z-VWAP LENGTH' together with a standard deviation 'STDEV LENGTH' in its calculation.
7. Volume Condition
Volume indicates the number of participants in this war between bulls and bears, the more volume the more likely the price will move in favor of the trend. A low trading volume indicates a lower number of participants and interest in the instrument in question. Low volumes may reveal weakness behind a price movement.
With this condition, those signals whose volume is less than the volume SMA for a period 'SMA VOLUME LENGTH' multiplied by a factor 'VOLUME FACTOR' are filtered. In addition, it determines the leverage used, the more volume, the more participants, the more probability that the price will move in our favor, that is, we can use more leverage. The leverage in this script is determined by how many times the volume is above the SMA line.
The maximum leverage is 8.
8. Bollinger Bands
This indicator was created by John Bollinger and consists of three bands that are drawn superimposed on the price evolution graph.
The central band is a moving average, normally a simple moving average calculated with 20 periods is used. ('BB LENGTH' Number of periods of the moving average)
The upper band is calculated by adding the value of the simple moving average X times the standard deviation of the moving average. ('BB MULTIPLIER' Number of times the standard deviation of the moving average)
The lower band is calculated by subtracting the simple moving average X times the standard deviation of the moving average.
the band between the upper and lower bands contains, statistically, almost 90% of the possible price variations, which means that any movement of the price outside the bands has special relevance.
In practical terms, Bollinger bands behave as if they were an elastic band so that, if the price touches them, it has a high probability of bouncing.
Sometimes, after the entry order is filled, the price is returned to the opposite side. If price touch the Bollinger band in the same previous conditions, another order is filled in the same direction of the position to improve the average entry price, (% MINIMUM BETTER PRICE ': Minimum price for the re-entry to be executed and that is better than the price of the previous position in a given %) in this way we give the trade a chance that the Take Profit is executed before. The downside is that the position is doubled in size. 'ACTIVATE DIVIDE TP': Divide the size of the TP in half. More probability of the trade closing but less profit.
█ STOP LOSS and RISK MANAGEMENT.
A good risk management is what can make your equity go up or be liquidated.
The % risk is the percentage of our capital that we are willing to lose by operation. This is recommended to be between 1-5%.
% Risk: (% Stop Loss x % Equity per trade x Leverage) / 100
First the strategy is calculated with Stop Loss, then the risk per operation is determined and from there, the amount per operation is calculated and not vice versa.
In this script you can use a normal Stop Loss or one according to the ATR. Also activate the option to trigger it earlier if the risk percentage is reached. '% RISK ALLOWED'
'STOP LOSS CONFIRMED': The Stop Loss is only activated if the closing of the previous bar is in the loss limit condition. It's useful to prevent the SL from triggering when they do a ‘pump’ to sweep Stops and then return the price to the previous state.
█ BACKTEST
The objective of the Backtest is to evaluate the effectiveness of our strategy. A good Backtest is determined by some parameters such as:
- RECOVERY FACTOR: It consists of dividing the 'net profit' by the 'drawdown’. An excellent trading system has a recovery factor of 10 or more; that is, it generates 10 times more net profit than drawdown.
- PROFIT FACTOR: The ‘Profit Factor’ is another popular measure of system performance. It's as simple as dividing what win trades earn by what loser trades lose. If the strategy is profitable then by definition the 'Profit Factor' is going to be greater than 1. Strategies that are not profitable produce profit factors less than one. A good system has a profit factor of 2 or more. The good thing about the ‘Profit Factor’ is that it tells us what we are going to earn for each dollar we lose. A profit factor of 2.5 tells us that for every dollar we lose operating we will earn 2.5.
- SHARPE: (Return system - Return without risk) / Deviation of returns.
When the variations of gains and losses are very high, the deviation is very high and that leads to a very poor ‘Sharpe’ ratio. If the operations are very close to the average (little deviation) the result is a fairly high 'Sharpe' ratio. If a strategy has a 'Sharpe' ratio greater than 1 it is a good strategy. If it has a 'Sharpe' ratio greater than 2, it is excellent. If it has a ‘Sharpe’ ratio less than 1 then we don't know if it is good or bad, we have to look at other parameters.
- MATHEMATICAL EXPECTATION: (% winning trades X average profit) + (% losing trades X average loss).
To earn money with a Trading system, it is not necessary to win all the operations, what is really important is the final result of the operation. A Trading system has to have positive mathematical expectation as is the case with this script: ME = (0.87 x 30.74$) - (0.13 x 56.16$) = (26.74 - 7.30) = 19.44$ > 0
The game of roulette, for example, has negative mathematical expectation for the player, it can have positive winning streaks, but in the long term, if you continue playing you will end up losing, and casinos know this very well.
PARAMETERS
'BACKTEST DAYS': Number of days back of historical data for the calculation of the Backtest.
'ENTRY TYPE': For '% EQUITY' if you have $ 10,000 of capital and select 7.5%, for example, your entry would be $ 750 without leverage. If you select CONTRACTS for the 'BTCUSDT' pair, for example, it would be the amount in 'Bitcoins' and if you select 'CASH' it would be the amount in $ dollars.
'QUANTITY (LEVERAGE 1X)': The amount for an entry with X1 leverage according to the previous section.
'MAXIMUM LEVERAGE': It's the maximum allowed multiplier of the quantity entered in the previous section according to the volume condition.
The settings are for Bitcoin at Binance Futures (BTC: USDTPERP) in 30 minutes.
For other pairs and other timeframes, the settings have to be adjusted again. And within a month, the settings will be different because we all know the market and the trend are changing.
█ 888 BOT (SPANISH)
Este es un Expert Advisor 'EA' o script de trading automatizado para ‘longs’ y ‘shorts’, el cual, utiliza solo un Take Profit o, en el peor de los casos, un Stop Loss para cerrar el trade.
Es una versión muy mejorada del anterior ‘Repanocha’. No utiliza ‘Trailing Stop’, ni funciones ‘security()’ (aunque usar una función security no significa que el script repinte) y todas las señales son confirmadas, por consiguiente, el script no repinta en modo alertas y es preciso en en el modo backtest.
Aparte de los anteriores indicadores se han añadido algunos más y otras funciones para Stop-Loss, de re-entrada y apalancamiento.
Utiliza 8 indicadores, (muchos ya sabéis sobradamente lo que son, pero por si hay alguien nuevo), son los siguientes:
1. Jurik Moving Average
Es una media móvil creada por Mark Jurik para profesionales la cual elimina el ‘lag’ o retardo de la señal. Es mejor que otras medias móviles como la EMA, DEMA, AMA o T3.
Hay dos formas de disminuir el ruido utilizando JMA. El aumento del parámetro 'LENGTH' hará que JMA se mueva más lentamente y, por lo tanto, reducirá el ruido a expensas de añadir ‘lag’
Los parámetros 'JMA LENGTH', 'PHASE' y 'POWER' ofrecen una forma de seleccionar el equilibrio óptimo entre ‘lag’ y sobre impulso.
Verde : Alcista, Rojo: Bajista.
2. Range filter
Creado por Donovan Wall, su función es la de filtrar o eliminar el ruido y poder determinar mejor la tendencia del precio a corto plazo.
Primero, se calcula un rango de precio promedio uniforme 'SAMPLING PERIOD' para la base del filtro y se multiplica por una cantidad específica 'RANGE MULTIPLIER'.
A continuación, el filtro se calcula ajustando los movimientos de precios que no exceden el rango especificado.
Por último, los rangos objetivo se trazan para mostrar los precios que activarán el movimiento del filtro.
Verde : Alcista, Rojo: Bajista.
3. Average Directional Index (ADX Classic) y (ADX Masanakamura)
Es un indicador diseñado por Welles Wilder para medir la fuerza y dirección de la tendencia del mercado. El movimiento del precio tiene fuerza cuando el ADX tiene pendiente positiva y está por encima de cierto nivel mínimo 'ADX THRESHOLD' y para un periodo dado 'ADX LENGTH'.
El color verde de las barras indica que la tendencia es alcista y que el ADX está por encima del nivel establecido por el threshold.
El color Rojo de las barras indica que la tendencia es bajista y que el ADX está por encima del nivel de threshold.
El color naranja de las barras indica que el precio no tiene fuerza y seguramente lateralizará.
Se puede elegir entre la opción clásica y la creada por un tal 'Masanakamura'. La diferencia principal entre los dos es que en el primero utiliza RMA() y en el segundo SMA() en su cálculo.
4. Parabolic SAR
Este indicador, creado también por Welles Wilder, coloca puntos que ayudan a definir una tendencia. El Parabolic SAR puede seguir al precio por encima o por debajo, la particularidad que ofrece es que cuando el precio toca al indicador, este salta al otro lado del precio (si el Parabolic SAR estaba por debajo del precio salta arriba y viceversa) a una distancia predeterminada por el indicador. En este momento el indicador vuelve a seguir al precio, reduciendo la distancia con cada vela hasta que finalmente es tocado otra vez por el precio y se vuelve a iniciar el proceso. Este procedimiento explica el nombre del indicador: el Parabolic SAR va siguiendo al precio generando una característica forma parabólica, cuando el precio lo toca, se para y da la vuelta (SAR son las siglas en inglés de ‘stop and reverse’), dando lugar a un nuevo ciclo. Cuando los puntos están por debajo del precio, la tendencia es alcista, mientras que los puntos por encima del precio indica una tendencia bajista.
5. RSI with Volume
Este indicador lo creo un tal LazyBear de TV a partir del popular RSI.
El RSI es un indicador tipo oscilador utilizado en análisis técnico y creado también por Welles Wilder que muestra la fuerza del precio mediante la comparación de los movimientos individuales al alza o a la baja de los sucesivos precios de cierre.
LazyBear le añadió un parámetro de volumen que lo hace más preciso al movimiento del mercado.
Una buena forma de usar el RSI es teniendo en cuenta la línea central de 50 'RSI CENTER LINE'. Cuando el oscilador está por encima, la tendencia es alcista y cuando está por debajo la tendencia es bajista.
6. Moving Average Convergence Divergence (MACD) y (MAC-Z)
Fue creado por Gerald Appel. Posteriormente se añadió el histograma para anticipar el cruce de medias. A grandes rasgos podemos decir que el MACD es un oscilador consistente en dos medias móviles que van girando en torno a la línea de cero. La línea del MACD no es más que la diferencia entre una media móvil corta 'MACD FAST MA LENGTH' y una media móvil larga 'MACD SLOW MA LENGTH'. Es un indicador que nos permite tener una referencia sobre la tendencia del activo sobre el cual se está operando, generando de este modo señales de entrada y salida del mercado.
Podemos hablar de mercado alcista cuando el histograma del MACD se sitúe por encima de la línea cero, junto con la línea de señal, mientras que hablaremos de mercado bajista cuando el histograma MACD se situará por debajo de la línea cero.
Está la opción de utilizar el indicador MAC-Z creado por LazyBear que según su autor es más eficaz, por utilizar el parámetro VWAP (precio medio ponderado por volumen) 'Z-VWAP LENGTH' junto con una desviación standard 'STDEV LENGTH' en su cálculo.
7. Volume Condition
El volumen indica el número de participantes en esta guerra entre toros y osos, cuanto más volumen más probabilidad de que se mueva el precio a favor de la tendencia. Un volumen bajo de negociación indica un menor número de participantes e interés por el instrumento en cuestión. Los bajos volúmenes pueden revelar debilidad detrás de un movimiento de precios.
Con esta condición se filtran aquellas señales cuyo volumen es inferior a la SMA de volumen para un periodo 'SMA VOLUME LENGTH' multiplicado por un factor 'VOLUME FACTOR'. Además, determina el apalancamiento utilizado, a más volumen, más participantes, más probabilidad de que se mueva el precio a nuestro favor, es decir, podemos utilizar más apalancamiento. El apalancamiento en este script lo determina las veces que está el volumen por encima de la línea de la SMA.
El apalancamiento máximo es de 8.
8. Bollinger Bands
Este indicador fue creado por John Bollinger y consiste en tres bandas que se dibujan superpuestas al gráfico de evolución del precio.
La banda central es una media móvil, normalmente se emplea una media móvil simple calculada con 20 períodos. ('BB LENGTH' Número de periodos de la media móvil)
La banda superior se calcula sumando al valor de la media móvil simple X veces la desviación típica de la media móvil. ('BB MULTIPLIER' Número de veces la desviación típica de la media móvil)
La banda inferior de calcula restando a la media móvil simple X veces la desviación típica de la media móvil.
la franja comprendida entre las bandas superior e inferior contiene, estadísticamente, casi un 90% de las posibles variaciones del precio, lo que significa que cualquier movimiento del precio fuera de las bandas tiene especial relevancia.
En términos prácticos, las bandas de Bollinger se comporta como si de una banda elástica se tratara de manera que, si el precio las toca, éste tiene mucha probabilidad de rebotar.
En ocasiones, después de rellenarse la orden de entrada, el precio se devuelve hacia el lado contrario. Si toca la banda de Bollinger se rellena otra orden en la misma dirección de la posición para mejorar el precio medio de entrada, (% MINIMUM BETTER PRICE': Precio mínimo para que se ejecute la re-entrada y que sea mejor que el precio de la posición anterior en un % dado) de esta manera damos una oportunidad al trade de que el Take Profit se ejecute antes. La desventaja es que se dobla el tamaño de la posición. 'ACTIVATE DIVIDE TP': Divide el tamaño del TP a la mitad. Más probabilidad de que se cierre el trade pero menos ganancias.
█ STOP LOSS y RISK MANAGEMENT.
Una buena gestión de las pérdidas o gestión del riesgo es lo que puede hacer que tu cuenta suba o se liquide en poco tiempo.
El % de riesgo es el porcentaje de nuestro capital que estamos dispuestos a perder por operación. Este se aconseja que debe estar comprendido entre un 1-5%.
% Risk = (% Stop Loss x % Equity per trade x Leverage) / 100
Primero se calcula la estrategia con Stop Loss, después se determina el riesgo por operación y a partir de ahí se calcula el monto por operación y no al revés.
En este script puedes usar un Stop Loss normal o uno según el ATR. También activar la opción de que salte antes si se alcanza el porcentaje de riesgo. '% RISK ALLOWED'
'STOP LOSS CONFIRMED': Solamente se activa el Stop Loss si el cierre de la barra anterior se encuentra en la condición de límite de pérdidas. Es útil para evitar que se dispare el SL cuando hacen un ‘pump’ para barrer Stops y luego se devuelve el precio a la normalidad.
█ BACKTEST
El objetivo del Backtest es evaluar la eficacia de nuestra estrategia. Un buen Backtest lo determinan algunos parámetros como son:
- RECOVERY FACTOR: Consiste en dividir el ‘beneficio neto’ entre el ‘drawdown’. Un excelente sistema de trading tiene un recovery factor de 10 o más; es decir, genera 10 veces más beneficio neto que drawdown.
- PROFIT FACTOR: El ‘Profit Factor’ es otra medida popular del rendimiento de un sistema. Es algo tan simple como dividir lo que ganan las operaciones con ganancias entre lo que pierden las operaciones con pérdidas. Si la estrategia es rentable entonces por definición el ‘Profit Factor’ va a ser mayor que 1. Las estrategias que no son rentables producen factores de beneficio menores que uno. Un buen sistema tiene un profit factor de 2 o más. Lo bueno del ‘Profit Factor’ es que nos dice lo que vamos a ganar por cada dolar que perdemos. Un profit factor de 2.5 nos dice que por cada dolar que perdamos operando vamos a ganar 2.5.
- SHARPE: (Retorno sistema – Retorno sin riesgo) / Desviación de los retornos.
Cuando las variaciones de ganancias y pérdidas son muy altas, la desviación es muy elevada y eso conlleva un ratio de ‘Sharpe’ muy pobre. Si las operaciones están muy cerca de la media (poca desviación) el resultado es un ratio de ‘Sharpe’ bastante elevado. Si una estrategia tiene un ratio de ‘Sharpe’ mayor que 1 es una buena estrategia. Si tiene un ratio de ‘Sharpe’ mayor que 2, es excelente. Si tiene un ratio de ‘Sharpe’ menor que 1 entonces no sabemos si es buena o mala, hay que mirar otros parámetros.
- MATHEMATICAL EXPECTATION:(% operaciones ganadoras X ganancia media) + (% operaciones perdedoras X pérdida media).
Para ganar dinero con un sistema de Trading, no es necesario ganar todas las operaciones, lo verdaderamente importante es el resultado final de la operativa. Un sistema de Trading tiene que tener esperanza matemática positiva como es el caso de este script.
El juego de la ruleta, por ejemplo, tiene esperanza matemática negativa para el jugador, puede tener rachas positivas de ganancias, pero a la larga, si se sigue jugando se acabará perdiendo, y esto los casinos lo saben muy bien.
PARAMETROS
'BACKTEST DAYS': Número de días atrás de datos históricos para el calculo del Backtest.
'ENTRY TYPE': Para % EQUITY si tienes 10000$ de capital y seleccionas 7.5% tu entrada sería de 750$ sin apalancamiento. Si seleccionas CONTRACTS para el par BTCUSDT sería la cantidad en Bitcoins y si seleccionas CASH sería la cantidad en dólares.
'QUANTITY (LEVERAGE 1X)': La cantidad para una entrada con apalancamiento X! según el apartado anterior.
'MAXIMUM LEVERAGE': Es el máximo multiplicador permitido de la cantidad introducida en el apartado anterior según la condición de volumen.
Los settings son para Bitcoin en Binance Futures (BTC:USDTPERP) en 30 minutos.
Para otro pares y otras temporalidades se tienen que ajustar las opciones de nuevo. Además para dentro de un mes, los ajustes serán otros distintos ya que el mercado y la tendencia es cambiante.
SSL HybridThis script is designed for the NNFX Method, so it is recommended for Daily charts only.
Tried to implement a few VP NNFX Rules
This script has a SSL / Baseline (you can choose between the SSL or MA), a secondary SSL for continiuation trades and a third SSL for exit trades.
Alerts added for Baseline entries, SSL2 continuations, Exits.
Baseline has a Keltner Channel setting for "in zone" Gray Candles
Added "Candle Size > 1 ATR" Diamonds from my old script with the criteria of being within Baseline ATR range.
Credits go to:
Strategy causecelebre www.tradingview.com
SSL Channel ErwinBeckers www.tradingview.com
Moving Averages jiehonglim www.tradingview.com
Moving Averages everget www.tradingview.com
"Many Moving Averages" script Fractured www.tradingview.com
Baseline-C [ID: AC-P]The "AC-P" version of jiehonglim's NNFX Baseline script is my personal customized version of the NNFX Baseline concept as part of the NNFX Algorithm stack/structure for 1D Trend Trading for Forex. Everget's JMA implementation is used for the baseline smoothing method, with optional ATR bands at 1.0x and 1.5x from the baseline.
NNFX = No Nonsense Forex
Baseline = Component of the NNFX Algorithm that consists of a single moving average
Baseline ---> Meant to be used in conjunction with ATR/C1/C2/Vol Indicator/Exit Indicator as per NNFX Algorithm setup/structure. C1 is 1st Confirmation Indicator, C2 is 2nd Confirmation Indicator.
JMA (Jurik Moving Average) is used for the baseline and slow baseline.
A slow baseline option is included, but disabled by default.
The faint orange/purple lines are 1.0x/1.5x ATR from the Baseline, and are what I use as potential TP/SL targets or to evaluate when to stay out of a trade (chop/missed entry/exit/other/ATR breach), depending on the trade setup (in conjunction with C1/C2/Vol Indicator/Exit Indicator)
This script is heavily based upon jiehonglim's NNFX Baseline script for signaling, barcoloring, and ATR.
SSL Channel option included but disabled by default (Erwinbeckers SSL component)
POC (Point of Control) from Volume Profile is included/enabled by default for both the current timeframe and 12HR timeframe
03.freeman's InfoPanel Divergence Indicator was used a reference to replace the current/previous ATR information infopanel/info draw from jiehonglim's script. I'm not sure whether I like the previous way ATR info was displayed vs how I have it currently, but it's something that is completely optional:
Specifically: I am tuning this baseline/indicator for 1D trading as part of the NNFX system, for Forex.
DO NOT USE THIS INDICATOR WITHOUT PROPER TUNING/ADJUSTMENT for your timeframe and asset class.
Note about lack of alerts:
Alerts for baseline crosses (and other crosses) have been purposefully omitted for this version upon initial publication. While getting alerts for baseline crosses under certain conditions/filtered conditions that eliminate low-importance signals and crossover whipsaw would be great, it's something I'm still looking into.
SPECIFICALLY: There are entry, exit, take profit, and continuation signal components in relation to the Baseline to the rest of the NNFX Algorithm stack (ATR/C1/C2/Vol Indicator/Exit Indicator), including but limited to the "1 candle rule" and the "7 candle rule" as per NNFX.
Implementing alerts that are significant that also factor in these rules while reducing alert spam/false signals would be ideal, but it's also the HTF/Daily chart - visually, entry/exit/continuation signal alignment is easy to spot when trading 1D - alerts may be redundant/a pursuit in diminishing returns (for now).
//-------------------------------------------------------------------
// Acknowledgements/Reference:
// jiehonglim, NNFX Baseline Script - Moving Averages
//
// Fractured, Many Moving Averages
//
// everget, Jurik Moving Average/JMA
//
// 03.freeman, InfoPanel Divergence Indicator
//
// Ggqmna Volume stops
//
// Libertus RSI Divs
//
// ChrisMoody, CM_Price-Action-Bars-Price Patterns That Work
//
// Erwinbeckers SSL Channel
//
[AU] Waves+ Waves+ v0R7b
Plus version of Waves with components from both Waves Advanced and Mnemosyne. Essentially, Waves+ is highly configurable hybrid wavetrend oscillator and Fibonacci oscillator.
Slow wavetrend component replaced by Follower/Base from Mnemosyne indicator
TTM Squeeze Loose/Strict + Explosion Zones now enabled by default
Extreme Caution Fast Wavetrend Line, Fast wavetrend and Extreme Caution Fast WT cross signal now available
Disabled/removed to speed up script performance and load time: Divergence component, stoch k crossovers, T1 signals. Draw objects reduced from 89 to 64 to conform to Pinescript v4 requirements.
Large inactive code blocks stripped/removed to speed up performance and load time
JMA-HMA-based Scalper (ps4)This is an old compilation of mine suitable for scalping. To filter out the generated signals use Difference value between on the Settings menu.
4 JMA Crossover Strategy (ps4)This is a PS4 update to my previous 4 JMA strategy that received many likes. In this and several recent strategies I use a simplified strategy setup, featuring trailing stops with very tiny increments. This is done intentionally in order to boost performance to the limit, so that to pinpoint that limit. Strategies with performance of about 90% or above are regarded as viable. Incorporating various overhead factors such as transaction costs, broker's spread, slippage, etc. at this stage creates too much 'noise' with the end result of losing the sight of the forest behind the trees.)) In practice, I disable the 'Use Strategy Setup' option and fine-tune parameters the way I want.
Tested security: EURUSD . Tested TF: 3m
Many Moving AveragesThis script allows you to add two moving averages to a chart, where the type of moving average can be chosen from a collection of 15 different moving average algorithms. Each moving average can also have different lengths and crossovers/unders can be displayed and alerted on.
The supported moving average types are:
Simple Moving Average ( SMA )
Exponential Moving Average ( EMA )
Double Exponential Moving Average ( DEMA )
Triple Exponential Moving Average ( TEMA )
Weighted Moving Average ( WMA )
Volume Weighted Moving Average ( VWMA )
Smoothed Moving Average ( SMMA )
Hull Moving Average ( HMA )
Least Square Moving Average/Linear Regression ( LSMA )
Arnaud Legoux Moving Average ( ALMA )
Jurik Moving Average ( JMA )
Volatility Adjusted Moving Average ( VAMA )
Fractal Adaptive Moving Average ( FRAMA )
Zero-Lag Exponential Moving Average ( ZLEMA )
Kauman Adaptive Moving Average ( KAMA )
Many of the moving average algorithms were taken from other peoples' scripts. I'd like to thank the authors for making their code available.
JayRogers
Alex Orekhov (everget)
Alex Orekhov (everget)
Joris Duyck (JD)
nemozny
Shizaru
KobySK
Jurik Research and Consulting for inventing the JMA.
Woodies CCX + CZ + SW indicatorsVersion of Woodies CCI that uses JMA ("zero-lag" Jurik's Moving Average) instead of SMA (and EMA34). CCX responds on price much faster than CCI. I recommend to play with Power parameters, higher Power will fit MA closer to prices, lower values will give smoother result.
All credits for the original code go to @4alphabsolute
Moving Average CrossoverIt was planned as an addition to Moving Average Smoothness Benchmark and Profitable Moving Average Crossover , but can be used standalone.
Supports 62 types of well-known moving averages and allows full-featured customization.
Supported types of averages and filters:
AEMA , Adaptive Exponential MA (by Vitali Apirine)
AHMA , Ahrens MA (by Richard D. Ahrens)
ALMA , Arnaud Legoux MA (by Arnaud Legoux and Dimitris Kouzis-Loukas)
ALF , Adaptive Laguerre Filter (by John F. Ehlers)
AMA , Adaptive MA (by Vitali Apirine)
ARSI , Adaptive RSI
BAMA , Bryant Adaptive MA (by Michael R. Bryant)
BF2 , Butterworth Filter with 2 poles
BF3 , Butterworth Filter with 3 poles
DEMA , Double Exponential MA (by Patrick G. Mulloy)
DWMA , Double Weighted (Linear) MA
EDCF , Ehlers Distance Coefficient Filter (by John F. Ehlers)
EDSMA , Ehlers Deviation-Scaled MA (by John F. Ehlers)
EHMA , Exponential Hull MA
EMA , Exponential MA
EVWMA , Elastic Volume Weighted MA (by Christian P. Fries)
FRAMA , Fractal Adaptive MA (by John F. Ehlers)
GF1 , Gaussian Filter with 1 pole
GF2 , Gaussian Filter with 2 poles
GF3 , Gaussian Filter with 3 poles
GF4 , Gaussian Filter with 4 poles
HFSMA , Hampel Filter on Simple Moving Average
HFEMA , Hampel Filter on Exponential Moving Average
HMA , Hull MA (by Alan Hull)
HWMA , Henderson Weighted MA (by Robert Henderson)
IDWMA , Inverse Distance Weighted MA
IIRF , Infinite Impulse Response Filter (by John F. Ehlers)
JAMA , Jurik Adaptive MA (by Mark Jurik)
JMA , Jurik MA (by Mark Jurik, )
KAMA , Kaufman Adaptive MA (by Perry J. Kaufman)
LF , Laguerre Filter (by John F. Ehlers)
LMA , Leo MA (by ProRealCode' user Leo)
LSMA , Least Squares MA (Moving Linear Regression)
MAMA (by John F. Ehlers)
FAMA , Following Adaptive MA (by John F. Ehlers)
MD , McGinley Dynamic (by John R. McGinley)
MHLMA , Middle-High-Low MA (by Vitali Apirine)
MNMA , McNicholl MA (by Dennis McNicholl)
NSMA , Moving Average 3.0 on SMA (by Manfred G. Dürschner)
NEMA , Moving Average 3.0 on EMA (by Manfred G. Dürschner)
NWMA , Moving Average 3.0 on WMA (by Manfred G. Dürschner)
NVWMA , Moving Average 3.0 on VWMA (by Manfred G. Dürschner)
PEMA , Pentuple Exponential MA (by Bruno Pio)
PWMA , Parabolic Weighted MA
QMA , Quick MA (by John McCormick)
QEMA , Quadruple Exponential MA (by Bruno Pio)
REMA , Regularized Exponential MA (by Chris Satchwell)
RMA , Running MA (by J. Welles Wilder)
RMF , Recursive Median Filter (by John F. Ehlers )
RMTA , Recursive Moving Trend Average (by Dennis Meyers)
SHMMA , Sharp Modified MA (by Joe Sharp)
SMA , Simple MA
SSF2 , Super Smoother Filter with 2 poles (by John F. Ehlers)
SSF3 , Super Smoother Filter with 3 poles (by John F. Ehlers)
SWMA , Sine Weighted MA
TEMA , Triple Exponential MA (by Patrick G. Mulloy)
TMA , Triangular MA (generalized by John F. Ehlers)
T3 , (by Tim Tillson)
VIDYA , Variable Index Dynamic Average (by Tushar S. Chande)
VWMA , Volume Weighted MA (by Buff P. Dormeier)
WMA , Weighted (Linear) MA
ZLEMA , Zero Lag Exponential MA (by John F. Ehlers and Ric Way)
Exponential Hull MA Oscillator PrototypeClamped EHMA Oscillator Prototype with 21/200 EHMA with additional JMA smoothing (Credit: @everget)
Note: This is an experiment - this is not a polished indicator
Dickinson Moving Average (DMA)Implementation of the "Dickinson Moving Average" from the r/algotrading post by Nathan Dickinson
Quoted from the author of the Dickinson Moving Average:
"I was experimenting with the “zero lag” code from John Ehlers and the Hull Moving Average and noticed that they seemed to respond in complementary ways when properly set up. With the right starting values, they blend together to make a moving average which responds with one (or maybe even half a bar) of lag. To my eye, it looks to be almost as good as the Jurik Moving Average."
Optional parameter input available to use Exponential Hull Moving Average (EHMA) instead of WMA for the Hull MA is available.
Acknowledgements/Credits:
Nathan Dickinson, Dickinson Moving Average
@RicardoSantos, Function for Hull Moving Average
Exponential Hull Moving Average sourced from:
// Raudys, Aistis & Lenčiauskas, Vaidotas & Malčius, Edmundas. (2013). Moving Averages for Financial Data Smoothing.
// Communications in Computer and Information Science. 403. 34-45. 10.1007/978-3-642-41947-8_4.
@Everget, Jurik Moving Average
TDI RSX JMATDI based on RSX and JMA from Jurik.
Green dot = Rsx cross JMA below 50--> Long
Blue dot = JMA cross Mid Band --> Long
Red dot = Rsx cross JMA above 50 -->Short
Orange dot =JMA cross Mid Band --> Short
General Filter Estimator-An Experiment on Estimating EverythingIntroduction
The last indicators i posted where about estimating the least squares moving average, the task of estimating a filter is a funny one because its always a challenge and it require to be really creative. After the last publication of the 1LC-LSMA , who estimate the lsma with 1 line of code and only 3 functions i felt like i could maybe make something more flexible and less complex with the ability to approximate any filter output. Its possible, but the methods to do so are not something that pinescript can do, we have to use another base for our estimation using coefficients, so i inspired myself from the alpha-beta filter and i started writing the code.
Calculation and The Estimation Coefficients
Simplicity is the key word, its also my signature style, if i want something good it should be simple enough, so my code look like that :
p = length/beta
a = close - nz(b ,close)
b = nz(b ,close) + a/p*gamma
3 line, 2 function, its a good start, we could put everything in one line of code but its easier to see it this way. length control the smoothing amount of the filter, for any filter f(Period) Period should be equal to length and f(Period) = p , it would be inconvenient to have to use a different length period than the one used in the filter we want to estimate (imagine our estimation with length = 50 estimating an ema with period = 100) , this is where the first coefficients beta will be useful, it will allow us to leave length as it is. In general beta will be greater than 1, the greater it will be the less lag the filter will have, this coefficient will be useful to estimate low lagging filters, gamma however is the coefficient who will estimate lagging filters, in general it will range around .
We can get loose easily with those coefficients estimation but i will leave a coefficients table in the code for estimating popular filters, and some comparison below.
Estimating a Simple Moving Average
Of course, the boxcar filter, the running mean, the simple moving average, its an easy filter to use and calculate.
For an SMA use the following coefficients :
beta = 2
gamma = 0.5
Our filter is in red and the moving average in white with both length at 50 (This goes for every comparison we will do)
Its a bit imprecise but its a simple moving average, not the most interesting thing to estimate.
Estimating an Exponential Moving Average
The ema is a great filter because its length times more computing efficient than a simple moving average. For the EMA use the following coefficients :
beta = 3
gamma = 0.4
N.B : The EMA is rougher than the SMA, so it filter less, this is why its faster and closer to the price
Estimating The Hull Moving Average
Its a good filter for technical analysis with tons of use, lets try to estimate it ! For the HMA use the following coefficients :
beta = 4
gamma = 0.85
Looks ok, of course if you find better coefficients i will test them and actualize the coefficient table, i will also put a thank message.
Estimating a LSMA
Of course i was gonna estimate it, but this time this estimation does not have anything a lsma have, no moving average, no standard deviation, no correlation coefficient, lets do it.
For the LSMA use the following coefficients :
beta = 3.5
gamma = 0.9
Its far from being the best estimation, but its more efficient than any other i previously made.
Estimating the Quadratic Least Square Moving Average
I doubted about this one but it can be approximated as well. For the QLSMA use the following coefficients :
beta = 5.25
gamma = 1
Another ok estimate, the estimate filter a bit more than needed but its ok.
Jurik Moving Average
Its far from being a filter that i like and its a bit old. For the comparison i will use the JMA provided by @everget described in this article : c.mql5.com
For the JMA use the following coefficients :
for phase = 0
beta = pow*2 (pow is a parameter in the Jma)
gamma = 0.5
Here length = 50, phase = 0, pow = 5 so beta = 10
Looks pretty good considering the fact that the Jma use an adaptive architecture.
Discussion
I let you the task to judge if the estimation is good or not, my motivation was to estimate such filters using the less amount of calculations as possible, in itself i think that the code is quite elegant like all the codes of IIR filters (IIR Filters = Infinite Impulse Response : Filters using recursion) .
It could be possible to have a better estimate of the coefficients using optimization methods like the gradient descent. This is not feasible in pinescript but i could think about it using python or R.
Coefficients should be dependant of length but this would lead to a massive work, the variation of the estimation using fixed coefficients when using different length periods is just ok if we can allow some errors of precision.
I dont think it should be possible to estimate adaptive filter relying a lot on their adaptive parameter/smoothing constant except by making our coefficients adaptive (gamma could be)
So at the end ? What make a filter truly unique ? From my point of sight the architecture of a filter and the problem he is trying to solve is what make him unique rather than its output result. If you become a signal, hide yourself into noise, then look at the filters trying to find you, what a challenging game, this is why we need filters.
Conclusion
I wanted to give a simple filter estimator relying on two coefficients in order to estimate both lagging and low-lagging filters. I will try to give more precise estimate and update the indicator with new coefficients.
Thanks for reading !
Jurik RSX on JMAThis is Jurik RSX version that accepts price preliminarily filtered using the best original JMA' clone on TradingView .
As Mr. Jurik noticed:
"A smooth (low noise) trend is more efficient than a noisy trend. Given that RSX measures market trend direction and efficiency, it stands to reason that RSX would respond better (display larger dynamic range) when fed pre-smoothed price data. And there's no better way to pre-smooth than by using JMA " .
And as the result: "it reverses with the market, showing almost no lag" .
Jurik's RSX is a "noise free" version of RSI, with no added lag.
Reference:
www.jurikres.com
www.jurikres.com
Jurik JMA/DWMA MACDAn oscillator form of the crossover system that was recommended by Mark Jurik. The oscillator is based on the Jurik Moving Average (JMA) and Double Weighted Moving Average (DWMA) convergence/divergence. I use the best original JMA' clone on TradingView that has the almost identical behaviour as the original one.
I made it more pretty and added alerts for the peaks (blue circles).
As Mr. Jurik noticed:
"Of all the different combinations of moving average filters to use for a MACD oscillator, we prefer using the JMA - DWMA combination."
Reference: www.jurikres.com
Jurik JMA/DWMA CrossoverThis is a crossover system that was recommended by Mark Jurik. The system consists of Jurik Moving Average (JMA) and Double Weighted Moving Average (DWMA). In case of Jurik Moving Average I use the best original JMA' clone on TradingView that has the almost identical behaviour as the original one.
As Mr. Jurik noticed:
" JMA is ideal for the fast moving average line because it is quick to respond to reversals, is smooth and can be set to have no overshoot. DWMA (double weighted moving average) is ideal for the slower line as is tends to delay reversing direction until JMA crosses it."
Reference: www.jurikres.com
Jurik Moving AverageThis is my best attempt to reproduce the original Jurik Moving Average. It differs from Jurik's a little bit, but in most cases it behaves like the original.
Jurik Moving Average is known as a superior noise elimination (causal, nonlinear and adaptive) filter and a world class moving average that tracks and smoothes price charts or any market-related time series with surprising agility.
Settings
Length (default: 7 )
Phase (default: 50 )
Price Source (default: close )
I attached some screenshots to show you how it works with other instruments
USDJPY, D
USDJPY, 60
USDCAD, D
USDCHF, D
EURUSD, D
GBPJPY, D
AUDUSD, D
XAUUSD, D
XAUUSD, 60
AAPL, D
AAPL, 60
MSFT, D
AMZN, D
BTCUSD, D
BTCUSD, 60
ETHUSD, D
Good luck and happy trading!