OPEN-SOURCE SCRIPT

Stochastic Momentum Index (SMI) Refurbished

تم تحديثه
▮Introduction

Stochastic Momentum Index (SMI) Indicator is a technical indicator used in technical analysis of stocks and other financial instruments.
It was developed by William Blau in 1993 and is considered to be a momentum indicator that can help identify trend reversal points.
Basically, it's a combination of the True Strength Index with a signal line to help identify turning points in the market.

SMI uses the stochastic formula to compare the current closing price of an asset with the maximum and minimum price range over a specific period.
He then compares this ratio to a short-term moving average to create an indicator that oscillates between -100 and +100.

When the SMI is above 0, it is considered positive, indicating that the current price is above the short-term moving average.
When it is below 0, it is considered negative, indicating that the current price is below the short-term moving average.

Traders use the SMI to identify potential trend reversal points.
When the indicator reaches an extreme level above +40 or below -40, a trend reversal is possible.
Furthermore, traders also watch for divergences between the SMI and the asset price to identify potential trading opportunities.

It is important to remember that the SMI is a technical indicator and as such should be used in conjunction with other technical analysis tools to get a complete picture of the market situation.


▮ Improvements

The following features were added:

1. 7 color themes, for TSI, Signal and Histogram.
2. Possibility to customize moving average type for TSI/Signal.
3. Dynamic Zones.
4. Crossing Alerts.
5. Alert points on specific ranges.
5. Coloring of bars according to TSI/Signal/Histogram.


▮ Themes

Examples:
لقطة
لقطة
لقطة
لقطة
لقطة


▮ About Dynamic Zones

'Most indicators use a fixed zone for buy and sell signals.
Here's a concept based on zones that are responsive to the past levels of the indicator.'

The concept of Dynamic Zones was described by Leo Zamansky ( Ph .D.) and David Stendahl, in the magazine of Stocks & Commodities V15:7 (306-310).
Basically, a statistical calculation is made to define the extreme levels, delimiting a possible overbought/oversold region.

Given user-defined probabilities, the percentile is calculated using the method of Nearest Rank.
It is calculated by taking the difference between the data point and the number of data points below it, then dividing by the total number of data points in the set.
The result is expressed as a percentage.

This provides a measure of how a particular value compares to other values in a data set, identifying outliers or values that are significantly higher or lower than the rest of the data.


▮ What to look for

1. Divergences/weakening of a trend/reversal:
لقطة
لقطة

2. Supports, resistances, pullbacks:
لقطة

3. Overbought/Oversold Points:
لقطة


▮ Thanks and Credits

- TradingView and PineCoders: for SMI and Moving Averages
- allanster: for Dynamic Zones
ملاحظات الأخبار
Added new themes:
لقطة

Customization of levels for coloring themes:
لقطة

Some fine tuning of default parameters.
ملاحظات الأخبار
Fixed the visibility of Dynamic Zones. It was lagging behind the histogram/columns/TSI.
ملاحظات الأخبار
Small fix in histogram theme and label
ملاحظات الأخبار
The TSI and signal lines were blurred by the histogram.
ملاحظات الأخبار
New features added.
(Examples images are from my other indicator DMI SMI which has common parameters).

- Added customization limits for gradient theme (last theme in the list, which is now number 26):
لقطة
لقطة

- New themes added:
لقطة

Some examples:
لقطة
لقطة
لقطة
لقطة
لقطة
لقطة
لقطة
لقطة
لقطة
لقطة
لقطة
لقطة
ملاحظات الأخبار
Minor fixes to default colors.
ملاحظات الأخبار
Minor fixes:
- The term "Opacity" was not correct. The correct one is "Transparency".
- The default fill transparency value has been changed to 30.
ملاحظات الأخبار
- Added a parameter to customize the Histogram transparency level.
This can be useful to make the graph less cluttered in certain situations.
Below is an example with the type changed from Histogram to Area (in the Style tab), and then with the transparency level at 70%:
لقطة

- New themes added.
The themes were reorganized by value ranges, in order to facilitate the choice and future implementations:
لقطة

10 to 15 → Spectrum Blue-Green-Red
20 to 21 → Monokai
30 to 31 → Spectrum White-Green-Red
40 to 41 → Green-Purple
50 to 51 → Blue-Red
60 to 61 → Blue-Yellow
70 to 71 → Green-Red
80 to 81 → Green
90 to 91 → Purple
100 to 107 → Blue
120 to 123 → Blue-Aqua
130 to 133 → Blue-Green
140 to 153 → Red
160 to 161 → Red-Yellow
170 to 171 → Red-White
180 to 185 → White-Black
190 to 191 → Spectrum Blue-Red

Codes 190, 191:
لقطة
لقطة

- Fine adjustments were made in the standard parameters of Levels for TSI's Theme and Signal's Theme aiming at a better visualization of the colors.

- Added 2 color gradient format theme option for Histogram.
Example:
لقطة

- Improved crossing alert messages. There are now 8 alerts available:
1. 'TSI crossing above Signal when within limits'
2. 'TSI crossing below the Signal when within limits'
3. 'TSI exiting the Dynamic Zone at the top'
4. 'TSI entering the Dynamic Zone at the top'
5. 'TSI exiting the Dynamic Zone at the bottom'
6. 'TSI entering the Dynamic Zone at the bottom'
7. 'TSI crossing above the centerline'
8. 'TSI crossing below the centerline'

There are now two ways to add alerts over here:
لقطة

In the first form, technically speaking, the alert() function is used. This is the fastest way and works best with automations.
Alerts are chosen via indicator parameters. That done, then just add the "Any alert()" alert, as indicated in circle 1.

The second way is more laborious, but allows individual insertion of alerts.
Note that in this case, the checkboxes mentioned above make no difference.

Due to the added alerts using the alert() function, I had to remove the timeframe parameterization.

* Note: the example images are from my other indicator named "DMI Stochastic Momentum Index" as the parameters are similar.
ملاحظات الأخبار
Added parameter to choose a different timeframe.
ملاحظات الأخبار
1. Added trend lines with breakouts (thanks to HoanGhetti - tradingview.com/script/85fU3JnE-Simple-Trendlines/)
2. Added divergence detector (thanks to TradingView - tradingview.com/chart/?solution=43000589127)
3. Minor fixes in tooltips.
4. Minor change in default colors.
5. TSI Long Length changed from 21 to 8.
6. TSI Short Length changed from 8 to 5.
7. Added a repaint option (thanks for PineCoders).
8. Added a new option for Histogram: "Multiplier".
Using longer periods, the histogram can become flattened, making it difficult to see. The multiplier solves that.
9. Added separate parameters for histogram.
10. Unecessaries 'var' removed.
11. Source for price changed from hl2 to close.
12. Added separate alerts for TSI crosses inside/outside Dynamic Zone, with separate bounds for both.
Crossing points were repositioned to facilitate visualization.
13. Removed alertcondition function to permit show divergence detector (due to limitation of maximum number of elements in screen).
Centered OscillatorsdynamiczonesSMIStochastic OscillatorTrue Strength Index (TSI)TSI

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعد‎‎قوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟


To contribute to my work:
⚡Bitcoin Lightning: forwardocean64@walletofsatoshi.com
🟠Bitcoin: bc1qv0j28wjsg6l8fdkphkmgfz4f55xpph893q0pdh
🔵PayPal: paypal.com/donate/?hosted_button_id=D9KRKY5HMSL9S
يعمل أيضًا:

إخلاء المسؤولية