AMACD - All Moving Average Convergence Divergence

EltAlt 업데이트됨   
This indicator displays the Moving Average Convergane and Divergence ( MACD ) of individually configured Fast, Slow and Signal Moving Averages. Buy and sell alerts can be set based on moving average crossovers, consecutive convergence/divergence of the moving averages, and directional changes in the histogram moving averages.

The Fast, Slow and Signal Moving Averages can be set to:
Exponential Moving Average ( EMA )
Volume-Weighted Moving Average ( VWMA )
Simple Moving Average ( SMA )
Weighted Moving Average ( WMA )
Hull Moving Average ( HMA )
Exponentially Weighted Moving Average (RMA) ( SMMA )
Symmetrically Weighted Moving Average ( SWMA )
Arnaud Legoux Moving Average ( ALMA )
Double EMA ( DEMA )
Double SMA (DSMA)
Double WMA (DWMA)
Double RMA ( DRMA )
Triple EMA ( TEMA )
Triple SMA (TSMA)
Triple WMA (TWMA)
Triple RMA (TRMA)
Linear regression curve Moving Average ( LSMA )
Variable Index Dynamic Average ( VIDYA )
Fractal Adaptive Moving Average ( FRAMA )

If you have a strategy that can buy based on External Indicators use 'Backtest Signal' which returns a 1 for a Buy and a 2 for a sell.
'Backtest Signal' is plotted to display.none, so change the Style Settings for the chart if you need to see it for testing.
릴리즈 노트:
Added a case for no signal smoothing, when signal length = 1.
Re-wrote calcMA as a switch, much more pleasing on the eye.
Removed all the security fluff which I'd never even read, "terms of the Mozilla Public License 2.0" is more comprehensive anyway.
Added check boxes to quickly disable some of the default plots.
릴리즈 노트:
Version 3.00
• Added options to generate open and close for both long and short positions. So if you are in a long position and your criteria for a negative signal is met it will close your long, if another negative signal is generated it will open a short. If you're just trading the crossover this will keep you permanently trading short or long, as it's only when there are two or more consecutive signals are generated that will move you from longs to shorts.
• Plots a Green Triangle for Open Long, a Green Square for Close Long, a Red Triangle for Open Short and a Red Square for Close Short.
• To do this I needed to track the sate of open deals. Could have done this with variables but thought plotting it may help, so "Deal State" plots a 1 if it's in a long, 0 if no deals are open and -1 if it's in a short, to display.none. Enable it in Stlye Settings if you need it for testing.
• If you'd prefer that it just worked as it did before with simple Buy / Sell signals, which makes sense if you're just trading the crossover, disable the 'Generate Close Signals for Long / Short Positions' setting.
• Now that it can generate Open Long, Close Long, Open Short and Close Short signals I added a 'Long / Short Signals' section in settings, where you can specify what signals your backtester is expecting for each state.
• Moving averages are now plotted to display.none as well in case you want to see the price and the moving averages for testing. You're much better off running my other script 'Any Ribbon' on the top pane to show the moving averages ribbon, but these options enable you to show them here if you want to.
• Added the option to buy / sell based on the moving average crossing zero, thanks Bu Bader!
릴리즈 노트:
• Added filters for MACD above and below zero.
• Added the option to buy / sell based on divergences between the price and the MACD. Thanks to Trading View for the 'Divergence Indicator' and @DaviddTech for his idea to use that as the basis for a MACD Divergence script.
• REMEMBER you can't trigger a divergence before a local top or bottom is CONFIRMED by closing some bars after that local top or bottom. Replay some bars to see how far after the divergence the signal will actually fire.
• Added a bunch of tool tips, I bet there are spelling mistakes in some, tell me if so.
릴리즈 노트:
3.02 • When 'Generate Close Signals for Long / Short Positions' was disabled close long was plotting as open short (-1). Fixed the logic. Thanks for the testing Bu Bader!
릴리즈 노트:
3.03 • More signal weirdness, re-wrote the logic completely.
릴리즈 노트:
• I've had requests to filter based on a few different indicators, I think that the script is getting too complicated as it is and I don't want to add a bunch of filters that only one person may use. So I added the option to filter based on the output of an external indicator. You can enable or disable trading based any indicator hitting the levels that you set. I've tested a few indicators but you need to to confirm that your indicator is filtering as you expect it to. Enable the plot of 'Trades Enabled' in Style Settings to see if trades are enabled (1) or disabled (0). I expect that this was requested to only open longs in an uptrend etc. so it may not be helpful if you want to open longs and shorts. Thanks Jason5480 for hack_utils that made this easier.
• The external filter will stop new trades starting but it won't stop any existing trades closing.
• The MACD > 0 filter may not have stopped existing deals closing, changed that so that they can close.
• Added check to do nothing when buy and sell fire in the same bar.
• Corrected signal for consecutive short orders.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.


이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?