Exotic SMA Explorations Treasure TroveThis is my "Exotic SMA Explorations Treasure Trove" intended for educational purposes, yet these functions will also have utility in special applications with other algorithms. Firstly, the Pine built-in sma() is exceedingly more efficient computationally on TV servers than these functions will be. I just wanted to make that very crystal clear. My notes elaborate on this in the code blatantly.
Anyhow, the simple moving average(SMA) is one of the most common averaging filters used in a wide variety of algorithms. "Simply put," it's name says a lot about it. The purpose of this script, is to demonstrate variations of it's calculation in a multitude of exotic forms. In certain scenarios our algorithms may require a specific mathemagical touch that is pertinent to our intended goals. Like screwdrivers, we often need different types depending on the objective we are trying to attain. The SMA also serves as the most basic of finite impulse response(FIR) algorithms. For example, things like weighted moving averages can be constructed by using the foundational code of SMA.
One other intended demonstration of this script, is running multiple functions for comparison. I have had to use this from time to time for my own comparisons of performance. Also, imbedded into this code is a method to generically and recklessly in this case, adapt an algorithm. I will warn you, RSI was NEVER intended to adapt an algorithm. It only serves as a crude method to display the versatility of these different algorithms, whether it be a benefit or hinderance concerning dynamic adaptability.
Lastly, this script shows the versatility of TV's NEW additions input(group=) and input(inline=) upgrades in action. The "Immense Power of Pine" is always evolving and will continue to do so, I assure you of that. We can now categorize our input()s without using the input(type=input.bool) hackTrick. Although, that still will have it's enduring versatility, at least for myself.
NOTICE: You have absolute freedom to use this source code any way you see fit within your new Pine projects. You don't have to ask for my permission to reuse these functions in your published scripts, simply because I have better things to do than answer requests for the reuse of these functions. Sufficient accreditation regarding this script and compliance with "TV's House Rules" regarding code reuse, is as easy as copying the functions in their entirety as is. Fair enough? Good!
When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. Have a profitable future everyone!
Finite
Combo Strategy 123 Reversal & Finite Volume Elements (FVE) This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The FVE is a pure volume indicator. Unlike most of the other indicators
(except OBV), price change doesn`t come into the equation for the FVE (price
is not multiplied by volume), but is only used to determine whether money is
flowing in or out of the stock. This is contrary to the current trend in the
design of modern money flow indicators. The author decided against a price-volume
indicator for the following reasons:
- A pure volume indicator has more power to contradict.
- The number of buyers or sellers (which is assessed by volume) will be the same,
regardless of the price fluctuation.
- Price-volume indicators tend to spike excessively at breakouts or breakdowns.
WARNING:
- For purpose educate only
- This script to change bars colors.
FVE - Finite Volume Elements [UTS]FVE is a money flow indicator but with two important differences from existing money flow indicators:
It resolves contradictions between intraday money flow indicators (such as Chaikin’s money flow) and interday money flow indicators (like On Balance Volume) by taking into account both intra- and interday price action.
Unlike other money flow indicators which add or subtract all volume even if the security closed just 1 cent higher than the previous close, FVE uses a volatility threshold to take into account minimal price changes.
General Usage
The FVE provides 3 types of signals:
The strongest signal is divergence between price and the indicator. Divergence can provide leading signals of breakouts or warnings of impending corrections. The classic method for detecting divergence is for FVE to make lower highs while price makes higher highs (negative divergence). An alternative method is to draw the linear regression line on both charts, and compare the slopes. A logical buy signal would be for FVE, diverging from price, to rise sharply and make a series higher highs and/or higher lows.
The most obvious and coincident signal is the slope of the FVE line. An upward slope indicates that the bulls are in control and the opposite for downward.
This is a unique and very important property of this indicator. Values above zero are bullish and indicate accumulation while values below zero indicate distribution. FVE crossing the zero line indicates that the short to intermediate balance of power is changing from the bulls to the bears or vice versa. The best scenario is when a stock is in the process of building a base, and FVE diverges from price and rises to cross the zero line from below, at a sharp angle. Conversely the crossing of the zero line from above is a bearish signal to liquidate positions or initiate a short trade.
Trend Visualisation
Optional: If the trend direction is DOWN the moving average is painted red. If the trend direction is UP the moving average is painted in green.
If the movement is FLAT then the color is grey.
Moving Averages
Five different types of Moving Averages are available for both FVE and the optional moving average of the FVE.
ALMA (Arnaud Legoux Moving Average)
Average Value
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
WMA (Weighted Moving Average)
Calculation Methods
Since Markos Katsanos presented the first version of the FVE in April 2003.
Since then there have been various adaptions and improvements on this indicator.
The following are choosable for calculating the FVE:
Thinkscript usethinkscript.com
Linnsoft www.linnsoft.com
Volatility Adapted traders.com
Finite Volume Elements (FVE) The FVE is a pure volume indicator. Unlike most of the other indicators
(except OBV), price change doesn`t come into the equation for the FVE (price
is not multiplied by volume), but is only used to determine whether money is
flowing in or out of the stock. This is contrary to the current trend in the
design of modern money flow indicators. The author decided against a price-volume
indicator for the following reasons:
- A pure volume indicator has more power to contradict.
- The number of buyers or sellers (which is assessed by volume) will be the same,
regardless of the price fluctuation.
- Price-volume indicators tend to spike excessively at breakouts or breakdowns.