Biên tập viên chọn
OPEN-SOURCE SCRIPT

RedK Momentum Bars (RedK Mo_Bars)

Cập nhật
Momentum Bars (Mo_Bars) offers a different way to visualize (relative) momentum - and uses some simple TA concepts to provide a different perspective into how we read momentum changes and incorporate that in our trading.

The idea here (and the script itself) is really super simple, and is (very loosely) inspired by Elder's Impulse System (EIS) - then evolved to leverage some other concepts, and to become less cluttering and "easier to read".

The construction of the Mo_Bars
---------------------------------------------
The base concept utilizes 3 moving average lines :
  • the first line is a relatively fast MA with a short length - acts as the main price tracking line

  • the second line is slightly slower than the main line - 2 to 3 bars longer length - and will by default use the open value as source - this works better to identify when the closing price starts to move faster than the open (as in, bars more frequently close higher than they open) - this line acts as the signal line - there's an added setting for an additional delay that utilizes regular WMA smoothing - the delay acts to magnify the relative displacement between the 2 MAs

  • for both these MA's, i choose to use the RSS MA (Lazy Line) - other MA types can be used, but the reason i used that MA type specifically is that it moves "gracefully" - and 2 Lazy Lines moving together minimizes whipsaws from small price swings - i tested with other MA types and found that the RSS has an advantage there.

  • the third line is a much slower MA (length 5 to 6 x the fast line) - and acts as a filter or a baseline. When we're above that line, we should favor long positions - we're in bull territory. When we're below that line we favor short positions, and we're in bear territory. Adjust this line as it suits your trading style and time frame.
    (I choose to use WMA as the MA type for the filter line .. and there's a good reason for that - which i'll skip for now - but in future versions, we can add other selectable MA types. )


    Using Mo_Bars
    ----------------------------
  • at a very broad level, we can use Mo_Bars similar to how we use a MACD - both are centered and unrestricted oscillators - note the difference that Mo_Bars is based on 3 MA's rather than 2.

  • the Mo_Bar bar length reflects the distance between the main MA and the signal MA - plotted relative to the baseline (filter line) - that means that the length of the bar represents the relative momentum between the 2 MA's - The Mo_Bars are then colored in a way that reflects increase or decrease in the value of that momentum (the visual here may have been inspired by another indicator recently published by one of our esteemed wizards - it worked perfectly - so due credits here :)

    -- in simple terms, if the main MA is below the signal MA, the bar is red - and when the main MA is above the signal MA, the bar is green - a white bar usually shows up when there's a detected change of relative momentum direction (note that this is not the same as the trend direction - and that's what helps show and exploit convergence and divergence - similar to a MACD)


* in the chart above, i noted few examples of how visualizing relative momentum in this way exposes areas of chop (Mo_Bars above zero but are in red or moving down, or when Mo_Bars are below zero and green or moving up) - convergence / divergence with price - and how this can act to expose the possibility of potential changes in price action or trend.

* there's so much more to play around with this setup - and maybe if there's enough interest there can be future dedicated posts on how utilize or even to evolve it further - there's a lot of potential here, to add more filters (maybe volume based), alerts, signals...etc - so let's see the interest :)


Here's the detailed (top chart) setup that Mo_Bars is based on -- The settings for the MA's on the price charts have been matched / sync'ed with the Mo_Bars settings on the lower panel to demonstrate how the script works and how it translate the MA action on the price chart to what we see below.

ảnh chụp nhanh

As always, please play around with the indicator to get used to how it works - use it in tandem with other indicators to get proper confirmations and adjust settings to suit your own trading style, time frame, and instruments

Feedback and thoughts are always welcome --- good luck!
Phát hành các Ghi chú
RedK MoBars v2.0 with Some Quick Additions
=======================================
- Added options for MA types for the fast, slow and filter MA's, so users can mix and match - or experiment with various setups
-- the default values & types have not changed from v1.0, and these represent my personal preference
-- Available MA Types are: RSS_WMA, WMA, EMA, SMA, and HMA -- i do not recommend using RSS_WMA or HMA for the filter line - given how these MA's behave with long lengths - but again it's up to your own preference.

- some code cleanup

here's a sample chart showing how MoBars v2.0 setup looks like and the available choices

ảnh chụp nhanh
Phát hành các Ghi chú
Momentum Bars (Mo_Bars) v3.0 Update:
---------------------------------------------------
1 - Enable support to different TF's than the chart's
2 - Slightly improved visual for the filter (zero) line
3 - Default values changed to align to the most commonly used 3x MA cross-over set-up (SMA 10, 20, 50) -- MA types and other options are still available thru indicator settings
4 - Added alerts for when the Fast MA crosses the Filter MA, indicating possible swing between bullish and bearish
5 - Some other code commentaries

Here's how MoBars v3.0 looks against a classic MACD (settings sync'ed) and also showing the 3x MA set-up on the price panel (which inspired the MoBars) - this view shows the additional insights that MoBars can reveal when compared to the classic MACD - showing both the minor and major signals (MACD only shows one of them) - Will post a more detailed tutorial about this view in the near future.

ảnh chụp nhanh
Centered Oscillatorsmo_barsMomentum Indicator (MOM)momentum_barsMoving Averagesredk

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Thông báo miễn trừ trách nhiệm