TradingView
Durbtrade
2022年3月1日午前1時59分

Moving Averages System - Durbtrade 

Bitcoin all time history indexINDEX

詳細

Moving Averages System - Durbtrade

1 indicator... customizable.

Displays up to 4 independent Moving Averages (MA's) at once.

Each MA can be 1 of 6 "MA Types" : SMA, EMA, WMA, VWMA, HMA, or DEMA.

There are 7 individual fills...
4 "MA/Source Fills" and 3 "MA/MA Fills".

The "Source" is selectable,
and there is a "Source Plot" option
to display a plot of the source.

No max value for MA "Length".
Each MA has what I call a "Length Multiplier",
and each MA has its own "Offset".

The colors of each MA,
as well as the Source Plot,
can be up/down "Color-Changing", or solid.
"Line Thickness" is unlimited.

Each of the 3 "MA/MA Fills" allow you to select which 2 of the 4 MA's to fill between!

All 7 fills are customizable by above/below colors, and opacity.

All 7 fills include a "Color Swap" option,
in the case that you need to switch the display of the above-color to the below-color,
and the below-color to the above-color!

All plots are scripted to be drawn visually in front of all fills!

Lastly, you can turn off the display of the MA plots and the Source Plot...
allowing the display of only fills!


--------------------------------------------



--------------------------------------------


Let's take a more detailed look!


First, let's go through the settings, and how to use the Moving Averages System.

You can divide the Inputs tab of the indicator settings into 3 main sections...
1 - Moving Averages
2 - Source Plot, and MA/Source Fills
3 - MA/MA fills




Let's discuss the first section, which is where we set up our MA's.

Here, we see the parameters for our 4 Moving Averages :


All 4 MA's can be customized here in the following ways...
- Toggle ON/OFF by checking the checkbox
- Length
- Length Multiplier
- Type (SMA, EMA, WMA, VWMA, HMA, or DEMA)
- Up/Down Color Change ON/OFF
- Line Thickness
- Offset

(The Plot Styles, Up/Down/Solid Colors, and Opacities of all 4 MA's
are customizable under the Style tab of the indicator settings)

There are no maximum value limitations for Length, Line Thickness, and Offset.

Of note, the "Length Multiplier" multiplies the "Length" value by a chosen integer.
This can be used to incrementally scan a wide spectrum of lengths very quickly.
Or it can be used to maintain ratios while increasing the MA display lengths...
just multiply all lengths by the same number.
It can also be used to easily create a moving average ribbon
by using multiple Moving Average Systems all at once.
Or, it can be another method to set up higher-timeframe MA's on a lower-timeframe chart...
for example, if both the chart and indicator are on the 1Hour timeframe,
you can multiply all of your set lengths by 24
to see the 1Day MA's of those same lengths on the 1Hour chart.


Next, lets look at the second section of the Inputs tab of the indicator settings,
where we edit the "Source Plot" and "MA/Source Fills".

We can turn ON/OFF the "Source Plot" -
which plots a line of the "Source" that you have selected -
and edit the parameters :


Checking the "Source Plot" box turns the "Source Plot" ON/OFF.
You can turn Up/Down Color Change ON/OFF,
and adjust Line Thickness and Offset.

(The Plot Style, Up/Down/Solid Colors, and all Opacities of the Source Plot
are customizable under the Style tab of the indicator settings.)

Next is where you can turn ON/OFF and edit each "MA/Source Fill".

Checking the "MA#1/Source Fill" box turns on the fill between MA#1 and the source.
You can choose the color and opacity for the above-color and the below-color.
Need to switch the display of the two colors?... turn on "Color Swap" to easily do just that.

The remaining 3 MA/Source Fills work in the same exact way...
turning on a fill between the associated MA#, and the source.
In total, there are 4 MA/Source Fills... 1 for each MA.

Note that neither the Source Plot, nor any of the MA's, need to be turned on
in order to use the MA/Source Fills.


Finally, lets look at the third section of the Inputs tab of the indicator settings.

This is where we can edit the 3 "MA/MA Fills".
An MA/MA Fill allows you to select any 2 of the 4 MA's that you have set,
and fill the space between them with color :


Checking the MA/MA Fill box turns ON/OFF the associated MA/MA Fill.
Below each ON/OFF switch are 2 boxes where you can select the 2 MA's that you want to fill between.
Select the 2 MA's that you want to use according to their MA#'s.
Next, you have the Above/Below Color/Opacity for the associated MA/MA Fill,
and lastly, the Color Swap option.

The numerical order of the MA#'s that you select here is of no concern,
because each MA/MA Fill has that "Color Swap" option...
and, as before, this swaps the display of the above-color and the below-color.

Note that the MA's do not need to be turned on
in order to use the MA/MA Fills.


--------------------------------------------


Additional Notes :

All colors and opacities of this indicator can be customized.

All fills can have above/below colors, and all plots can have up/down colors.
All fills and plots can be one static color, too.

All plots can be 1 of 10 plot styles:
Line, Line with Breaks, Step Line, Step Line with Diamonds, Histogram,
Cross, Area, Area with Breaks, Columns, or Circles.

All plots use the same single "Source", which is selectable.

And don't forget... you can try applying this indicator to other indicators!


--------------------------------------------


Now, let's take a look at some examples of the Durbtrade Moving Averages System in action!


All 4 MA's plots on, MA Type is SMA, color-changing on, lengths 50, 100, 150, and 200 :



Add the Source Plot, and all 4 MA/Source Fills :



Add the 3 MA/MA fills :



Turn off candles visibility, and turn off MA color-change :



Turn off the MA plots :



Turn off the Source Plot :



...


Here are some other images using the Multi Moving Average Tool :






Here it is on the 1Second :



Here it is on the 3Day :



Here is your 1Day SMA DeathCross :



Use 3 Moving Average Systems at once to build your own EMA Ribbon :



Compare 4 different MA types, all with the same length :



--------------------------------------------


Script Stats :

Pinescript Version : 5
Code Length : 149 Lines
Total Plots : 16
- Visible Plots : 5 (4 MA Plots, 1 Source Plot)
- Invisible Plots : 11 (4 MA Plots, 1 Source Plot, 6 MA/MA Fill Plots)
Total Fills : 7 (4 MA/Source Fills, 3 MA/MA Fills)
Total Colors/Opacities : 29
Total Unique Variables : 92
- Input Variables : 69
- Unique Output Variables : 23


--------------------------------------------


Final Thoughts :

I'm excited to share the Durbtrade Moving Averages System!
I think that this indicator has a wide range of MA-related applications,
an easy-to-use interface with maximum customization, and unique fill features...
all in one indicator.
I feel that it is a quick and useful tool
whether you are just plotting a few moving averages...
or you are creating intense kaleidoscopic tidal waves of colored data!

Either way, I think it is pretty awesome,
and so, I wanted to share it with you...
I hope that you enjoy it and find it useful!


- Please feel free to comment your thoughts, critiques, or suggestions. They are all very helpful!
- Also, please feel free to comment any positive feedback, or awesome screencaps/ideas of the indicator in action!
- Check out my other Pinescript indicators if you like this one... they work well together.
- I hope that you find this script useful.
- Enjoy!


--------------------------------------------



// Durbtrade



コメント
NoOneWhoIsSomeone
Wow! This deserves front page. Incredibly insightful post and I can tell you spent a long time piecing this one together. It is basically a crash course for your Moving Averages. I will definitely be back to this post. Awesome job, awesome script!
Durbtrade
Sweet!
Thanks @NoOneWhoIsSomeone
Your feedback means a lot to me, I really appreciate it!
So glad that you like the script, as well as the post...
and thank you so much for the kind donation!!!
that's fantastic ✌
Magnum76
"Holy Batcave....Batman!" - Robin. "The Force Is Strong With This One. - Master Yoda.
Outstanding explanations for this Indicator and how to use it. Very detailed and time consuming. Much appreciated for the walkthrough. Can see myself making this one a routine player if you in the future add the Tilson Moving Average as well as the McGinley Moving Average (if and when time ever permitted). VERY few indie creators are adding these 2 as moving average variable choices! Would be a further diversification to your current smorgasbord of menu choices. Adding a couple more moving averages....as in a total of 6 instead of the current 4 will probably make other traders also drop using some of the similar indicators they are already using. Hopefully this Indie gets some "play" which would warrant additional enhancements and evolution. Hmm, wondering out loud if you tried the zero-lag form of the EMA Moving Average in comparison with the standard EMA. I see you have added the Double.
Durbtrade
@Magnum76, thanks a lot for your great comment!

Excellent points! I certainly will consider each of your recommendations!
When it comes to indicators, i like understanding HOW the displayed data was arrived to...
figuring out how to write the DEMA script in pine on my own, and understanding it, was a cool experience,
and the other MA types that you recommend would indeed be the next logical level from this point!
As for adding more MA's, it's possible, but it seems that for each MA that i add, the # of lines of code increases exponentially, given the nature of this script.
Therefore, I felt the specific limits that I chose for this indicator were a nice balance of functionality, user-friendliness, inclusiveness, and load/display speed.
Perhaps down the road, i will look at doing other versions of this indicator, allowing people to choose which version best supports their needs!
Thanks for the positive feedback, and for sharing your thoughts! Awesome!
Magnum76
@Durbtrade, Ohh, the default 4 moving averages you currently have is excellent. No real need to go beyond that. I think adding Tilson and McGinley choices would be time better spent. Look around....I've never seen a single McGinley MA added to these type of multiple Moving Average type of Indicators. And only a couple that include Tilson. NONE, obviously that have BOTH along with your current builtin Moving Average selections. Testing your Indicator on Crypto EMA vs Double EMA - earlier entries on Double, however a bit more false entries/exits. Hence, I may move to Double. The "McGinley Dynamic Range" Indicator by jasondhadley may be something for you to look at. Overlook that it was published in 2016 and has weak screenshots that do not show it off like the way you effectively do with your own published Indicators. Add to your chart and change the length variables. Maybe something there for you to incorporate in version 2 of THIS excellent Indicator.
Durbtrade
Great info! Also, don't forget, that if you need more MA's, you can just apply 2 Moving Average System indicators to your chart to have 8 MA's.
Magnum76
@Durbtrade, Playing with 3 sets. :)
詳細