Dynamically Adjustable Moving AverageIntroduction
The Dynamically Adjustable Moving Average (AMA) is an adaptive moving average proposed by Jacinta Chan Phooi M’ng (1) originally provided to forecast Asian Tiger's futures markets. AMA adjust to market condition in order to avoid whipsaw trades as well as entering the trending market earlier. This moving average showed better results than classical methods (SMA20, EMA20, MAC, MACD, KAMA, OptSMA) using a classical crossover/under strategy in Asian Tiger's futures from 2014 to 2015.
Dynamically Adjustable Moving Average
AMA adjust to market condition using a non-exponential method, which in itself is not common, AMA is described as follow :
1/v * sum(close,v)
where v = σ/√σ
σ is the price standard deviation.
v is defined as the Efficacy Ratio (not be confounded with the Efficiency Ratio) . As you can see v determine the moving average period, you could resume the formula in pine with sma(close,v) but in pine its not possible to use the function sma with variables for length, however you can derive sma using cumulation.
sma ≈ d/length where d = c - c_length and c = cum(close)
So a moving average can be expressed as the difference of the cumulated price by the cumulated price length period back, this difference is then divided by length. The length period of the indicator should be short since rounded version of v tend to become less variables thus providing less adaptive results.
AMA in Forex Market
In 2014/2015 Major Forex currencies where more persistent than Asian Tiger's Futures (2) , also most traded currency pairs tend to have a strong long-term positive autocorrelation so AMA could have in theory provided good results if we only focus on the long term dependency. AMA has been tested with ASEAN-5 Currencies (3) and still showed good results, however forex is still a tricky market, also there is zero proof that switching to a long term moving average during ranging market avoid whipsaw trades (if you have a paper who prove it please pm me) .
Conclusion
An interesting indicator, however the idea behind it is far from being optimal, so far most adaptive methods tend to focus more in adapting themselves to market complexity than volatility. An interesting approach would have been to determine the validity of a signal by checking the efficacy ratio at time t . Backtesting could be a good way to see if the indicator is still performing well.
References
(1) J.C.P. M’ng, Dynamically adjustable moving average (AMA’) technical
analysis indicator to forecast Asian Tigers’ futures markets, Physica A (2018),
doi.org
(2) www.researchgate.net
(3) www.ncbi.nlm.nih.gov
Cross
(YEK) Combo(YEK) Combo is a combination of several indicators (listed below). You can use them together or one by one. Just click settings, and choose which of them to be shown.
Here are the indicators included in this script:
- Ichimoku Cloud
- Bollinger Bands
- Moving Average 1
- Moving Average 2 (In case of detecting golden crosses or death crosses)
- Exponential Moving Average
- T3 Tillson
- MavilimW
Enjoy!
rsi_with_stochrsi_[j15] v3This is version 3 RSI and StochRSI are improved by visualizing the cross-trend wave on the indicator, as well as by highlighting the colors of the bands and take into account the joint intersection of RSI and StochRSI at different settings. Enjoy using it!
SMA Cross (Short X Long)Its a graph for detecting the SMA cross points.
When short SMA crosses the long SMA downside up it may be a buy signal and the opposite is may be a sell signal.
rsi_with_stochrsi_[j15] v2This is version 2 of the combined indicator RSI and Stochastic RSI. Added intersection of lines k and d, as well as suppression of the upper and lower lines
EMA Cross + MACD Signal Cross overlay Einfacher EMA-Cross Indikator mit Indikation der Crosses auf EMA-Linie und am Chart-Bottom +
MACD-Cross wird default an: location.top angezeigt zusätzlich zeigt die Hintergrundfarbe an ob der MACD über (grün) oder unter (rot) seinem Signal liegt.
Repulsion Moving Average - Least Crosses MAA Moving Average With Less Whipsaws Signals
The cross of the price with a moving average is one of the easiest strategy in technical analysis and could have worked if market price wasn't so noisy (In general periods of 1 to 20 produces the most whipsaws) . So it is possible to create a moving average who can manage to escape those noisy periods and produce 0 whipsaws ?
This question was asked by one of my work colleagues and i responded : "well... almost 0".
The Motion Of A Moving Average
Moving Average estimate the Trend and will always have phase shift, they will still follow the price and cross it during high volatility or low volatility periods, and when a moving average cross the price during a low volatility period you can expect lot of crosses.
In order to fix this behaviour a simple calculation exist :
FixMa = LongPeriodMA + MediumPeriodMA - ShortPeriodMA
We can see things in that way, the medium term MA is high pass filtered (subtracted) with a short term MA and the result is summed to a long term MA. We give more reactivity to our long term MA and thus creating some kind of repulsion motion with the price. Of course this can sometimes make the filter kinda zero-lag to some price periods (when the long term MA is near the price) .
Comparison
In red a simple moving average of period 100 and in blue our repulsion moving average :
In the image the short term moving average period is 100, since the long term period of the moving average is equal to short term x 3 you could be interested to look at the comparison of our moving average with the actual long term moving average :
Less crosses, i think you can see it.
Something to notice is that its always a tradeoff between Signal Speed and Signal Numbers , a classic moving average create faster signals but also a high numbers of them, a classic trailing stop create less signals but slowest ones, our moving average is some kind of average between those indicators.
Improvement Methods - Choice of The Filter/More Terms
A bad behaviour of our filter can be fixed by using filters who tend to create less crosses with the price or by developing the formula of our filter by adding more terms as follow :
fixma = ma(Price,a) + ma(Price,b) + ma(Price,c) - ma(Price,d) - ma(Price,e)
where a > b > c > d > e . The number of subtractive terms is equal to the number of summing terms - 1.
Way To Use
This indicator can be used like any moving average with cross strategy. Can also be used as a trailing stop.
No tests have been made proving that this indicator provide support and resistance levels, such signals come from more centered indicators.
Hope you enjoy
For any questions/demands feel free to pm me, i would be happy to help you :)
Zindarra Multi Alerts Advanced (8 Symbols, 8 Levels) by RRBZindarra Multi Alerts Advanced by RRB by RagingRocketBull 2018
Version 1.0
This indicator lets you configure multiple alert levels for several assets. Zindarra Multi Alerts Advanced supports 8 symbols with 8 custom alert levels.
You can have an M:M relationship betweeen symbols and levels, for example:
- 4 symbols each boxed by 2 alerts above/below the price
- 3 symbols with 1 alert each
- 2 symbols, 1st with 2 alerts, 2nd - with 6 alerts
- 1 symbol with 8 alerts etc
There are several versions: Simple, Pro, Advanced and Ultimate. This is the Advanced version. The Differences are listed below.
- Simple: 10 Alert Levels, 1 plot mode, alert type: cross, no colors/triggered alerts
- Pro: 9 Alert Levels, 2 plot modes: plot/price line, alert type: cross, +change/swap colors, +hide/disable triggered alerts, 2 penetration modes (close, high/low), trigger on confirmed close
- Advanced: 8 Symbols/Tickers, 8 Alert Levels, +alert types: cross up/cross down, no color change. Display sources as lines/candles, normalize, scale/shift independently
- Ultimate: 5 Symbols/Tickers, 8 Alert Levels, +alert types: volume/price %/abs change, volume/ema/time cross
Features:
- 8 custom symbols, symbols:levels = M:M
- 8 custom alert levels with labels. For each alert there must be a corresponding non-empty symbol (can be a duplicate)
- alert types: cross/cross up/cross down
- normalize symbols (and alert levels) to 100% to compare,
- scale and shift each symbol (and alert levels) to position on a chart independently
- 1 alert levels plot mode: plot
- 2 symbol types: line/candles
- colorize symbol candles
- high/low or close level penetration modes
- show/hide levels/labels
- keep or auto disable triggered alerts
- trigger alerts only after a confirmed close
You will see all symbols on a single chart at the same time with their corresponding alert levels. From this chart you can manage all alerts configured for multiple assets.
Although TradingView has 2 percentage scale modes (Percent, Indexed to 100), somehow they still fail to be usefull when comparing multiple assets.
This indicator lets you normalize all symbols to 100% making a direct single scale comparison between assets with vastly different price levels possible.
All alert levels will be normalized as well.
TradingView does not let you move the plots attached to left scale. When scaled they all remain stuck in the center and can't be moved vertically or relative to each other.
This indicator lets you position all symbols independently using individual scale and shift settings. For example, you can:
- split your screen in 3 horiz areas and have a symbol in each of them without overlapping or
- have several partially overlapping assets with different scale each or
- have all assets fully overlapping and normalized to the same 100% scale
You have to manually create an alert in Manage Alerts Panel and configure it to use with this indicator.
Free accounts are limited to only 1 alert slot and this indicator will take it (any existing alerts must be disabled/stopped).
Once the alert is configured, the indicator can be removed from chart to free a slot for another indicator, but you won't see the alert levels.
Usage:
1. attach indicator to a chart
2. define alert levels in UI settings
3. in TradingView's Manage Alerts panel on the right:
- for free accounts: disable/stop all existing alerts, you are limited to 1 alert slot only. Otherwise you won't be able to save.
- create a new Alert:
- select 'Multi Alerts' indicator name in the Condition dropdown box, leave Level 1 and Multi Alerts Cross as default options
- select 'Once Per Bar' or 'Once Per Minute' instead of 'Only Once' to trigger the alert multiple times
5. click Save. Your 9 alerts are enabled now.
Change Settings:
1. change levels/settings in UI. Any changes will also reset already triggered levels visibility.
2. in Manage Alerts panel:
- open/edit the alert you created
- select new instance of 'Multi Alerts' indicator name in the Condition dropdown box (appears at the bottom)
- check the Condition dropdown again - a single instance should remain selected.
3. click Save. Your alert settings are updated.
Notes on using alerts:
- attaching this indicator to a chart and configuring alert levels will not automatically enable the alerts - you have to manually create/configure a new alert in the Alerts Panel
- removing this indicator from chart will not disable the alerts, you have to manually disable the alert you created in the Alerts Panel
- your alert in the Alerts Panel uses another instance (copy) of indicator/settings. Any changes won't affect the alert. You have to manually update the alert every time you change any settings in the indicator.
- recompiling and attaching your own version of indicator will require creating a new Alert (delete the old one).
- alerts are designed to work in realtime. In replay mode you will see triggered alert levels hiding/changing colors but there will be no system alert messages. It's best to test the indicator in realtime on M1 (1 min) chart
- you will only see 1 system alert per bar/60 sec when multiple alert levels are crossed with a single bar or across several symbols at the same time. However all of these levels will hide in the indicator as expected.
- you can only see the alert levels when the indicator is attached to chart, they are not shown by the system alert.
- For source=high/low a directional level penetration is used automatically (crossunder/low and crossover/high). For source=close a standard bidirectional cross is used unless another alert type is specified.
- normalization breaks/distorts alert levels and symbol price - this is normal and is expected. To view the real price of alert levels uncheck normalize - the first 8 outputs are alert levels. Unnormalized levels are straight lines.
- you will see alerts from all symbols in the system alert message box of the current symbol - a bit confusing, but there's no workaround, you can't have a customized alert message for each symbol/level
- many tickers as arguments can stretch/break TradingView's Create New Alert dialog but it's still possible to push all required buttons and Save.
- duplicate symbols will be displayed by default. You can manually hide duplicates using show/hide flags.
- empty tickers (and corresponding alerts) are essentially disabled
1. uses plot*, cross*, barssince, highest, security, alertcondition
Zindarra Multi Alerts by RRBZindarra Multi Alerts by RRB by RagingRocketBull 2018
Version 1.0
This indicator lets you configure multiple alert levels for an asset. Zindarra Multi Alerts supports 10 custom alert levels.
You have to manually create an alert in Manage Alerts Panel and configure it to use with this indicator.
Free accounts are limited to only 1 alert slot and this indicator will take it (any existing alerts must be disabled/stopped).
Once the alert is configured, the indicator can be removed from chart to free a slot for another indicator, but you won't see the alert levels.
This is the Zindarra Multi Alerts Simple version. You can't auto disable already triggered alerts in this indicator. All alerts will remain active.
If you want to be able to hide/disable/change color of the triggered alert levels use the Zindarra Multi Alerts Pro version.
Features:
- 10 custom alert levels with labels
- set open/high/low/close source point for level penetration
- show/hide levels/labels
Usage:
1. attach indicator to a chart
2. define alert levels in UI settings
3. in TradingView's Manage Alerts panel on the right:
- for free accounts: disable/stop all existing alerts, you are limited to 1 alert slot only. Otherwise you won't be able to save.
- create a new Alert:
- select 'Multi Alerts' indicator name in the Condition dropdown box, leave Level 1 and Multi Alerts Cross as default options
- select 'Once Per Bar' or 'Once Per Minute' instead of 'Only Once' to trigger the alert multiple times
5. click Save. Your 9 alerts are enabled now.
Change Settings:
1. change levels/settings in UI
2. in Manage Alerts panel:
- open/edit the alert you created
- select new instance of 'Multi Alerts' indicator name in the Condition dropdown box (appears at the bottom)
- check the Condition dropdown again - a single instance should remain selected.
3. click Save. Your alert settings are updated.
Notes on using alerts:
- attaching this indicator to a chart and configuring alert levels will not automatically enable the alerts - you have to manually create/configure a new alert in the Alerts Panel
- removing this indicator from chart will not disable the alerts, you have to manually disable the alert you created in the Alerts Panel
- your alert in the Alerts Panel uses another instance (copy) of indicator/settings. Any changes won't affect the alert. You have to manually update the alert every time you change any settings in the indicator.
- recompiling and attaching your own version of indicator will require creating a new Alert (delete the old one).
- alerts are designed to work in realtime. In replay mode you will see only the alert levels but there will be no system alert messages. It's best to test the indicator in realtime on M1 (1 min) chart
- you will only see 1 system alert per bar/60 sec when multiple alert levels are crossed with a single bar.
- you can only see the alert levels when the indicator is attached to chart, they are not shown by the system alert.
- a standard bidirectional cross is used for all penetration sources
1. uses plot*, cross*, alertcondition
Zindarra Multi Alerts Pro (9 Levels) by RRBZindarra Multi Alerts Pro by RRB by RagingRocketBull 2018
Version 1.0
This indicator lets you configure multiple alert levels for an asset. Zindarra Multi Alerts Pro supports 9 custom alert levels.
You have to manually create an alert in Manage Alerts Panel and configure it to use with this indicator.
Free accounts are limited to only 1 alert slot and this indicator will take it (any existing alerts must be disabled/stopped).
Once the alert is configured, the indicator can be removed from chart to free a slot for another indicator, but you won't see the alert levels.
If you want 10 alert levels and don't need colors and Pro features - use Multi Alerts Simple version instead.
Features:
- 9 custom alert levels with labels
- 2 plot modes: plot and price line
- high/low or close level penetration modes
- show/hide levels/labels
- change color based on level position above/below price
- keep or auto disable triggered alerts
- trigger alerts only after a confirmed close
- swap level colors
Usage:
1. attach indicator to a chart
2. define alert levels in UI settings
3. in TradingView's Manage Alerts panel on the right:
- for free accounts: disable/stop all existing alerts, you are limited to 1 alert slot only. Otherwise you won't be able to save.
- create a new Alert:
- select 'Multi Alerts' indicator name in the Condition dropdown box, leave Level 1 and Multi Alerts Cross as default options
- select 'Once Per Bar' or 'Once Per Minute' instead of 'Only Once' to trigger the alert multiple times
5. click Save. Your 9 alerts are enabled now.
Change Settings:
1. change levels/settings in UI. Any changes will also reset already triggered level colors/visibility.
2. in Manage Alerts panel:
- open/edit the alert you created
- select new instance of 'Multi Alerts' indicator name in the Condition dropdown box (appears at the bottom)
- check the Condition dropdown again - a single instance should remain selected.
3. click Save. Your alert settings are updated.
Notes on using alerts:
- attaching this indicator to a chart and configuring alert levels will not automatically enable the alerts - you have to manually create/configure a new alert in the Alerts Panel
- removing this indicator from chart will not disable the alerts, you have to manually disable the alert you created in the Alerts Panel
- your alert in the Alerts Panel uses another instance (copy) of indicator/settings. Any changes won't affect the alert. You have to manually update the alert every time you change any settings in the indicator.
- recompiling and attaching your own version of indicator will require creating a new Alert (delete the old one).
- alerts are designed to work in realtime. In replay mode you will see triggered alert levels hiding/changing colors but there will be no system alert messages. It's best to test the indicator in realtime on M1 (1 min) chart
- you will only see 1 system alert per bar/60 sec when multiple alert levels are crossed with a single bar. However all of these levels will hide/change color in the indicator as expected.
- plot modes: price line - changes color of the whole level, style is not configurable; plot - changes color of a level's segment after each cross, configurable style
- you can only see the alert levels when the indicator is attached to chart, they are not shown by the system alert.
- For source=high/low a directional level penetration is used automatically (crossunder/low and crossover/high). For source=close a standard bidirectional cross is used. Colors always change above/below close.
1. uses plot*, cross*, alertcondition
MA cross strategy VtsThe simple Moving average cross strategy is here implemented.
I guess there are multitudes of similar scripts around.
I post this one since I was asked by some friends, and I'll let it free to use for anybody.
Here you can choose the year where to start backtesting, the source, the type of MA, the SL and TP multiplicators of ATR, for which you can also choose the averaging period.
Feel free to modify this script. I would be grateful if you could preserve the first lines of comments including my user names.
The MA cross strategies can be very effective, especially when used on the daily TF.
Try for example the combo EMA15-EMA30 SL=1.5ATR TP=1ATR on EURCHF daily to get an impressive 83% win ratio.
Or EMA20-EMA81 on the GBPCHF to get an 87%.
In those cases where EMA does not perform well, try to set a less lagging MA, like the Hull MA.
I hope you like this script so that you could push the like button multiple (odd) times and you start following me.
I've got a bunch of other interesting scripts to share.
Comments and suggestions are welcome.
MA CrossA simple configurable MA Cross (3 MAs) script. You can choose between SMA and EMA , you will get arrows up or down when MAs cross each others. The arrows have different transparency and length parameters so you can easily identify them:
- small arrow and the most transparent for fast and medium MA crosses
- medium arrow for fast and slow MA crosses
- long arrow with no transparency for medium and slow MA crosses
Default values that can be changed:
- MA type = EMA
- Source for all MAs = close
- Fast MA length = 20
- Medium MA length = 50
- Slow MA length = 200
I plan on adding feartures overtime.
2 Moving Average Cross SignalsThis indicator is meant to aid those who use Moving Average crosses as part of their trading strategy. This can be used to help identify turning points in trends.
You can customize what timeframe the MAs are derived from (e.g. can use current timeframe, or can hold it to 1d timeframe across all other timeframes)
When the fast and slow MAs cross each other, the background of the candle where the cross happened will be highlighted green or red (changeable), this will help visualize where the crosses are happening, regardless of whether or not you actually want the moving average lines printed on the charts. This could help keep the chart less cluttered.
Finally, you can choose between SMAs, EMAs, WMAs, and Linear MAs.
Enjoy
55EMA 200MA Cross Philakone Swing StrategyBased on the lessons of Philakone when we see the golden cross its a buy signal when we see the second cross this means death cross sell signal.
Hermes Scalping Study by ZekisA simple scalping indicator, based on Highs and Lows.
It's working in any timeframe, the only condition is ... volatility .
Values are already set, but you can change them according to your preferences and to your chart.
Alerts are enabled.
Enjoy!
@ Zekis