MotiveWave Docs
MotiveWave.com
  • User Guide
    • Welcome
    • Quick Start Guide
      • Getting Started
      • Installation
      • Customization Options
      • Advanced Features
      • Troubleshooting and Support
      • Next Steps
    • Console Overview
      • Preferences
      • Changing the Look and Feel
      • Desktops
      • Quote Sheets
      • Backup and Restore
      • Repository
      • Email Configuration
      • Docking Framework Guide
        • Introduction
        • Stations
        • Pages
        • Layouts
        • Customization
    • Accounts Panel
      • Simulated Account
      • Commissions
    • Alerts
    • Charts
      • Settings
      • Chart Spacing
      • Bar Sizes
      • Importing Data
      • Exporting Data
      • Birds Eye View
      • Cursor Data
      • Depth Of Market
      • Chart Labels
      • News
      • Watermark
      • Scaling
      • Analyses
      • Ratios
      • Time and Price Guides
      • Percent Change Charts
      • Software Development Kit
      • Lock Studies
      • Lock Scroll
      • Study Templates
      • Linking Charts
      • Working With Chart Windows
      • Ticker Tape
      • Chart Trading
      • Data Export Groups
      • Analyses Guide
        • Introduction
        • Managing Analyses
        • Sharing Analyses
    • Components
    • Depth Of Market
    • Elliott Wave
    • Hurst Cycles
      • Introduction
      • Study Overview
      • Using the Hurst Cycle Study
    • Instruments
      • Custom Instruments
    • Option Chain
    • Order Flow
      • Introduction
      • Time Price Opportunity (TPO) Study
      • Volume Imprint
      • Depth of Market
      • Time and Sales
      • Delta Volume
      • Cumulative Delta
      • Bid/Ask Volume
      • Speed of Tape
      • DOM Power
      • Order Heatmap
      • Big Trades
      • Speed Gauges
      • Components
    • Pages
    • Preferences
      • General
      • Theme
      • Chart
      • Toolbar
      • Sounds
      • Ratios
      • Elliott Wave
      • Harmonics
      • Historical Data
      • Orders
      • Alerts
      • Email
      • Trade History
      • Buy/Sell
    • Replay Mode
    • Scanner
      • Scanner
      • Creating a Scan
      • Executing a Scan
      • Editing a Scan
      • Elliott Wave Scanner
      • Harmonic Scanner
      • Study Scanner
    • SDK Programming Guide
      • Preface
      • Change History
      • Introduction
      • Fundamental Classes
      • Overlay Example
      • Study Plot Example
      • Drawing Figures
      • Signals
      • Tick Data
      • Strategies
      • Logging
      • Internationalization
      • Deployment
      • Environment Setup
    • Shortcuts
    • Strategies & Backtest
      • Strategy Back Testing
      • Creating a Strategy Analysis
      • Strategy Analysis
      • Strategies
    • Studies
    • Time and Sales
    • Tool Bar
    • Trade Report
    • Watch List
    • Workspaces
  • Release Notes
    • Release Notes
    • What's New In Version 6.5
    • What's New in Version 6.4
    • What's New in Version 6.3
    • What's New in Version 6.1
    • What's New in Version 6.0
  • Knowledge Base
    • Getting Started
      • Add a Symbol to a Watch List
      • Create a New Page
      • Create a New Workspace
      • Free Data Sources
      • Linux Installation
      • Resize Console Panels
      • Set Up a Simulated Account
      • Does MotiveWave Come With Data?
      • Can MotiveWave Be Used on Multiple Computers?
      • Futures Symbol Table
    • Connection
      • Connection Details
      • Add a Connection to a Workspace
      • Rithmic - Connection Issues and Troubleshooting
      • Connect MotiveWave to R|Trader Pro Gateway
      • GAIN Connection
      • Indian Market Connections
      • Interactive Brokers Connection
        • Troubleshooting Interactive Brokers Connection
        • Historical Data is Slow with Interactive Brokers
      • CQG Symbology
      • TD Ameritrade Search
      • Rithmic Eurex Symbology
      • Computer Sleep Mode
      • IQFeed Data
      • Another Instance of MotiveWave Is Using License Key
    • Workspace
      • Add a Connection to a Workspace
      • Create a New Workspace
      • Create a Workspace Backup
      • Restore a Workspace Backup
      • Switch Connections in a Workspace
      • Workspaces Not Showing Up
    • Charts
      • Adjust for a Stock Split
      • Assign Trading Hours to an Instrument
      • Component and Study Visibility
      • Different Charts for the Same Instrument
      • Make Studies Stick to a Chart
      • Trend Lines Don't Line up on Different Bar Sizes
      • Use a Display Mask
      • Create Tick, Range, PnF, or Renko Chart
      • Clicking on the Tab of One Chart Changes Tab of Other Charts
      • Charts Stopped Streaming Data
      • Charts Show Incorrect Historical Data
      • Time Range Measurements Are Incorrect
      • Limited Tick Data on Charts
      • Set Start Time for Chart Bars
      • View List of Studies and Components on Chart
      • Show ETH or Extended Data
    • Trading
      • Position Average Is Changing Overnight
      • Execute Trades on Another Account
    • General
      • Change Themes
      • Define Trading Hours
      • Futures Contract Backfill
      • Reset the Console Layout
      • Set a Default Account
      • Set Up a Repository
      • Set Up Gmail for Email Alerts
      • Set Up iCloud Mail for Email Alerts
      • MotiveWave Covers Windows Taskbar
      • Limit Instruments in Quick Search
      • Can’t See My Menu Anymore
      • Trade Report Is Incorrect
    • Study
      • Component and Study Visibility
      • Order Heatmap Study Not Showing
      • Forex With Volume Related Studies
      • Add a Custom Study
      • Volume Imprint or TPO Overlap
      • Use Real Values
    • Elliott Wave
      • Elliott Wave Data Window vs Start Date
      • Elliott Wave Functionality
      • Show Multiple Elliott Wave Ratios
      • Stacked Wave Labels
    • Scan
      • What Do the Scanner Results Fair, Good, Etc. Mean?
    • SDK
      • Create a Custom Study or Strategy
    • Optimize - Backtest
      • Backtesting Limitations
    • Support
      • Access Log Files
      • Active Session Exists
      • Create a Workspace Backup
      • Find My License Key and Edition
      • Minimum System Requirements
      • MotiveWave Extensions Directory
      • Uninstall MotiveWave
      • Data Loss
      • Trendlines Shift on Nonlinear Charts
      • Slow Application Performance
    • Error Messages
      • Forex.com - Error Placing Order: 75
      • Binance - Connection Failed: Invalid API Key
      • Binance Futures - Unable to load listen keys
      • IQFeed - Error: Index 1 out of bounds for length 1
      • IQFeed - Connection Failed
      • State Error
      • Error Placing Order(s)
    • Purchase
      • Upgrade from a Lease to a Purchased License
      • Upgrade from a Lower Edition Purchased License to a Higher Edition Purchased License
      • Recently Purchased Where Is My License Key?
      • PayPal Payments
      • How Do I Cancel My Lease?
      • Are Updates to the Software Free?
    • FAQ
      • Can I Add Commentary
      • Can I Have a Simulated and a Live Trading Account
      • Can I Have More Than One Broker Account
      • Can I Save My Analysis
      • Can I Trade from the Chart
      • Can I Use MotiveWave on Multiple Computers
      • Does MotiveWave Support macOS
      • Does MotiveWave Support Multiple Computer Screens
      • How Do I Log in to MotiveWave
      • How Do I Make Point & Figure and Hybrid Renko Charts
      • How Do I Position and Size the Chart Windows on a Specific Screen
      • How Do I Save My Charts
      • How Do I Sync MotiveWave Between Two Computers
      • What Instruments Does MotiveWave Support
      • What Is Compact Mode for Chart Windows
      • Where Are the Chart Tools
  • Video Tutorials
    • Product Demos
    • Startup and Installation
    • Workspaces
    • Broker and Data Feed Connections
    • Overviews
    • General Configuration
    • Configuring Preferences
    • Charts
    • Analyses vs Alternate Analyses
    • Studies and Strategies
    • Trading
    • Alerts
    • Replay Mode
    • Scanners
    • Fibonacci
    • Harmonics
    • Elliott Wave
    • Webinars
    • Third Party Webinars
  • Studies
    • A - B
    • C - D
    • E - F
    • G - H
    • I - J
    • K - L
    • M - N
    • O - P
    • Q - R
    • S - T
    • U - V
    • W - X
    • Y - Z
Powered by GitBook
On this page
  • Schaff Trend Cycle (STC)
  • Seasonality
  • Sector Rotation Model
  • Sentiment Zone Oscillator (SZO)
  • Sharpe Ratio
  • Simple Moving Average (SMA)
  • Signal To Noise Ratio
  • SlowK Divergence
  • Smart Money Index (SMI)
  • SMI Ergodic Indicator
  • SMI Ergodic Oscillator (SMIEO)
  • Smoothed Moving Average
  • Smoothed Rate of Change
  • Sortino Ratio
  • Spearman Indicator
  • Speed Gauge
  • Speed of Tape
  • Spread
  • Standard Deviation
  • Standard Error Percent Average
  • Starc Bands
  • Stochastic Bars
  • Stochastic Fast Oscillator
  • Stochastic Slow Oscillator
  • Stochastic Full Oscillator
  • Stochastic Momentum Index (SMI)
  • Stochastic Regular
  • Stochastic SC
  • Stochastic RSI
  • SuperTrend
  • Support Resistance
  • Support And Resistance Oscillator
  • Swami Stochastics
  • Swing Points
  • Swiss Army Knife Indicator
  • Technical Rank
  • Three Lines
  • TFS MOB Indicator
  • TFS Tether Line
  • TFS Volume Oscillator
  • Tilson IE/2
  • Time Frame
  • Time Price Opportunity (TPO)
  • Trader's Dynamic Index (TDI)
  • Trend Analysis Index
  • Trend Momentum Volatility Volume (TMV)
  • Treynor Ratio
  • Triangular Moving Average (TMA)
  • Triple Exponential Moving Average (TEMA)
  • TRIX
  • Turbo Stochastic Fast
  • Turbo Stochastic Slow
  • Twiggs Money Flow
  • Two Pole Butterworth Filter
  1. Studies

S - T

PreviousQ - RNextU - V

Last updated 5 months ago

Disclaimer: The information provided on this page is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security. Please see our .

How to access the studies in MotiveWave:

Go to the top menu, choose Study>Study Group>Study Name

or Go to the top menu, choose Study>All Studies> Start typing in the study name until you see it appear in the list> Click on the study name> Click OK.

Schaff Trend Cycle (STC)

The Schaff Trend Cycle (STC) was developed by Doug Schaff, in an attempt to improve the Moving Average Convergence Divergence (MACD). This oscillator combines concepts of MACD and Stochastics analysis to generate faster and more precise trend detection and potential trading opportunities through crossovers. The MACD is calculated and then applied a Stochastic Oscillator formula to create an oscillator that ranges from 0 to 100. The thresholds 25 and 75 indicate the oversold and overbought levels, respectively. The reason that makes the STC more responsive to price actions is the inclusion of shorter cycle periods.

How to trade using the Schaff Trend Cycle (STC)

When the value is above 75, it indicates an overbought condition. If the STC falls below this overbought line, it provides selling opportunities. Conversely, the market enters an oversold condition when the value is below 25. If the STC crosses above the oversold threshold, it suggests buying opportunities.

The STC can also help with trend confirmation. A rising STC line indicates an upward trend and a falling STC line signals a downtrend.

In addition, traders can look at the divergence between the price and STC to identify potential reversals. If the price is at lower lows and the STC is at higher lows, it shows a sign of a bullish reversal. Conversely, if the price is at higher highs and the STC is at lower highs, there might be a bearish reversal.

Seasonality

Seasonality displays the average gain as a percentage that is relative to the start of the month or the year. The recurring market behaviors at specific times of the year can reflect potential price movements. Traders usually analyze Seasonality charts based on the historical price activities of an instrument. Some factors that affect Seasonality's patterns are the seasons (travel stocks in summer or retail stocks throughout the four seasons), the market cycles (harvesting seasons, oil drilling, or gasoline season, gold or silver), and economic or calendar events (holidays, tax deadlines, etc.)

MotiveWaveâ„¢ offers a projected line to provide potential trends in the future. Seasonality should be used in conjunction with other indicators, such as volume or moving averages to filter noises and false signals and confirm the trend.

Sector Rotation Model

Sector Rotation Model was authored by Giorgos Siligardos in the Stocks and Commodities Magazine, August 2012. Select daily bars only. S&P500 Exchange Traded Funds (ETF’s) Instruments are used as proxies for different sectors: XLF for the financial (bull) sector, XLY for the consumer discretionary (bull) sector, XLE for the energy (bear) sector, XLP for the consumer staples (bear) sector, XLU for the utilities (bear) sector. The Rate of Change (ROC) for each sector is used to form a bullish or bearish value. The difference of these values is plotted as an oscillator. The user may change the input (close), period (75), period length and instruments. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Sector Rotation Model

No trading signals are calculated for this indicator.

Calculation

//input = price, user defined, default is closing price //rocPeriod = user defined, default is 75 //instr1 = for financial sector use SP500 XLF //instr2 = for consumer discretionary sector use SP500 XLY //instr3 = for energy sector use SP500 XLE //instr4 = for utilities sector use SP500 XLU //instr5 = for consumer staples sector use SP500 XLP //index = current bar number

bull01 = roc(index, period, input, instr1);
bull02 = roc(index, period, input, instr2);
bear01 = roc(index, period, input, instr3);
bear02 = roc(index, period, input, instr4);
bear03 = roc(index, period, input, instr5);
bear = (bear01 + bear02 + bear03) / 3;
bull = (bull01 + bull02) / 2;
Plot: osc = 100 * (bull - bear);

    if (upColor.isEnabled() AND osc moreOrEqual 0) 
      setBarColor(index, OSC, upColor);
    endIf
    if (downColor.isEnabled() AND osc lessOrEqual; 0) 
      setBarColor(index, OSC, downColor);
    endIf

Sentiment Zone Oscillator (SZO)

The Sentiment Zone Oscillator (SZO) was authored by Walid Khalil in the Stocks and Commodities Magazine, May 2012. The SZO uses a triple exponential moving average (TEMA) of a plus-minus value, triggered by the current and previous closing prices. Overbought and oversold paths and adjustable guides are also given. The user may change the input (close), method (TEMA), period lengths, percent factor and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Sentiment Zone Oscillator

Adjust the top and bottom guides to control the quantity and quality of the trading signals. SZO values above 7 are considered to be overbought and therefore offer an opportunity to sell. SZO values below -7 are considered oversold and present an opportunity to buy. In addition to the guides, dynamic over-bought or over-sold paths are plotted. If the SZO is above the top guide or crosses above the over-bought path a sell signal will be generated. Conversely, if the SZO is below the bottom guide or crosses the over-sold path a buy signal will be given.

Calculation

//input = price, user defined, default is closing price //method = moving average, user defined, default is TEMA //period = user defined, default is 14 //longPeriod = user defined, default is 30 //index = current bar number

factor = fac/100;
prevPrice = price[index-1];
if (price moreThan prevPrice) r = 1;
else r = -1;
sp = ma(method, index, period, R);
Plot1: szo = 100 * sp / period;
highest = highest(index, longPeriod, SZO);
lowest = lowest(index, longPeriod, SZO);
range = highest - lowest;    
Plot2: ob = lowest + range * factor;
Plot3: os = highest - range * factor;
//Signals
sell = szo moreThan ob OR szo moreThan topGuide;
buy = szo lessThan os OR  szo lessThan bottG;

Sharpe Ratio

The original Sharpe Ratio (SR) was authored by William Forsyth Sharpe; it is given here with a correction done in 1994. It is designed to evaluate how well an investor is compensated for the risk taken. The higher the SR the better the instrument’s performance. The main ingredients are the current price and a prior price which are adjusted with the user-defined safe return. An average and standard deviation are taken; and the SR is their quotient. The user must select linear bars but may change the input (close), period length and a safe value. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Sharpe Ratio

The Sharpe Ratio may be used to evaluate an instrument’s performance. No trading signals are calculated.

Calculation

//input = price, user defined, default is close //period = p1, user defined, default is 30 //safe = safe return percentage, user defined, default is 2 //av = average, pow = power, index = current bar number //sma = simple moving average, sdDev = standard deviation

safe = safe / 100; //convert from percent to decimal
BarSize bar = getBarSize();
if (bar.getType() == BarSizeType.LINEAR) barMin = bar.getInterval();
else return;
minPerYr = 60*24*30*12;
barsPerYr = minPerYr/barMin;
adjSafe = Math.pow((1 + (safe)), p1/barsPerYr) - 1; //safe return per period compounded
priorP = price[index-p1];
ret = ((price/priorP)-1) - adjSafe; //safe return subtracted here to reflect Sharpe 1994 revision
av = sma(index, p1, RET);
std = sdDev(index, p1, RET)[0];
Plot: sharpe = av/std;

Simple Moving Average (SMA)

The Simple Moving Average (SMA) is a popular trend indicator that smooths out the price fluctuations by measures the average price of an asset over a specific period. It is an unweighted mean of the previous n bars. For example, a 10-day moving average of closing price is the mean of the previous 10 days’ closing prices. Traders use SMA to identify trend movements, both in short-term and long-term periods. The user may change the input (close), period length and shift number. Short-term SMAs reacts quickly to the price fluctuations and long-term SMAs, though are slower in response, but will smooth out false signals and noises. In addition, crossovers between the price and an SMA, or between SMA and SMA, or SMA and other moving averages can also suggest potential trading signals.

How To Trade Using Simple Moving Average

The Simple Moving Average is a lagging trend indicator and often be used in conjunction with other studies. When the SMA is moving upward, it indicates an uptrend. Meanwhile, if the SMA is moving downward, it indicates an downward trend.

No trading signals are shown; however, users can observe the crossovers of SMA with the price to make trading decisions. If the price rises over the SMA, it might indicate a buy opportunity. Conversely, if the price falls crosses below the SMA, traders might consider selling.

Calculation

This indicator’s definition is further expressed in the condensed code given in the calculation below.

//input = price, user defined, default is close //period = user defined, default is 20 //shift = user defined, default is 0 //sma = simple moving average //index = current bar number

Plot: sma = sma(index+shift, input, period);

Signal To Noise Ratio

The Signal To Noise Ratio was authored by John Ehlers; it is derived from his Hilbert Transform Indicator. Highs, lows, Euler’s logarithms, factors and feedback are applied to Hilbert’s complex number calculations to produce this indicators amplitude value. The user may change the input (midpoint) and Hilbert period length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Signal To Noise Ratio

The Signal To Noise Ratio may be used in conjunction with other indicators. No trading signals are calculated in this study.

Calculation

//input = price, user defined, default is midpoint price //Hilbert period = user defined, default is 7 //quad = quadrature = imaginary part of complex number //inPhase = real part of complex number //amp = amplitude //index = current bar number

iMult = .635;
qMult = .338;

priorPrice = price[index-period];
//v1 = detrend price
v1 = price - priorPrice;

high = series.getHigh(index);
low = series.getLow(index);
prevRange = range[index-1];
range = (.2 * (high - low)) + (.8 * prevRange);

v2 = v1[index-2];      
v4 = v1[index-4];      

inPhase3 = inPhase[index-3];      
quad2 = quad[index-2];      

//Hilbert transform complex number components, inPhase (real part), quad (imaginary part)
inPhase = 1.25 * (v4 - (iMult*v2) + (iMult*inPhase3));
quad = v2 - (qMult*v1) + (qMult*quad2);

prevV2 = v2[index-1];
//smoothed signal amplitude
v2 = .2 * (inPhase * inPhase + quad * quad) + .8 * prevV2;
prevAmp = amp[index-1];
//smoothed SNR in decibels 
if (v2 lessThan .001) v2 = .001;
if (range lessThan 0) 
      amp = .25 * (10 * Math.log(v2/(range*range))/Math.log(10) + 1.9) + .75 * prevAmp;
endIf
Plot amp;

SlowK Divergence

The SlowK Divergence (SKDV) was authored by www.bayou.com. The SKDV doubly smooths the slow K stochastic over two time periods. The user may change the input (close), method (SMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using SlowK Divergence

The SlowK Divergence may be used in conjunction with other studies. No trading signals are calculated for this indicator.

Calculation

//input = price, user defined, default is closing price //period1 = user defined, default is 9 //period2 = user defined, default is 3 //method = moving average (ma), user defined, default is SMA //stochK = stochastics fast K //sk = slow K, index = current bar number

fastK = stochK(index, period1, input);
sk = ma(index, period1, fastK);
Plot: skdv = ma(method, index, period2, SK);

Smart Money Index (SMI)

The Smart Money Index (SMI) is an indicator designed to observe the behaviors of institutional investors. These investors are often referred to as "Smart Money". The assumption is that organizations in the trading market have more opportunities for information and resources. Therefore, their decisions are potentially more precise compared to individual traders ( or "Dumb Money" traders), who are less informed and more emotional.

Developed by Don Hays, the SMI formula is as follows: SMI = Yesterday's SMI - Opening 30 min gain or loss + Today's Last hour change

Since the SMI is calculated based on intraday price movements of the Dow Jones Industrial Average (DJIA), the bar needs to be set to 1 day.

How to trade using the Smart Money Index (SMI)

A rising SMI indicates that trading institutions are buying. This activity will push the market price higher towards the end of the day, which shows a bullish sign. In contrast, the SMI will fall when the smart money traders sell. This movement will pull down the price at the end of the trading day, which means a signal of bearish.

SMI can also signal divergence and reversals. In terms of divergence, when the market is moving downward but the SMI is rising, it indicates a potential bullish trend and traders might consider buying. Conversely, if the market is moving up but the SMI is decreasing, it suggests a potential bearish divergence and a signal to sell. For trend reversals, if the SMI starts to increase after a steady period of downtrend, it indicates opportunities to buy whereas when the SMI begins to fall after a steady uptrend, traders might consider selling.

Since the SMI particularly uses the DJIA databases for overall insight into the market, it might not fully reflect the specific activities of institutional investors in the market. For more accurate readings, the SMI should be used in conjunction with other indicators to confirm the trend's strength and direction and trading signals

SMI Ergodic Indicator

The SMI Ergodic Indicator (or Stochastic Momentum Index Ergodic) is the same as the True Strength Index (TSI) developed by William Blau, except the SMI includes a signal line. The SMI uses double moving averages of price minus previous price over 2 time frames. The signal line, which is an EMA of the SMI, is plotted to help trigger trading signals. Adjustable guides are also given to fine-tune these signals. The user may change the input (close), method (EMA), period lengths and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using SMI Ergodic Indicator

Adjust the top and bottom guides to control the quantity and quality of the trading signals. In addition to the guides, if the SMI crosses the signal line a change in trend is predicted. If the SMI is above the top guide and crosses below the signal line a sell signal will be generated. Conversely, if the SMI is below the bottom guide and crosses above the signal line, a buy signal will be given. The 0 line divides the bulls (above) from the bears (below).

Calculation

//price (user defined, default is closing price) //method = moving average (user defined, default is EMA) //prevP = previousPrice //abs = absolute value //ma = moving average, index = current bar number //MT = moreThan //LT = lessThan

prevP = price[index-1];
change = price - prevP;
absChange = abs(price - prevP);
tempChange = ma(method, index, fastPeriod, change);
tempAbsC = ma(method, index, fastPeriod, absChange);
tempChange = ma(method, index, slowPeriod, tempChange);
tempAbsC = ma(method, index, slowPeriod, tempAbsC);
Plot1: SMI = tempChange / tempAbsC;
Plot2: SIGNAL = ma(method, index, sigPeriod, SMI);
//Signals
highSell = smi for last sell signal, reset to max_negative at each  buy signal;
lowBuy = smi for last buy signal, reset to max_positive at each sell signal;
sell=crossedBelow(SMI, SIGNAL) AND smi MT topGuide  AND smi MT highSell;
buy=crossedAbove(SMI, SIGNAL) AND smi LT bottomGuide AND smi LT lowBuy;

SMI Ergodic Oscillator (SMIEO)

The SMI Ergodic Oscillator (SMIEO) uses the SMI Ergodic Indicator. The SMI Ergodic Indicator uses the True Strength Index (RSI), developed by William Blau. The SMI manipulates double moving averages of price minus previous price over 2 time frames. The signal line, which is an EMA of the SMI, is subtracted from the SMI to create the SMI Ergodic Oscillator. The oscillator is displayed as a histogram. The user may change the input (close), method (EMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using SMI Ergodic Oscillator

The SMI Ergodic Oscillator may be used in conjunction with other indicators. The SMIEO is an expression of the RSI which is a momentum indicator. No signals are calculated for this oscillator.

Calculation

//price (user defined, default is closing price) //method = moving average (user defined, default is EMA) //prevP = previousPrice, index = current bar number //abs = absolute value //ma = moving average

prevP = price[index-1];
change = price - prevP;
absChange = abs(price - prevP);
tempChange = ma(method, index, fastPeriod, change);
tempAbsC = ma(method, index, fastPeriod, absChange);
tempChange = ma(method, index, slowPeriod, tempChange);
tempAbsC = ma(method, index, slowPeriod, tempAbsC);
SMI = tempChange / tempAbsC;
SIGNAL = ma(method, index, sigPeriod, SMI);
Plot: SMIEO = SMI - SIGNAL;

Smoothed Moving Average

The Smoothed Moving Average displays data for a given period of time (N). The formula for calculating this average is as follows: SMMA(i) = (SUM(i-1) – SMMA(i-1) INPUT(i))/N where the first period is a simple moving average.

How To Trade Using the Smoothed Moving Average

The Smoothed Moving Average is a lagging trend indicator and may be used in conjunction with other studies. No trading signals are calculated.

Calculation

//input = price, user defined, default is close //period = user defined, default is 20 //shift = user defined, default is 0 //smma = smoothed moving average //index = current bar number

smma = smma(index+shift,period,input);

Smoothed Rate of Change

The Smoothed Rate of Change is an oscillator that compares the current moving average with the moving average of N periods ago. The difference between the Rate of Change (ROC) indicator and its smoothed version is the ROC only compares the price while the Smoothed ROC compares the moving averages. This means the Smoothed ROC reduces data noise and helps avoid false signals. The result is a line that oscillates above and below zero (Smoothed ROC line). The second line is an exponential moving average of the first line (Signal line).

How to trade using the Smoothed Rate of Change

The crossovers between the Smoothed ROC line and the signal line provide insights into bullish and bearish market momentum. When the Smoothed ROC line crosses above the signal line, it suggests a bullish trend, and buy markers are generated. Conversely, when the Smoothed ROC line crosses below the signal line, it indicates a bearish trend, and sell markers are given. The buy signals are more reliable if they are below the zero line and in an uptrend. Meanwhile, it is a strong sign for selling if the signals are above the zero line and in a downward trend.

Additionally, the opposite directions of the price chart and the Smoothed ROC line can indicate potential divergences. For example, if the price is at lower lows, but the Smoothed ROC line is making higher lows, it might signal there will be an uptrend reversal. If the price is at higher highs, but the Smoothed ROC line is at lower highs, the trend might be reversed to a downtrend soon.

The Smoothed Rate of Change might be used in conjunction with other technical indicators.

Sortino Ratio

Sortino Ratio was authored by Frank A. Sortino. The Sortino is similar to the Sharpe Ratio except for the standard deviation component. It is designed to evaluate how well an investor is compensated for the risk taken. The higher the Sortino the better the instrument’s performance. The main ingredients are the current price and a prior price which are adjusted with the user-defined safe return. An average and standard deviation (minus part only) are taken, and the Sortino is their quotient. The user must select linear bars but may change the input (close), period length and a safe value. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Sortino Ratio

The Sortino Ratio may be used to evaluate an instrument’s performance. No trading signals are calculated.

Calculation

//input = price, user defined, default is close //period = p1, user defined, default is 30 //safe = safe return percentage, user defined, default is 2 //av = average, pow = power //sma = simple moving average, sdDev = standard deviation //index = current bar number

BarSize bar = getBarSize();
if (bar.getType() == BarSizeType.LINEAR) barMin = bar.getInterval();
else return;
minPerYr = 60*24*30*12;
barsPerYr = minPerYr/barMin;
adjSafe = Math.pow((1 + (safe)), p1/barsPerYr) - 1; //safe return per period compounded
priorP = price[index-p1];
ret = ((price/priorP)-1) - adjSafe; //safe return subtracted here to reflect Sharpe 1994 revision
av = sma(index, p1, RET);
stdMinus = sdDev(index, p1, RET)[2];
if (stdMinus != 0 )sortino = av / stdMinus;
Plot: sortino;

Spearman Indicator

Dan Valcu describes the Spearman Indicator in the Stocks and Commodities Magazine, February 2011. The indicator is named after Charles Spearman who was a British psychologist and mathematician of the late 19th and early 20th centuries. Spearman is an oscillator with values between +100 and -100. High plus values (+80) indicate an uptrend; high negative values (-80) represent a downtrend. A signal, which is a moving average of the Spearman, is also plotted. The user may change the input (close), method (SMA), period lengths and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Spearman Indicator

No trading signals are calculated for this indicator.

Calculation

//input = price, user defined, default is closing price //method = moving average, user defined, default is SMA //n = Spearman period, user defined, default is 10 //sigPeriod = signal period, user defined, default is 3

size = series.size();
r1[] = new int[n+1];
r22[] = new int[n+1];
r11[] = new double[n+1];
r21[] = new double[n+1];
temp = 0;
coefcorr = 0, sc = 0;
changed = 0, found = 0;
absum = 0, ab = 0, ab2 = 0 ;

for (int k = n; k lessThan size; k++ )
     for (int i = n; i moreOrEqual 1; i--)
        r1[i] = i;
        r22[i] = i;
        r11[i] = series.getDouble((k - n + i), key, 0);
        r21[i] = series.getDouble((k - n + i), key, 0);
      endFor
      //sort r21 descending
      changed = 1;
      while (changed moreThan 0)
        changed = 0;
        for (int i = 1; i lessOrEqual (n-1); i++)
          if (r21[i+1] lessThan r21[i])
            temp = r21[i];
            r21[i] = r21[i + 1];
            r21[i+1] = temp;
            changed = 1;
          endIf
        endFor
      endWhile
      ////
      for (int i = 1; i lessOrEqual n; i++)
        found = 0;
        while (found lessThan 1)
          for (int j = 1; j lessOrEqual n; j++)
            if (r21[j] == r11[i])
              r22[i] = j;
              found = 1;
            endIf
          endFor
        endWhile
      endFor
     /////////
      absum = 0;
      for (int i = 1; i lessOrEqual; i++)
        ab = r1[i] - r22[i];
        ab2 = ab * ab;
        absum = absum + ab2;
      endFor
      coefcorr = 1 - ((6 * absum) / (n * ((n * n) - 1)));
      Plot: sc = 100 * coefcorr;
      Plot: sig = ma(method, k, sigPeriod, SC);
 end

Speed Gauge

Speed Gauge is a tool that illustrates the current market speed. Four gauges can be shown for one instrument and users can choose their statistical options, from Ticks to Volume or Delta DOM. The gauge provides insights into the current pace of the market, and how fast the prices are changing through multiple aspects.

Speed of Tape

Speed of Tape presents the speed of the market by displaying the number of a chosen statistic ( ticks or volume) that has occurred in the last interval. This indicator helps traders identify the market momentum, divergence, and insights into the market sentiments. The Speed of Tape can also reflect the relationship between the price and volume. Users should set bar sizes in small time-frames (minutes), as the speed interval for Speed of Tape is seconds.

How to trade using the Speed of Tape

The bar height presents the speed of the tape. Significant changes are highlighted in the main chart and are associated with changes in the tape. The higher the bars, the faster the trading activities.

In case the tape shows an increase in price, along with a large amount of volume orders, it suggests a strong bullish trend. Therefore, traders can consider going long. Conversely, when the price is falling on high-volume orders, it indicates a strong bearish trend and traders can consider going short. Up and down markers will appear to support decision-making. On the other hand, price movements with a low volume of orders might reflect false signals and a weak trend.

The Speed of Tape can also provide insights into divergence and potential reversals. If the tape is slowing down but the price is advancing, it indicates the uptrend is slowing down and there might be a reversal happening soon. If the tape is accelerating but the price shows signs of dropping, it suggests a strong downtrend.

In addition, the tape is a helpful tool for intraday momentum trading, and day traders can use it to access market sentiment and gauge price movements during the day.

Spread

The Spead study computes the difference between two instruments and displays their relationship and performance in a Spread chart. The difference is often calculated by subtracting the price of one instrument from another's, but there are other calculation types (subtract, add, multiply, and divide) that users can choose from and can be found in the Operation option. Users can also adjust the multiplier values to generate desired results.

How to pair-trade using Spread

Different types of operations can provide multiple aspects of two instruments' relationships.

For Subtracting, users can apply Spread to identify mean reversion that signals a long or short position. The idea behind Mean Reversion is that after a sudden spike in trend, the prices tend to revert to their historical averages. This means if the spread has been expanding (or narrowing), it might shrink (or widen) to the average range soon, and traders could go long or short until the spread becomes normal. For example, if the Spread = Instrument A - Instrument B, and it is widening, traders can sell A and buy B expecting that the prices of A will drop and B's will rise to come back to the mean Spread soon. Conversely, when the spread is narrower than the average, traders can expect that the prices of A will soon increase and B's will fall to expand to the normal range, and therefore decide to go long on A and short on B.

When combining the prices of two instruments, it can show an overall performance for both. When their total values create a bullish trend, it suggests opportunities for both instruments to enter a long position. Similar to a bearish movement of the combined values, it might be a sign of going short.

When the price of an instrument is divided by another's, the Spread is the ratio that reflects their correlation and performance. If the Spread = Instrument A / Instrument B, and the ratio is greater than 1, it indicates that Instrument A is performing better than Instrument B, relatively. In this case, traders should consider buying instrument A or selling instrument B. Conversely, when the ratio is less than 1, it indicates that instrument A is underperforming compared to instrument B, relatively and it signals to go long on instrument B or go short on instrument A.

Standard Deviation

Standard Deviation (SD) is a statistical measure of the actual value compared to an average value, the greater the difference, the higher the standard deviation. Two lines are plotted, the SD times a user-defined factor, and a signal line which is a moving average of the SD. The user may change the input (close), method (SMA), period lengths and standard deviation factor. Standard Deviation helps identify market volatility and risk management. A high SD indicates the price is moving dramatically while a low SD suggests the market's prices have been more stable or consolidated.

How To Trade Using Standard Deviation

If the stdDev crosses below the Signal line (downward trend) a sell signal is generated. Conversely, if the stdDev crosses above the Signal line (upward trend) a buy signal is given.

Standard Deviation might be used in conjunction with other indicator, such as RSI or MACD for confirmations.

Calculation

The Standard Deviation's definition is further expressed in the condensed code given in the calculation below.

//input = price user defined, default is closing price //method = moving average user defined, default is SMA //stdDev = standardDeviation //stdFac = standardDeviationFactor user defined, default is 1 //ma = moving average, index = current bar number

stdDev = std(index, sdPeriod, input);
Plot1: stdDev = stdDev * stdFac;
Plot2: ma = ma(method, index, maPeriod, stdDev);
//Signals
sell = crossedBelow(stdDev, ma);
buy = crossedAbove(stdDev, ma);

Standard Error Percent Average

Standard Error Percent Average is part of Standard Error Bands by Jon Anderson, Stocks and Commodities Mag. 09/1996. This study should be used with R Squared, Linear Regression Slope and Bollinger Bands®. The user may change the input (close) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Standard Error Percent Average

Calculation

//input = price, user defined, default is close //period = user defined, default is 21 //sDegPeriod = user defined, default is 3 //av = average, index = current bar number //sma = simple moving average //y = value on the price axis, x = value on the time axis (bar number)

inputV = price[index];
ret[] = sumMore(index, period, input);
sumV = ret[0];  //v = value user input usually close
sumV2 = ret[1];  //sum of value squared
sumVx = ret[2];  //sum of value * x
sumX2 = ret[3]; //sum of x squared
avX = ret[4];
avV = ret[5];
sdEr = 0.0;
numB = sumVx - (period * avX * avV);
denB = sumX2 - (period * avX * avX);
calcB = numB / denB;
calcA = avV - (calcB * avX);
value1 = sumV2 - (calcA * sumV ) - (calcB * sumVx);
value2 = period - 2;
value3 = value1 / value2;
sdEr = sdEr[1]; sumVx = ret[2];  //default value * x
lin[] = linRegLine(sDegPeriod, input, 0);
linRegY = lin[0];   //y value at position 0
if (value3 moreThan 0) sdEr = sqrt(value3);
linRegS = sma(index, sDegPeriod, linRegY);
sErr = 2 * sma(index, sDegPeriod, sdEr);
Plot: PA = (inputV - (linRegS-sErr)) / ((linRegS+sErr) - (linRegS-sErr)) * 100;

Starc Bands

Starc Bands are overlays used in conjunction with Bollinger Bands® to create trading signals. Starc bands are calculated by adding/subtracting a multiple of Average True Range (ATR) from a simple moving average. Bollinger Bands® are similar except standard deviation is used in place of ATR. The user may modify the input (close), method (SMA), periods and multipliers. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Starc Bands

Adjust the bandwidths with multiplier factors to control the quantity and quality of the trading signals. The trend is calculated from the slope of the ma. If a high goes above the bands and it is a downtrend, a sell signal is generated. Conversely, a buy is given if a low goes below the bands and it is in an up trend.

Calculation

//input = price (user defined, default is closing price) //method = moving average (user defined, default is SMA) //atr = average true range //ma = moving average //bb = bollinger bands //prev = previous, index = current bar number //MT = more than, MOE = more or equal //LT = less than, LOE = less or equal //mult = multiplier factor

Plot1: ma = ma(method, index, maPeriod, input);
atr = atr(atrPeriod);
atr = atr * atrMult;
Plot2: upperStarc = ma + atr;
Plot3: lowerStarc = ma - atr;
bb[] = bollingerBands(bbPeriod, bbMult, bbMult, input);
Plot4: bb[0];   //bbTop
Plor5: bb[1];  //bbBottom
//Signals
prevMa = ma[index-1];
sell = prevMa MT ma AND high MT bb[0] AND high MT upperStarc AND sellStock;
buy = prevMa LT ma AND low LT bb[1] AND low LT lowerStarc AND buyStock;
if (sell) sellStock = false; buyStock = true;
if (buy) sellStock = true; buyStock = false;

Stochastic Bars

The Stochastic Oscillator was promoted by Dr. George Lane in the 1950s. Stochastic Bars changes the color of the price bars if the Stochastic value is above or below certain user-defined values. Stochastics is often used to indicate overbought (top of range) or oversold (bottom of range) conditions. The oscillator’s basic calculation is 100*(current price-period low)/(period high-period low). The user may change the method (EMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Stochastic Bars

Stochastic Bars may identify overbought and oversold conditions. If the Stochastic value is more than the top level, it indicates an overbought situation, the bars will change to the buy color, suggesting selling. Conversely, if the Stochastic value is less than the bottom level, it indicates an oversold situation, the bars will change to the sell color, suggesting buying.

Calculation

//method = moving average (ma), user defined, default is EMA //kPeriod = user defined, default is 14 //slowPeriod = user defined, default is 3 //fastPeriod = user defined, default is 3 //top = user defined, default is 80 //bottom = user defined, default is 20 //index = current bar number //MOR= more or equal, LOR= less or equal

//stochasticK=100*(currentClose-lowest)/(highest-lowest); highest and lowest are for kPeriod
highest = highest(index, kPeriod, HIGH);
lowest = lowest(index, kPeriod, LOW);
denom = highest - lowest;
K = 100 * (close - lowest) / denom );
//Calculate the Slow MA
slowK = ma(method, index, slowPeriod, K);
fastK = ma(method, index, fastPeriod, slowK);
if (use d period)
     value = fastK
else
    val = slowK
endif
//Signals
setBarColor(val,top,bottom);
buy = val MOR= top;
sell = val LOR= bottom;

Stochastic Fast Oscillator

The Stochastic Oscillator was promoted by Dr. George Lane in the 1950s. It is often used to indicate overbought (top of range) or oversold (bottom of range) conditions. The oscillator’s basic calculation is 100*(current price-period low)/(period high-period low). The user may change the method (EMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Stochastic Fast

Stochastic is a momentum indicator. If the %K line (pk) crosses above the %D line (pd), a buy signal is generated. Conversely, if the %K line (pk) crosses below the %D line (pd), a sell signal will be given.

Calculation

//method = moving average (ma), user defined, default is EMA //kPeriod = user defined, default is 14 //maPeriod = user defined, default is 3 //signalPeriod = 1 index = current bar number

//stochasticK=100*(currentClose-lowest)/(highest-lowest); highest and lowest are for kPeriod
K = stochasticK(index, kPeriod));
pk = ma(method, index, maPeriod, K);
signal = ma(method, index, signalPeriod, pk);
pd = signal;
buy = crossedAbove(pk, pd);
sell = crossedBelow(pk, pd);

Stochastic Slow Oscillator

The Stochastic Oscillator was promoted by Dr. George Lane in the 1950s. It is often used to indicate overbought (top of range) or oversold (bottom of range) conditions. The oscillator’s basic calculation is 100*(current price-period low)/(period high-period low). The user may change the method (EMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Stochastic Slow

Stochastic is a momentum indicator. If the %K line (pk) crosses above the %D line (pd), a buy signal is generated. Conversely, if the %K line (pk) crosses below the %D line (pd), a sell signal will be given.

Calculation

//method = moving average (ma), user defined, default is EMA //kPeriod = user defined, default is 14 //maPeriod = user defined, default is 3 //signalPeriod = 3 index = current bar number

//stochasticK=100*(currentClose-lowest)/(highest-lowest); highest and lowest are for kPeriod
K = stochasticK(index, kPeriod));
pk = ma(method, index, maPeriod, K);
signal = ma(method, index, signalPeriod, pk);
pd = signal;
buy = crossedAbove(pk, pd);
sell = crossedBelow(pk, pd);

Stochastic Full Oscillator

The Stochastic Oscillator was promoted by Dr. George Lane in the 1950s. It is often used to indicate overbought (top of range) or oversold (bottom of range) conditions. The oscillator’s basic calculation is 100*(current price-period low)/(period high-period low). This is a fully configurable version of the Slow Stochastic Oscillator. The user may change the method (EMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Stochastic Full

Stochastic is a momentum indicator. If the %K line (pk) crosses above the %D line (pd), a buy signal is generated. Conversely, if the %K line (pk) crosses below the %D line (pd), a sell signal will be given.

Calculation

//method = moving average (ma), user defined, default is EMA //kPeriod = user defined, default is 14 //maPeriod = user defined, default is 3 //signalPeriod = user defined, default is 3 //index = current bar number

//stochasticK=100*(currentClose-lowest)/(highest-lowest); highest and lowest are for kPeriod
K = stochasticK(index, kPeriod));
pk = ma(method, index, maPeriod, K);
signal = ma(method, index, signalPeriod, pk);
pd = signal;
buy = crossedAbove(pk, pd);
sell = crossedBelow(pk, pd);

Stochastic Momentum Index (SMI)

The Stochastic Momentum Index (SMI) provides a refinement of the Stochastic Oscillator. In comparison, the SMI shows where the close is relative to the midpoint of the same range. The SMI ranges between +100 and -100 and is somewhat less erratic than a Stochastic Oscillator over the same period. The user may change the method (EMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Stochastic Momentum Index

If the SMI crosses above the SIGNAL line, a buy signal will be generated. Conversely, if the SMI crosses below the SIGNAL line, a sell signal will be given.

Calculation

//method = moving average (ma), user defined, default is EMA //high low Period = hlPeriod = user defined, default is 2 //maPeriod = user defined, default is 8 //smoothPeriod = user defined, default is 5 //signalPeriod = user defined, default is 5 //index = current bar number

HH = highest(index, hlPeriod, HIGH);
LL = lowest(index, hlPeriod, LOW);
M = (HH + LL)/2;
D = getClose(index) - M;
HL = HH - LL;    
D_MA = ma(method, index, maPeriod, D);
HL_MA = ma(method, index, maPeriod, HL);
D_SMOOTH = ma(method, index, smoothPeriod, D_MA);
HL_SMOOTH = ma(method, index, smoothPeriod, HL_MA);
HL2 = HL_SMOOTH/2;
SMI = 0;
SMI = 100 * (D_SMOOTH/HL2);
SIGNAL = ma(method, index, signalPeriod, SMI);
//Signals
buy = crossedAbove(SMI, SIGNAL);
sell = crossedBelow(SMI, SIGNAL);

Stochastic Regular

How To Trade Using Stochastic Regular

Adjust the top and bottom guides to control the quantity and quality of the trading signals. FK values above 70 are considered to be overbought and therefore offer an opportunity to sell. FK values below 30 are considered oversold and present an opportunity to buy. If the FK is above the top guide and crosses below the SK, a sell signal will be generated. Conversely, if the FK is below the bottom guide and crosses above the SK, a buy signal will be given. The 50 line divides the bulls above from the bears below.

Calculation

//input = price, user defined, default is closing price //fkPeriod = user defined, default is 5 //skPeriod = user defined, default is 3 //method = moving average (ma), user defined, default is SMA //fk = fast k, sk = slow k (or fast d) //sma = simple moving average, index = current bar number

Plot1: fk = stochK(index, fkPeriod, key);
Plot2: sk = ma(method, index, skPeriod, fk);
//Signals
highSell = sk for last sell signal, reset to max_negative at each  buy signal;
lowBuy = sk for last buy signal, reset to max_positive at each sell signal;
sell = crossedBelow(FK, SK) AND sk moreThan topGuide  AND (sk moreThan highSell);
buy = crossedAbove(FK, SK) AND sk lessThan bottGuide AND (sk lessThan lowBuy);

Stochastic SC

This Stochastics SC or Stochastic Custom calculation uses close, highest highs and lowest lows. The numerator (price- lowest) and denominator (highest – lowest) are separately smoothed before being turned into an oscillator referred to as the Stochastic Custom K (SCK). The SCK is then smoothed to produce the Stochastic Custom D (SCD) which is used as a signal line. Adjustable guides are given to fine-tune the trading signals. The user may change the input (close), period lengths, and signal method. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Stochastics SC

Adjust the top and bottom guides to control the quantity and quality of the trading signals. SCK values above 70 are considered to be overbought and therefore offer an opportunity to sell. SCK values below 30 are considered oversold and present an opportunity to buy. If the SCK is above the top guide and crosses below the SCD, a sell signal will be generated. Conversely, if the SCK is below the bottom guide and crosses above the SCD, a buy signal will be given. The 50 line divides the bulls above from the bears below.

Calculation

//input = price, user defined, default is closing price //fkPeriod = user defined, default is 7 //ckPeriod = user defined, default is 3 //cdPeriod = user defined, default is 12 //method = moving average (ma), user defined, default is SMA //diff = difference, num = numerator, den = denomator //av = average, sma = simple moving average

highest = highest(fkPeriod, HIGH);
lowest = lowest(fkPeriod, LOW);
diff = highest - lowest;
num = price - lowest;
den = diff;
avNum = sma(ckPeriod, NUM);
avDen = sma(ckPeriod, DEN);
if (diff moreThan 0)
    if (ckPeriod lessOr= 1) sck = num / den * 100;
    else sck = avNum / avDen * 100;
endIf
Plot1: sck;
Plot2: scd = ma(method, cdPeriod, SCK);
//Signals
highSell = sck for last sell signal, reset to max_negative at each  buy signal;
lowBuy = sck for last buy signal, reset to max_positive at each sell signal;
sell = crossedBelow(SCK, SCD)  AND sck moreThan topGuide AND (sck moreThan highSell);
buy = crossedAboveSCK, SCD) AND sck lessThan bottGuide AND (sck lessThan lowBuy);

Stochastic RSI

The Stochastic RSI oscillator measures the level of the RSI (Relative Strength Index) as compared to its range over a given time period. The RSI is used as the foundation, and the Stochastics formula is applied to produce an oscillator that fluctuates between 0 and 1. The user may change the input (close), period length and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Stochastic RSI

Adjust the top and bottom guides to control the quantity and quality of the trading signals. If the K crosses above the top guide a sell signal will be generated. Conversely, if the K crosses below the bottom guide, a buy signal will be given.

Calculation

//input = price, user defined, default is closing price //period = user defined, default is 14 //index = current bar number //LT = less than, LOE = less or equal //MT = more than, MOE = more or equal

//Step 1: Calculate the RSI

prevPrice = price[index-1];
diff = price - prevPrice;
up = 0, down = 0;
if (diff moreThan 0) up = diff;
else down = diff;
down = Math.abs(down);
avUp = ma(rsiMethod, index,  rsiPeriod, UP);
avDn = ma(rsiMethod, index,  rsiPeriod, DOWN);
dSum = avUp + avDn;
rsi = (avUp / dSum) * 100.0;

//Stochastics calculation  
high = highest(index, fastKPeriod, RSI);
low = lowest(index, fastKP, Values.RSI);
fastK = 0;
if (high == low) fastK = 100;
else fastK = (rsi-low) / (high-low) * 100;
Plot2: slowk = ma(sigMethod, index, slowKPeriod, FASTK);
Plot3:sig = ma(sigMethod, index,  sigPeriod, SLOWK);

//Signals
prevK = K[index-1];
sell = crossedBelow(SLOWK, SIG) AND slowk moreThan topGuide;
buy = crossedAbove(SLOWK, SIG) AND slowk lessThan bottGuide;

SuperTrend

SuperTrend study is a popular trend indicator created by Olivier Seban. It is an overlay line that plots the multiplication of the Average True Range (ATR) and a multiplier to determine the distance and sensitivity of the line from the midpoint, depending on the trend direction. Users can adjust the ATR period and multiplier value to suit their trading style. A high ATR and multiplier will generate fewer false and more reliable signals, which is helpful for long-term readings. Meanwhile, a lower ATR with a small multiplier makes the SuperTrend response to changes quicker, which is suitable for short-term trading.

A SuperTrend line will change colors depending on its position with the price. This indicator is a simple and dynamic tool that displays trend directions, buy/sell signals and can act as a trailing stop loss.

How to trade using the SuperTrend line

When the SuperTrend line is red and above the price chart, it indicates a bearish trend, and therefore, a sell signal will be generated. Conversely, when the SuperTrend line is green and falls below the price line and turns green, it signals a bullish trend and signals a buying opportunity.

Due to its dynamic features, the SuperTrend line can be used as a trailing stop loss. When the SuperTrend line and price line cross, it indicates a potential trend reversal and therefore, an exit to lock in profits or minimize losses.

The SuperTrend line might be used in conjunction with other indicators such as RSI. MACD, Moving Averages, or Stochastic oscillator to confirm reliable signals.

Support Resistance

Support levels indicate the price where investors believe that prices will move no lower. In contrast, resistance levels indicate the price at which investors believe the price will move no higher. The user may change the input (close) and period length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Support Resistance

Adjust the top and bottom guides to control the quantity and quality of the trading signals. When the price drops to the support line, offering an opportunity to sell. When the price reaches the resistance line, there is an opportunity to buy.

Calculation

//high input = price, user defined, default is close //period = user defined, default is 20 //prev = previous, sma = simple moving average //LT = less than, LOE = less or equal //MT = more than, MOE = more or equal //supp = support, res = resistance

prev = price[index-1];
current = price[index];
sma = sma(index-1, period, input);
crossAbove = (prev LT sma AND current MOE sma);
crossBelow = (prev MT sma AND current LOE sma);
res = res[index-1]; 
supp = supp[index-1]; 
if (crossBelow) 
    // Calculate new resistance point
    res = highest(index,  period, HIGH);
end
if (crossAbove) 
    // Calculate new support point
    supp = lowest(index,  period, LOW);
end
if (res == null) 
      res = highest(index,  period, HIGH);
end
    if (supp == null) 
      supp = lowest(index,  period, LOW);
end
Plot1: supp;
Plot2: res;

Support And Resistance Oscillator

Support And Resistance Oscillator was authored by Art Putt. True Range, Highs, Lows, Opens and Closes all contribute to the construction of this oscillator; which is equipped with adjustable guides and highlighted as a tri-colored histogram. The user may change the input (close) and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using SupportAndResistance Oscillator

Adjust the top and bottom guides to control the quantity and quality of the trading signals. SRO values above .70 to .80 are considered to be overbought and therefore offer an opportunity to sell. SRO values below .30 to .20 are considered oversold and present an opportunity to buy. If the SRO peaks above the top guide a sell signal will be generated. Conversely, if the SRO troughs below the bottom guide a buy signal will be given. The .50 line divides the bulls (above) from the bears (below).

Calculation

//input = price, user defined, default is closing price //index = current bar number

tRange = getTrueRange(index);
close = price[index];
sro = 0;
if (tRange != 0) sro = ((High - open) + (close - Low)) / (2 * tRange);
 //Signals
highSell = sro for last sell signal, reset to max_negative at each  buy signal;
lowBuy = sro for last buy signal, reset to max_positive at each sell signal;
sell = (sro moreThan topGuide) AND (sro moreThan highSell);
buy = (sro lessThan bottGuide)  AND (sro lessThan lowBuy);

Swami Stochastics

How To Trade Using Swami Stochastics

No trading signals are calculated for this indicator.

Calculation

//minPeriod = user defined, default is 12 //maxPeriod = user defined, default is 48 //MT = more than, LT = less than //index = current bar number

  protected void calculate(int index, DataContext ctx)
    int minPeriod = getSettings().getInteger(Inputs.MIN_PERIOD);
    int maxPeriod = getSettings().getInteger(Inputs.MAX_PERIOD);
    if (minPeriod MT maxPeriod) 
      int tmp = maxPeriod;
      minPeriod = maxPeriod;
      maxPeriod = tmp;
    end
    getRuntimeDescriptor().setFixedBottomValue(minPeriod);
    getRuntimeDescriptor().setFixedTopValue(maxPeriod);
    if (index+1 LT minPeriod) return;
    
    DataSeries series = ctx.getDataSeries();
    int count = maxPeriod - minPeriod;
    // Calculate the stochastic
    ColorRange range = new ColorRange(series.getStartTime(index));
    double pNum[] = (double[])series.getValue(index-1, Values.NUMERATOR);
    double pDenom[] = (double[])series.getValue(index-1,Values.DENOMINATOR);
    double pStoch[] = (double[])series.getValue(index-1, Values.STOCH);
    double num[] = new double[count];
    double denom[] = new double[count];
    double stoch[] = new double[count];
    
    for(int i = 0; i LT count; i++) 
      int period = i + minPeriod;
      Double high = series.highest(index, period, Enums.BarInput.HIGH);
      Double low = series.lowest(index, period, Enums.BarInput.LOW);
      
      if (high == null || low == null) break;
      
      num[i] = (series.getClose(index) - low + (pNum == null ? 0 : pNum[i]))/2;
      denom[i] = (high - low + (pDenom == null ? 0 : pDenom[i]))/2;
      
      if (denom[i] != 0) 
        stoch[i] = 0.2*(num[i]/denom[i]) + 0.8*(pStoch == null ? 0 : pStoch[i]);
      end
      
      int R = 255;
      int G = 255;
      
      if (stoch[i] MT 0.5) R = (int)(255*(2 - 2*stoch[i]));
      else G = (int)(255*2*stoch[i]);
      
      range.addRegion(new Color(R, G, 0), period, period+1);
    end
    addFigure(range);
    
    series.setValue(index, Values.NUMERATOR, num);
    series.setValue(index, Values.DENOMINATOR, denom);
    series.setValue(index, Values.STOCH, stoch);
  end

Swing Points

Swing Points draw lines connecting swing points from top to bottom. A different color is used for the line if it breaks the previous swing point. The user may change the strength value. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Swing Points

Adjust the top and bottom guides to control the quantity and quality of the trading signals. If the prices reach swing highs, sell signals will be given. If the prices approach swing lows, buy signals will be given.

Calculation

//strength = user defined, default is 10 //index = current bar number

Code may be available on request.

Swiss Army Knife Indicator

Swiss Army Knife Indicator (SAKI) was authored by John F. Ehlers. As the name implies the SAKI is many indicators in one. The basic ingredients are the current price, the previous price, a prior price and feedback. A host of mathematical functions and constants, including pi, sine, cosine, square root and a good portion of the Greek alphabet, are used. The proper ingredients for the calculation of the chosen indicator are applied to a general formula. The user may choose a type from a list of 9 indicators. The user may change the input (midpoint), type, period and a delta1 factor. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Swiss Army Knife Indicator

No trading signals are calculated for any of these indicators.

Calculation

//input = price, user defined, default is midpoint price //type = indicator, user defined, default is E-SMA //period = user defined, default is 20 //delta1 = user defined, default is 0.1 //E-EMA = indicator, type of exponential moving average //E-SMA = indicator, type of simple moving average //GAUSS = indicator, BUTTER = indicator //SMOOTH = indicator, HP = indicator //2PHP = indicator, BP = indicator //BS = indicator //index = current bar number

c0 = 1, c1 = 0, b0 = 1, b1 = 0, b2 = 0, a1 = 0;
a2 = 0, alpha = 0, beta1 = 0, gamma1 = 0;
n = 0;
if (type == "E-SMA") n = period;
filt = price;
prevP1 = price[index-1];
prevP2 = price[index-2];
priorP = price[index-n];
prevFilt1 = ifNull(price, filt[index-1]); //feedback ingredent
Filt2 = ifNull(price, filt[index-2]); //feedback ingredent
filt = 0;
twoPiPrd = (2 * Math.PI)/period;
if (type == "E-EMA")
    alpha = (Math.cos(twoPiPrd) + Math.sin(twoPiPrd) -1) / Math.cos(twoPiPrd);
    b0 = alpha;
    a1 = 1 - alpha;
endIf
if (type == "E-SMA")
    c1 = 1 / n;
    b0 = 1 / n;
    a1 = 1;
endIf
if (type == "GAUSS")
    beta1 = 2.451 * (1 - Math.cos(twoPiPrd));
    alpha = -beta1 + Math.sqrt(beta1*beta1 + 2*beta1);
    c0 = alpha * alpha;
    a1 = 2 * (1 - alpha);
    a2 = -(1 - alpha) * (1 - alpha);
endIf
if (type == "BUTTER")
    beta1 = 2.451 * (1 - Math.cos(twoPiPrd));
    alpha = -beta1 + Math.sqrt(beta1*beta1 + 2*beta1);
    c0 = alpha*alpha / 4;
    b1 = 2;
    b2 = 1;
    a1 = 2 * (1 - alpha);
    a2 = -(1 - alpha) * (1 - alpha);
endif
if (type == "SMOOTH")
    c0 = 1 /4;
    b1 = 2;
    b2 = 1;
endIf
if (type == "HP")
    alpha = (Math.cos(twoPiPrd) + Math.sin(twoPiPrd) -1) / Math.cos(twoPiPrd);
    c0 = 1 - alpha / 2;
    b1 = -1;
    a1 = 1 - alpha;
endIf
if (type == "2PHP")
    beta1 = 2.451 * (1 - Math.cos(twoPiPrd));
    alpha = -beta1 + Math.sqrt(beta1 * beta1 + 2 * beta1);
    c0 = (1 - alpha / 2) * (1 - alpha / 2);
    b1 = -2;
    b2 = 1;
    a1 = 2 * (1 - alpha);
    a2 = -(1 - alpha) * (1 - alpha);
endIf
if (type == "BP")
    beta1 = Math.cos(twoPiPrd);
    gamma1 = 1 / Math.cos(720 * delta1 / period);
    alpha = gamma1 + Math.sqrt(gamma1 * gamma1 - 1);
    c0 = (1 - alpha) / 2;
    b2 = -1;
    a1 = beta1 * (1 + alpha);
    a2 = -alpha;
endIf
if (type == "BS")
    beta1 = Math.cos(twoPiPrd);
    gamma1 = 1 / Math.cos(720 * delta1 / period);
    alpha = gamma1 - Math.sqrt(gamma1 * gamma1 - 1);
    c0 = (1 + alpha) / 2;
    b1 = -2 * beta1;
    b2 = 1;
    a1 = beta1 * (1 + alpha);
    a2 = -alpha;
endIf
Plot: filt = c0 * ((b0*price) + (b1*prevP1) + (b2*prevP2) + (a1*prevFilt1) + (a2*prevFilt2) - (c1*priorP));

Technical Rank

Technical Rank (TR) was authored by John Murphy. The instrument’s price is plied with multiple moving averages, rate of change and the relative strength index. These values are mathematically manipulated with percentage factors and then summed together. The total is rounded and truncated, forcing it to conform to the technical rank range of 0 to 100, and finally, it is put on display as a tri-colored histogram. The user may change the input (close) and multiple period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Technical Rank

Technical Rank may be useful in choosing a stock. No trading signals are calculated for this indicator.

Calculation

//input = price, user defined, default is closing price //method = moving average (ma), user defined, default is EMA //p1 = period, user defined, default is 200 //p2 = period, user defined, default is 125 //p3 = period, user defined, default is 50 //p4 = period, user defined, default is 20 //p5 = period, user defined, default is 12 //p6 = period, user defined, default is 26 //p7 = period, user defined, default is 9 //p8 = period, user defined, default is 3 //p9 = period, user defined, default is 14 //sma = simple moving average, ema = exponential moving average //roc = rate of change, rsi = relative strength index //index = current bar number

ma1 = sma(index, p1, input);
ltMa =  .3 * 100 * (price - ma1) / ma1;
ltRoc = .3 * 100 * roc(index, p2, key);
ma2 = sma(index, p3, key);
mtMa = .15 * 100 * (price - ma2) / ma2;
mtRoc = .15 * 100 * roc(index, p4, input);
ma5 = ema(index, p5, input);
ma6 = ema(index, p6, key);
ppo = 100 * (ma5 - ma6) / ma6;
sig = ema(index, p7, key);
ppoHist = ppo - sig;
value = ppoHist[index];
priorV = ppoHist[index-p8];
slope = (value - priorV) / p8; //rise over run = slope of ppoHist
stPpo = .05 * 100 * slope;
rsi = rsi(index, p9, input)[0];
stRsi = .05 * rsi;
tr = ltMa + ltRoc + mtMa + mtRoc + stPpo + stRsi;
if (tr lessThan 0) tr = 0;
if (tr moreThan 100) tr = 100;
PlotHist: tr;;

Three Lines

Three Lines by Bill Williams displays three displaced moving averages based on the midpoint price. The user may change the input (midpoint), method (SMA), periods and displace lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using 3 Lines

The Three Lines Indicator may be used in conjunction with other indicators as a trend indicator. No trading signals are given.

Calculation

//input = price (user defined, default is midpoint price) //method = user defined, default is SMA //period1 = user defined, default = 13 //displace1 = user defined, default = 8 //period2 = user defined, default = 8 //displace2 = user defined, default = 5 //period3 = user defined, default = 5 //displace3 = user defined, default = 3 //index = current bar number

Plot1: line1 = ma(method, index-displace1, period1, input);
Plot2: line2 = ma(method, index-displace2, period2, input);
Plot3: line3 = ma(method, index-displace3, period3, input);

TFS MOB Indicator

TFS MOB Indicator was authored by Bryan Strain in the Stocks and Commodities Magazine 06/2000. It is the difference of a fast and slow-moving average. The user may change the input (close), method (SMA) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using TFS MOB Indicator

The TFS Volume Oscillator may be used in conjunction with other indicators. No trading signals are given.

Calculation

//input = price, user defined, default is close //method = moving average, user defined, default is SMA //fastPeriod = user defined, default is 25 //slowPeriod = user defined, default is 200 //index = current bar number

mob1 = ma(method, index, fastPeriod, input);
mob2 = ma(method, index, slowPeriod, input);
Plot: tfsMob = mob1 - mob2; 

TFS Tether Line

The TFS Tether Line was authored by Bryan Strain in Stocks and Commodities Mag.06/2000. The Tether line is a 50 period midpoint price. The user may change the period value. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using TFS Tether Line

A sell signal will be generated if the high crosses above the TL. Conversely, a buy signal will be given if the low crosses below the TL.

Calculation

//period = user defined, default is 50 //prev = previous, MT = moreThan, LT = lessThan //index = current bar number

highest = highest(index, period, high);
lowest = lowest(index, period, low);
Plot: tl = (highest + lowest) / 2;
//Signals
prevHigh = high[index-1];
prevLow = low[index-1];
prevTl = tl[index-1];
sell = (prevTl MT prevHigh AND tl LT high );
buy = (prevTl LT prevLow AND tl MT low);

TFS Volume Oscillator

TFS Volume Oscillator was authored by Bryan Strain in Stocks and Commodities Magazine 06/2000. First, the bar volume for the period is tallied as a plus or minus dependant upon a predominant open (-) or closing (+) price. This tally is then divided by the period to produce the volume oscillator plot. The user may change the period length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using TFS Volume Oscillator

The TFS Volume Oscillator may be used in conjunction with other indicators. No trading signals are calculated.

Calculation

//period = user defined, default is 7 //index = current bar number

iclose = 0;
iopen = 0;
vol = 0;
totV = 0;
    for (i = index - period + 1; i lessOr= index; i++)
        iclose = close[i];
        iopen = open[i];
        vol = getVolume(i)/1000000; //volume in millions
        if (iclose lessThan ioepn) totV = totV - vol;
        if (iclose moreThan ioepn) totV = totV + vol;
    endFor
Plot: tfsVo = totV / period;

Tilson IE/2

Tilson IE/2, by Tim Tilson, is a type of moving average; it uses the linear regression slope (m) in the line equation (y=a+mx). When the average crosses the input price trading signals are given. The user may change the input (close), method (SMA) and period length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Tilson IE/2

Trading signals are triggered when the IE2 and the price cross. If the IE2 crosses above (upward movement), a buy signal is generated. Conversely, if the IE2 crosses below (downward movement), a sell signal is given.

Calculation

//input = price, user defined, default is close //method = moving average, user defined, default is SMA //period = user defined, default is 15 //av = average //ma = moving average, index = current bar number //a and m are values in line equation y=a+mx.

avPrice = ma(method, index, period, input);
value[] = linRegLine(index, period, input, 0);
a = value[0];.
m = value[1] + avPrice;
Plot1: ie2 = (m + a) / 2;
Plot2: price;
//Signals
buy = crossedAbove(IE2, price);
sell = crossedBelow(IE2, price);

Time Frame

The Time Frame study will plot time frames and/or price ranges on your chart. This could be used to shade pre/post market times on your chart.

Time Price Opportunity (TPO)

The Time Price Opportunity (TPO) study displays market activity using time and price (sometimes known as Market Profile).

The following screenshot illustrates some of the features of the TPO study. This is a daily TPO with a 30-minute time interval, on a 15-minute price chart, and the price interval is set to 2 ticks.

Trader's Dynamic Index (TDI)

The Trader's Dynamic Index (TDI) is created by Dean Malone. TDI integrates RSI, its moving averages (MAs), and volatility bands that are based on Bollinger Bands to generate entry and exit signals. This dynamic tool also provides insights into trends, reversals, momentum, market volatility, buy/sell signals, and overbought/oversold conditions.

There are four components in a TDI chart. The chart is developed around RSI and its MAs. The Price Line is the RSI that plots the strength of the price movement. The Trade Signal Line is an MA of the RSI line. The Market Base Line in the middle is a slow MA of the RSI that shows the long-term trend and momentum. The Upper and Lower Volatility Bands are calculated using the standard deviation of the RSI to display the market's volatility. The wider the bands' distance, the more volatile the market is.

When the Price Line crosses above the Trend Signal Line, a buy marker will be generated. Meanwhile, when the Price Line crosses below the Trend Signal Line, a sell signal will be given.

How to trade using Trader's Dynamic Index

If a buy signal occurs below the Market Base Line, it indicates a strong bullish trend and a reliable buying opportunity. Conversely, if a sell signal is above the Market Base Line, it suggests a strong bearish trend and might be a good time to enter a short position. The signals become even more reliable if they fall within the range of the Upper and Lower bands.

When the Price Line crosses above the Market Base Line, it shows a potential upward direction. Conversely, when the Price Line crosses below the Market Base Line, it suggests a potential downtrend. The TDI can help confirm the trend direction and strength by looking at the crossovers of the Price Line and Market Base Line.

Similar to the traditional RSI, TDI displays overbought/oversold conditions and potential reversals. Typically, if a sell marker is in the overbought zone (above 70), it indicates a potential reversal from uptrend to downtrend. In contrast, if a buy signal is in the oversold zone ( below 30), there might be an upward reversal.

Another way to identify reversals is to compare the directions of the price and the Price Line (RSI Line - green) in a TDI graph. If the price forms higher highs, but the RSI line makes lower highs, it signals a potential bearish reversal. If the price forms lower lows but the RSI line creates higher lows, it suggests a potential upward reversal.

Trend Analysis Index

Trend Analysis Index was authored by Adam White, in the Stocks and Commodities Mag. 08/1992. This index uses the highest and lowest prices of a simple moving average to create an oscillator. The user may change the input (close) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Percent Change

The Trend Analysis Index may be used in conjunction with other indicators. No trading signals are given.

Calculation

//input = price user defined, default is close //avPeriod = user defined, default is 28 //taiPeriod = user defined, default is 5 //sma = simple moving average, index = current bar number

av1 = sma(index, avPeriod, input);
highest = highest(index, taiPeriod, av1);
lowest = lowest(index, taiPeriod, av1);
Plot: tai = (highest - lowest) * 100 / price;

Trend Momentum Volatility Volume (TMV)

Trend Momentum Volatility Volume (TMV) was authored by Barbara Star in the Stocks and Commodities Magazine, Feb. 2012. The TMV displays five indicators, Keltner Channels (KC), Commodity Channel Index (CCI), the Volume Oscillator (VO), Average Directional Index (ADX) and a Simple Moving Average (SMA). The price bars change color based on the ADX and the SMA. See individual studies for details. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the TMV

The price bars change colors as outlined in the code below.

Calculation

//input = price, user defined, default is close //period = user defined, default is 13 //keltner upper range = upperRange user defined, default is 2 //keltner lower range = lowerRange user defined, default is 2 //volume method = method user defined, default is sma //volume fast period = fastPeriod user defined, default is 1 //volume slow period = slowPeriod user defined, default is 20 //adx period = adxPeriod user defined, default is 10 //sma period = smaPeriod user defined, default is 8 //prev = previous, index = current bar number

//SMA
Plot: sma = sma(index, smaPeriod, input);

//CCI
Plot: cci = CCI(series, index, period);

//ADX
// Calculate the +DM, -DM and TR
pDm = getPositiveDM(index);
nDm = getNegativeDM(index);
tr = getTrueRange(index);
// Calculate the Average +DM, -DM and TR
pdMa = smma(index, period, PDM);
ndMa = smma(index, period, NDM);
tra = smma(index, period, TR);
// Determine the +DI, -DI and DX
pdi = pdMa / tra * 100;
ndi = ndMa / tra * 100;
dx = Math.abs((pdMa - ndMa)) / (pdMa + ndMa) * 100;
//Calculate the Average DX
Plot:adx = smma(index, period, DX);

//Keltner Channel
Plot: middle = ma(EMA, index, period, input);
atr = atr(index, period);
Plot: top = middle + (upperRange * atr);
Plot: bottom = middle - (lowerRange * atr);

//Volume Oscillator
ma1 = ma(method, index, fastPeriod, VOLUME);
ma2 = ma(method, index, slowPeriod, VOLUME);
Plot: vo = ma1 - ma2;

//Modify price bar colors
prevAdx = ADX[index-1];
up = adx moreThan prevAdx AND price moreThan sma; 
down = adx moreThan prevAdx AND price lessThan sma;
if (up) setPriceBarColor(index, upColor);
if (down) setPriceBarColor(index, downColor);
if (NOTup AND NOTdown) setPriceBarColor(index, neutralColor);

Treynor Ratio

The Treynor Ratio or Measure was authored by Jack L. Treynor. It is designed to evaluate how well an investor is compensated for the risk taken. The higher the Treynor the better the instrument’s performance. The main ingredients are the current price and a prior price which are adjusted with the user-defined safe return. A user-defined safe return is subtracted from the average return and divided be a user-defined beta number. The user must select linear bars but may change the input (close), period length, beta and a safe return value. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Treynor Ratio

The Treynor Ratio may be used to evaluate an instrument’s performance. No trading signals are calculated.

Calculation

//input = price, user defined, default is close //period = p1, user defined, default is 30 //beta = user defined, default is 1 //safe = safe return percentage, user defined, default is 2 //av = average, pow = power //sma = simple moving average, sdDev = standard deviation //index = current bar number

barMin = 0;
BarSize bar = getBarSize();
if (bar.getType() == BarSizeType.LINEAR) barMin = bar.getInterval();
else return;
minPerYr = 60*24*30*12;
barsPerYr = minPerYr/barMin;
adjSafe = Math.pow((1 + (safe)), p1/barsPerYr) - 1;  //safe return per period compounded
priorP = price[index-p1];
ret = (price/priorP)-1 
av = sma(index, p1, RET);
Plot: treynor = (av - adjSafe) / beta;

Triangular Moving Average (TMA)

The Triangular Moving Average (TMA) is a double-smoothed simple moving average. This is calculated as follows TMA = SMA(SMA). The user may change the input (close), period (20) and shift (0). This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Triangular Moving Average (TMA)

TMA may be used as a moving average in conjunction with other indicators. No trading signals are given.

Calculation

//input = price, user defined, default is close //period = user defined, default is 20 //shift = user defined, default is 0 //ma = moving average, index = current bar number

ma1 = ma("SMA", index, period, input);
Plot: tma[shift] = ma("SMA", index, period, MA1);

Triple Exponential Moving Average (TEMA)

Triple Exponential Moving Average (TEMA) was developed by Patrick Mulloy in 1994. This is calculated as follows TEMA = 3*EMA – 3*EMA(EMA) + EMA(EMA(EMA)). The user may change the input (close), period (20) and shift (0). This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using the Triple Exponential Moving Average (TEMA)

TEMA may be used as a moving average in conjunction with other indicators. No trading signals are given.

Calculation

//input = price, user defined, default is close //period = user defined, default is 20 //shift = user defined, default is 0 //ma = moving average, index = current bar number

ma1 = ma("EMA", index, period, input);
ma2 = ma("EMA", index, period, MA1);
ma3 = ma("EMA", index, period, MA2);
Plot: tema[shift] = (3 * ma1) - (3 * ma2) + ma3;

TRIX

The TRIX oscillator was developed by Jack Hutson in the 1980s. The TRIX displays, the percent rate of change, of 3 iterations of an exponentially smoothed moving average of an instrument. Oscillating around the zero line, TRIX is designed to filter out stock movements that are insignificant to the larger trend. The user may change the input (close) and period lengths. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using TRIX

A sell signal will be generated if the TRIX line crosses above the Signal line. Conversely, a buy signal will be given if the TRIX line crosses below the Signal line.

Calculation

//input = price, user defined, default is close //period = user defined, default is 15 //period2 = user defined, default is 9 //EMA = exponential moving average //ma = moving average, prev = previous //index = current bar number, sig = signal

ma1 = ma("EMA", index, period, input);
ma2 = ma("EMA", index, period, MA1);
ma3 = ma("EMA", index, period, MA2);
prevMA3 = MA3[index-1];
TRIX = 100 * ((ma3 - prevMA3)/prevMA3);
sig = ma("EMA", index, period2, TRIX);
// Signals
buy =  crossedAbove(TRIX, SIG);
sell = crossedBelow(TRIX, SIG);

Turbo Stochastic Fast

How To Trade Using Turbo Stochastic Fast

Adjust the top and bottom guides to control the quantity and quality of the trading signals. TSFK values above 70 are considered overbought and therefore offer an opportunity to sell. TSFK values below 30 are considered oversold and present an opportunity to buy. If the TSFK is above the top guide and crosses below the TSFD, a sell signal will be generated. Conversely, a buy signal will be given if the TSFK is below the bottom guide and crosses above the TSFD. The 50 line divides the bulls above from the bears below.

Calculation

//input = price, user defined, default is closing price //kPeriod = user defined, default is 20 //dPeriod = user defined, default is 20 //regress = linear regression period = user defined, default is 10 //turbo = user defined, default is +2 //stochK = stochastics slow K, sma = simple moving average //index = current bar number

fastK = stochK(index, kPeriod, input);
fastD = sma(index, kPeriod, fastK);
if (turbo lessThan 0) turbo = Math.max(turbo, -regress);
if (turbo moreThan 0) turbo = Math.min(turbo, regress);
Plot1: tsfK = linRegLine(index, regress, fastK, regress + turbo)[0];
Plot2: tsfD = linRegLine(index, regress, fastD, regress + turbo)[0];
//Signals
highSell = tsfK for last sell signal, reset to max_negative at each  buy signal;
lowBuy = tsfK for last buy signal, reset to max_positive at each sell signal;
sell = crossedBelow(TSFK, TSFD) AND tsfK moreThan topGuide AND (tsfK moreThan highSell);
buy = crossedAbove(TSFK, TSFD) AND tsfK lessThan bottGuide AND (tsfK lessThan lowBuy);

Turbo Stochastic Slow

How To Trade Using Turbo Stochastic Slow

Adjust the top and bottom guides to control the quantity and quality of the trading signals. TSSK values above 70 are considered overbought and therefore offer an opportunity to sell. TSSK values below 30 are considered oversold and present an opportunity to buy. If the TSSK is above the top guide and crosses below the TSSD a sell signal will be generated. Conversely, if the TSSK is below the bottom guide and crosses above the TSSD a buy signal will be given. The 50 line divides the bulls above from the bears below.

Calculation

//input = price, user defined, default is closing price //kPeriod = user defined, default is 20 //dPeriod = user defined, default is 20 //regress = linear regression period = user defined, default is 10 //turbo = user defined, default is +2 //stochK = stochastics slow K, sma = simple moving average //index = current bar number

fastK = stochK(index, kPeriod, input);
slowK = sma(index, kPeriod, fastK);  //same as fastD
slowD = sma(index, dPeriod, slowK); 
if (turbo lessThan 0) turbo = Math.max(turbo, -regress);
if (turbo moreThan 0) turbo = Math.min(turbo, regress);
Plot1: tssK = linRegLine(index, regress, slowK, regress + turbo)[0];
Plot2: tssD = linRegLine(index, regress, slowD, regress + turbo)[0];
//Signals
highSell = tssK for last sell signal, reset to max_negative at each  buy signal;
lowBuy = tssK for last buy signal, reset to max_positive at each sell signal;
sell = crossedBelow(TSSK, TSSD) AND tssK moreThan topGuide AND (tssK moreThan highSell);
buy = crossedAbove(TSSK, TSSD) AND tssK lessThan bottGuide AND (tssK lessThan lowBuy);

Twiggs Money Flow

Twiggs Money Flow by Colin Twiggs is a variation on the Chaikin Money Flow Index. It uses True Range and volume. Adjustable guides are given to fine-tune the signals. The user may change the method (EMA), period lengths, and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Twiggs Money Flow

Adjust the guides allowing approximately 30 percent of the total range above the top guide and 30 percent below the bottom guide. If the TMF peaks above the top guide a sell signal will be generated. Conversely, if the TMF troughs below the bottom guide, a buy signal will be given.

Calculation

//method = moving average, user defined, default is EMA //period = user defined, default is 21 //ma = moving average //trh = true high //trl = true low //prev = previous, index = current bar number //LT = lessThan, MT = moreThan

lastClose = price[index-1];
trh = max(high, lastClose);
trl = min(low, lastClose);
ad = ((close - trl)- (trh - close)) / (trh - trl) * volume;
smoothAd =ma(method, index, period, ad);
smoothVol = ma(method, index, period, volume);
Plot: TMF = smoothAd / smoothVol;
//Signals
prevTmf = TMF[index-1];
highSell = tmf for last sell signal, reset to max_negative at each  buy signal;
lowBuy = tmf for last buy signal, reset to max_positive at each sell signal;
sell = (tmf MT topGuide) AND (prevTmf MT tmf) AND (tmf MT highSell);
buy = (tmf LT bottomGuide AND prevTmf LT tmf) AND (tmf LT lowBuy);

Two Pole Butterworth Filter

The Two Pole Butterworth Filter (TPBF) was authored by John Ehlers. The TPBF uses current price, previous prices and feedback in its calculation. The user may change the input (close) and period length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

How To Trade Using Two Pole Butterworth Filter

The Two Pole Butterworth Filter is a trend indicator and may be used in conjunction with other studies. No trading signals are calculated.

Calculation

//input = price, user defined, default is closing price //period = user defined, default is 20 //prev = previous, index = current bar number

prevP1 = price[index-1];
prevP2 = price[index-2];
prevB1 = ifNull(price, butter[index-1]);  //feedback ingredent
prevB2 = ifNull(price, butter[index-2]);  //feedback ingredent
piPrd = Math.PI/period;
a1 = Math.exp(-1.414 * piPrd);
b1 = 2 * a1 * Math.cos(1.414 * piPrd);
coef2 = b1;
coef3 = -a1 * a1;
coef1 = (1 - b1 + a1 * a1) / 4;
plot: butter = coef1 * (price + (2*prevP1) + prevP2) + (coef2*prevB1) + (coef3*prevB2);

In case of crossovers between a long-term SMA and a short-term SMA or SMA with other MAs, trading signals are generated when users choose the Study in MotiveWave.

Stochastic Regular was authored by Stuart Evens in the Stocks and Commodities Magazine 09/1999. The Stochastic Regular calculation uses close, highest highs and lowest lows. First, the fast K (FK) is calculated and then smoothed to produce the slow K (SK) which is used as a signal line. Adjustable guides are given to fine-tune the trading signals. The user may change the input (close), period lengths, and slow K method. This indicator’s definition is further expressed in the condensed code given in the calculation below. .

.

Swami Stochastics was developed by John Ehlers and Ric Way. It utilizes a series of stochastic values to determine bullish and bearish periods. The indicator will be green when entering a bullish period, red when entering a bearish period. Yellow is displayed when the direction is indeterminate. The user may change the period lengths. This indicator’s definition is further expressed in the raw code given in the calculation below.

For details on how to use this study, see our

Turbo Stochastic Fast (TSF) was authored Omega Research 1996. The TSF first calculates the slow K and then smooths it with a Simple Moving Average to produce the fast D. The slow and fast lines are further manipulated with the Linear Regression line calculation which is effectively another smoothing technique. The Linear Regression point (bar number) may be chosen by the user defined turbo value. A plus value points to a future bar location, a minus to a past bar location. Adjustable guides are given to fine-tune the trading signals. The user may change the input (close), period lengths, turbo and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below. .

Turbo Stochastic Slow (TSS) was authored Omega Research 1996. The TSS first calculates the slow K and then smooths it twice with a Simple Moving Average to produce the slow D. The slow K and D lines are further manipulated with the Linear Regression line calculation which is effectively another smoothing technique. The Linear Regression point (bar number) may be chosen by the user-defined turbo value. A plus value points to a future bar location, a minus to a past bar location. Adjustable guides are given to fine-tune the trading signals. The user may change the input (close), period lengths, turbo and guide values. This indicator’s definition is further expressed in the condensed code given in the calculation below. .

See also Sharpe Ratio
Click here for more information.
Click here for more information on Ehler’s indicators.
Click here for more information
Click here for more information on the TSI.
Click here for more information on the TSI.
See Sortino Ratio
See also Sharpe Ratio
Click here for more information.
Click here for more information.
Click here for more information.
Click here for more information.
See also Stochastic Oscillator
See also Stochastic Oscillator
Click here for details.
Volume and Order Flow Analysis Guide
See Treynor Ratio
See also Sharpe Ratio
Click here for more information.
See also Stochastic Oscillator
Click here for more information on the SMI
See also Simple Moving Average.
See also Turbo Stochastics Fast
Risk Disclosure and Performance Disclaimer Statement
See Simple Moving Average
Click here for more information on the Hilbert Transform Indicator
Click here for more information on the RSI.
See Commodity Channel Index
See Average Directional Index
See Volume Oscillator
Click here for trading information.
See Keltner Channel
Moving Average Cross