Giter VIP home page Giter VIP logo

andreperez / stochastic-oscilators-collection Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 5.0 380 KB

This is a collection of Stochastic indicators. It's developed in PineScript for the technical analysis platform of TradingView.

Home Page: https://www.tradingview.com/u/andre_007

License: MIT License

indicator pinescript pinescript-indicators stochastic-volatility-models technical-analysis trading tradingview tradingview-pine-scripts stock

stochastic-oscilators-collection's Introduction

logo

Stochastic Oscilators

Summary ๐Ÿ’Š

This is a collection of Stochastic indicators. It's developed in PineScript for the technical analysis platform of TradingView.

Motivation ๐Ÿ’Š

Here I developed some customized versions of Stochastic Oscilators. Basically, I took a lot of interesting ideas from various authors, and put them all together. Implementations:

  1. Script developed in PineScript 4
  2. Possibility to choose two themes ("Deep Purple" and "Blue and Red")
  3. Possibility to choose the type of moving average applied to both indicator and signal
  4. Histogram with gradient colors, emphasizing the strength of momentum
  5. Crossover and crossunder signs
  6. Coloring bars like the histogram
  7. Background fill between indicator and signal lines

Each indicator has it's own defaults. For example, in SMI (Stochastic Momentum Index) the indicador and signal lines uses the Exponential Moving Average (EMA). Here we can choose them.

In this script, the following moving averages can also be used:

  • Simple (SMA)
  • Exponential Moving Average (EMA)
  • Double Exponential (DEMA)
  • Triple Exponential (THEME)
  • Weighted (WMA)
  • Smoothed (SSMA)
  • Least Squares (LSMA)
  • Hull
  • Arnaud Legoux

There are 256 possibilities...

Example:

alt

Caution ๐Ÿ’Š

No technical indicators are 100% accurate as they can sometimes generate false signals.

You should never rely on a single indicator and always use a range of them when making trading decisions.


How to use this tool ๐Ÿ’Š

Place the indicator in TradingView. Than simply choose the parameters.


Definitions ๐Ÿ’Š

1. What is "Stochastic"?

Generally speaking, a process can be defined as stochastic when a set of random variables x produce a set of random results y, and the results of y, although random, can be segable sequentially of time.

Examples of stochastic processes:

  • fluctuations in stock markets and exchange rates;
  • medical data such as temperature, blood pressure, data from an electroencephalogram;
  • turbulent flow of a liquid or gas;
  • variations in the Earth's magnetic field.

2. What is the "Stochastic Oscilator"?

The Stochastic Oscillator (STOCH) was developed by George Lane in the 1950's.

The stochastic oscillator was designed to indicate when a market becomes overbought or oversold within a trading range. The indicator produces readings between zero and 100.

The first line (known as %K) displays the current close in relation to a user-defined period's high/low range. The second line (known as %D) is a simple moving average of the %K line. Now, as with most indicators, all of the periods used within Stochastic can be user defined. That being said, the most common choices are a 14 period %K and a 3 period SMA for %D.

So, the stochastic indicator (%K) is calculated as follows:

%K = SMA(100 * (Current Close - Lowest Low) / (Highest High - Lowest Low), smoothK)

where:

  • Lowest Low = The lowest price within the number of recent bars in the look-back period (periodK input)
  • Highest High = The highest price within the number of recent bars in the look-back period (periodK input)

And the second line (known as %D) is a simple moving average of the %K line. It's serve to minimize whipsaws while remaining in the larger trend.

%D is calculated as follow:

%D = SMA(%K, periodD)

Example of STOCH Oscilator

2. What is Stochastic Momentum Index (SMI) Ergodic ๐Ÿ“ˆ

The Stochastic Momentum Index (SMI) is a more refined version of the stochastic oscillator, employing a wider range of values and having a higher sensitivity to closing prices.

While the original STOCH from 1950's is limited in range between 0 and 100, in SMI the range is expanded to -100 and 100. So it can be negative or positive.

The SMI is considered a refinement of the stochastic oscillator. It calculates the distance of the current closing price as it relates to the median of the high/low range of price. William Blau developed the SMI, which attempt to provide a more reliable indicator, less subject to false swings.

Example of Stochastic Momentum Index (SMI)

References ๐Ÿ’Š

  • Stocks & Commodities V. 15:12 (561-564): The Stochastic Oscillator by Joe Luisi
  • Stocks & Commodities V. 11:1 (11-18): Stochastic Momentum by William Blau
  • TradingView
  • Investopedia

Donations

  • BTC: 1PnerhP2C5xeGXxAkhxQX4rYrBUguGe1yh
  • LTC: LMhAfkzJoUHHWfFCcMnnQ4jdV4Vi9WZG3W
  • Stellar: GCPONJ5OX7KSEHBNPB2SKJZJGYSXTRN7ORYQXW443BLEFLS72ZVYISG2
  • Zcash: t1THe8JvsYqt7bmbFWkFpjssJhJLka6VAhk
  • Tron: TSVnEgtoYhRMwiRYfDFC51XfGNSpxse2yz

stochastic-oscilators-collection's People

Contributors

andreperez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.