TSI Signal Cross Script

← All 56 scripts

  • Momentum
  • Own panel
  • Intermediate

Marks TSI crossing its signal line, but only when the cross happens on the far side of zero: upward crosses below zero and downward crosses above zero. Requiring the zero-line side keeps the marker to turns that start from a stretched reading.

  • File iqow-tsi-signal-cross.lua
  • Version 1.0.0
  • Size 133 lines · 4 KB
  • Timeframes 1-minute to 15-minute candles
  • License MIT
TSI Signal Cross drawn on synthetic candles
How the script draws, shown on synthetic candles generated for testing. It is an illustration of the markers and lines, not real market data or a result.

The rules

HIGHER marker

TSI(25, 13) crosses above its EMA(7) signal line while TSI is below zero.

LOWER marker

TSI(25, 13) crosses below its EMA(7) signal line while TSI is above zero.

A marker appears after the next candle opens and is drawn on the candle that completed the setup. It is a chart observation, not an instruction to trade.

How to read it

The blue line is the TSI and the red line is its signal line, around a faint zero line in a separate panel. A green HIGHER triangle at the bottom of the panel appears where blue crosses above red below zero; a red LOWER triangle at the top appears where blue crosses below red above zero.

Indicators used

  • True Strength Index (25, 13)
  • EMA signal (7)

Same view with built-in indicators: Add True Strength Indicator (25, 13) with a signal line EMA of 7 from the IQ Option indicator list.

Default settings

Long period25
Short period13
Signal EMA period7

Every value is an input in the script settings. Platform advice is off by default.

Key points

  1. The True Strength Index measures momentum by smoothing price change twice.
  2. A signal line, an EMA of the TSI, shows when momentum is shifting.
  3. We only use crosses that happen away from zero, so the TSI has already stretched in one direction.
  4. Blue crossing above red below zero is HIGHER; blue crossing below red above zero is LOWER.
  5. The markers sit in the indicator panel and confirm on a completed candle.
  6. Try different signal periods between 7 and 13 on a Practice balance.

Limitations. The TSI is smoothed twice, so crosses lag price and can appear after a reversal is under way. In a strong trend the TSI can stay on one side of zero while crossing its signal repeatedly. The article describes signal periods of 7 to 13; this script defaults to 7. Test on the Practice balance before risking real funds.

Learn the strategy: read the full guide on IQOptionWiki →

Install it in four steps

  1. Download and inspectDownload one .lua file and open it in a plain-text editor if you want to read it first. If you downloaded the ZIP, extract it.
  2. Open Chart Analysis → ScriptsIn the IQ Option traderoom, choose the Practice balance, open the chart analysis panel, select Scripts and choose Import script.
  3. Save and add to chartSelect the downloaded file, review the imported code, choose Save, then use the + control to add it to the chart.
  4. Change one input at a timeConfirm the default view first. Then adjust periods, levels or colours one setting at a time and note what changes.

Complete source code

The download and this preview resolve to the same reviewed file. SHA-256: cbb1e3bab29b24e387f203f02b7dd9345fc58b9933da8f39637f2bd6ddc87fcb

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW TSI Signal Cross v1.0.0
--
-- The True Strength Index (TSI) double-smooths price change and shows
-- momentum direction. A cross of the TSI line through its EMA signal line
-- is used as the timing event; the zero line adds context.
-- The oscillator is drawn in its own panel under the chart.
--
-- HIGHER: TSI(25, 13) crosses above its signal line (EMA 7) while TSI is below zero.
-- LOWER:  TSI(25, 13) crosses below its signal line while TSI is above zero.
--
-- Markers use the previous completed candle: they appear after the next candle
-- opens and are shifted back one bar onto the candle that qualified.
-- Educational chart tool only. It does not place trades, choose an expiry,
-- predict outcomes, or guarantee results. Test on a Practice balance first.

instrument {
    name = "IQOW TSI Signal Cross",
    short_name = "IQOW TSI",
    overlay = false
}

input_group {
    "1. True Strength Index",
    long_period = input (25, "Long period", input.integer, 2, 100),
    short_period = input (13, "Short period", input.integer, 2, 100),
    signal_period = input (7, "Signal EMA period", input.integer, 2, 50)
}

input_group {
    "Display and advice",
    lines_visible = input { default = true, type = input.plot_visibility },
    signals_visible = input { default = true, type = input.plot_visibility },
    advice_enabled = input { default = false, name = "Enable platform advice", type = input.boolean }
}

input_group {
    "Colors",
    tsi_color = input { default = "#56CEFF", type = input.color },
    signal_color = input { default = "#FF6C58", type = input.color },
    zero_color = input { default = rgba(255, 255, 255, 0.25), type = input.color },
    line_width = input { default = 1, type = input.line_width },
    higher_color = input { default = "#25E154", type = input.color },
    lower_color = input { default = "#FF6C58", type = input.color },
    signal_text_color = input { default = "#FFFFFF", type = input.color }
}

-- True Strength Index: double-smoothed price change over double-smoothed
-- absolute change, as in the official indicator.
price_change = change (close)
smoothed_change = ema (ema (price_change, long_period), short_period)
smoothed_abs_change = ema (ema (abs (price_change), long_period), short_period)
tsi_value = 100 * smoothed_change / max (smoothed_abs_change, 1e-10)
signal_line = ema (tsi_value, signal_period)

-- Current-bar scalars for the Lua rule logic.
local tsi_now = get_value (tsi_value, nil)
local tsi_before = get_value (tsi_value [1], nil)
local signal_now = get_value (signal_line, nil)
local signal_before = get_value (signal_line [1], nil)

local data_is_ready =
    tsi_now ~= nil and
    tsi_before ~= nil and
    signal_now ~= nil and
    signal_before ~= nil and
    get_value (tsi_value [long_period + short_period], nil) ~= nil

-- Event: TSI crosses its signal line on this candle, on the matching side of zero.
higher_setup = conditional (
    data_is_ready and tsi_before <= signal_before and tsi_now > signal_now and tsi_now < 0
)
lower_setup = conditional (
    data_is_ready and tsi_before >= signal_before and tsi_now < signal_now and tsi_now > 0
)

-- Confirm only a new setup on the previous completed candle.
confirmed_higher = conditional (
    get_value (higher_setup [1], false) and
    not get_value (higher_setup [2], false)
)

confirmed_lower = conditional (
    get_value (lower_setup [1], false) and
    not get_value (lower_setup [2], false)
)

hline (0, "Zero", zero_color, 1)

if lines_visible then
    plot (tsi_value, "TSI", tsi_color, line_width)
    plot (signal_line, "TSI signal", signal_color, line_width)
end

if signals_visible then
    plot_shape (
        confirmed_higher,
        "TSI HIGHER",
        shape_style.triangleup,
        shape_size.small,
        higher_color,
        shape_location.bottom,
        -1,
        "HIGHER",
        signal_text_color
    )

    plot_shape (
        confirmed_lower,
        "TSI LOWER",
        shape_style.triangledown,
        shape_size.small,
        lower_color,
        shape_location.top,
        -1,
        "LOWER",
        signal_text_color
    )
end

-- QCS advice is a platform notification state only; it does not place trades.
if advice_enabled and
    get_value (confirmed_higher, false) and
    not get_value (confirmed_lower, false) then
    advise (advice.buy)
elseif advice_enabled and
    get_value (confirmed_lower, false) and
    not get_value (confirmed_higher, false) then
    advise (advice.sell)
else
    advise (advice.neutral)
end

More momentum scripts

  • Momentum
  • Signal engine
  • On price
  • Advanced

IQ_WIKI_BINARY_SIGNAL_GUN_V1.1.0

A stricter local confluence engine with weighted RSI, ATR-normalized MACD, Bollinger and pattern-family votes. Optional strategy alignment must agree with the base direction.

Indicators: Weighted RSI · ATR-normalized MACD · Bollinger · Pattern families · ATR risk

  • Momentum
  • On price
  • Beginner

Awesome Oscillator SMA

Marks the candle on which the Awesome Oscillator crosses zero in the direction of the 100-period SMA. The SMA acts as a simple trend filter for the oscillator.

Indicators: Awesome Oscillator (5, 34) · SMA (100)

  • Momentum
  • Own panel
  • Beginner

Double Momentum 20 3

Marks the candle where the fast Momentum(3) line crosses zero in the direction of the slower Momentum(20) line. The slow line gives the trend side, the fast line gives the timing.

Indicators: Momentum (20) · Momentum (3)

Download all 56 scripts as one ZIP · MIT License, provided “as is”, without warranty. IQOptionWiki is independent of the IQ Option platform operator. Nothing here is investment advice or a guarantee of results.

GENERAL RISK WARNING

The financial products offered by the company carry a high level of risk and can result in the loss of all your funds. You should never invest money that you cannot afford to lose.
Kindly note that this article does not provide any investment advice. The information presented regarding past events or potential future developments is solely an opinion and cannot be guaranteed as factual, including the provided examples. We caution readers accordingly.