- Momentum
- Own panel
- Intermediate
Marks the candle where the Schaff Trend Cycle leaves its low zone (crosses above 25) or its high zone (crosses below 75). The STC is a fast, bounded version of MACD, so it turns earlier than MACD alone.
The rules
HIGHER marker
STC(10, 23, 50) crosses above 25 on a candle; the marker confirms on the previous completed candle.
LOWER marker
STC(10, 23, 50) crosses below 75 on a candle; the marker confirms on the previous completed candle.
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 red line is the STC in a separate panel, drawn between levels at 25 and 75 with a faint line at 50. A green HIGHER triangle at the bottom of the panel marks an upward cross of 25, and a red LOWER triangle at the top marks a downward cross of 75.
Indicators used
- Schaff Trend Cycle (10, 23, 50)
Same view with built-in indicators: Add Schaff Trend Cycle (10, 23, 50) from the IQ Option indicator list, with levels 25 and 75.
Default settings
| Cycle period | 10 |
|---|---|
| Short EMA | 23 |
| Long EMA | 50 |
| Low level | 25 |
| High level | 75 |
Every value is an input in the script settings. Platform advice is off by default.
Key points
- The Schaff Trend Cycle takes the MACD and runs a double stochastic over it.
- The result is a line that swings between 0 and 100, faster than MACD.
- Below 25 is the low zone and above 75 is the high zone.
- A cross back above 25 is marked HIGHER, and a cross back below 75 is marked LOWER.
- Markers sit in the indicator panel, not on the price candles.
- Compare them with the trend on the main chart on a Practice balance before trusting them.
Limitations. The STC reacts quickly, so in sideways markets it swings between the levels and produces many crosses; in strong trends it can stay above 75 or below 25 and the opposite cross may never come. The 25 and 75 levels are adjustable inputs. Test on the Practice balance before risking real funds.
Install it in four steps
- 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.
- Open Chart Analysis → ScriptsIn the IQ Option traderoom, choose the Practice balance, open the chart analysis panel, select Scripts and choose Import script.
- Save and add to chartSelect the downloaded file, review the imported code, choose Save, then use the + control to add it to the chart.
- 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: 988c913b15d14a55c711aad2117b97b0297177f6c1779e8e0e3965a5f15d7875
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Schaff Trend Cycle v1.0.0
--
-- The Schaff Trend Cycle (STC) applies a double stochastic smoothing to the
-- MACD of two EMAs. It moves between 0 and 100 faster than the MACD itself.
-- Formula follows the official IQ Option Schaff Trend Cycle indicator.
-- The oscillator is drawn in its own panel under the chart.
--
-- HIGHER: STC crosses above 25 (leaves the low zone).
-- LOWER: STC crosses below 75 (leaves the high zone).
--
-- 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 Schaff Trend Cycle",
short_name = "IQOW STC",
overlay = false
}
input_group {
"1. Schaff Trend Cycle",
cycle_period = input (10, "Cycle period", input.integer, 2, 100),
short_cycle = input (23, "Short EMA", input.integer, 2, 100),
long_cycle = input (50, "Long EMA", input.integer, 3, 250)
}
input_group {
"2. Levels",
low_level = input (25, "Low level", input.double, 5, 45, 1, false),
high_level = input (75, "High level", input.double, 55, 95, 1, false)
}
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",
stc_color = input { default = "#DB4931", type = input.color },
level_low_color = input { default = rgba(255, 108, 88, 0.5), type = input.color },
level_high_color = input { default = rgba(37, 225, 84, 0.5), type = input.color },
middle_color = input { default = rgba(255, 255, 255, 0.15), 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 }
}
-- MACD of two EMAs on the close.
macd_line = ema (close, short_cycle) - ema (close, long_cycle)
-- First stochastic of the MACD, then smoothed (factor 0.5).
local smoothing_factor = 0.5
macd_low = lowest (macd_line, cycle_period)
macd_range = highest (macd_line, cycle_period) - macd_low
first_stoch = iff (macd_range > 0, ((macd_line - macd_low) / macd_range) * 100, nz (first_stoch [1]))
first_smooth = iff (na (first_smooth [1]), first_stoch, first_smooth [1] + smoothing_factor * (first_stoch - first_smooth [1]))
-- Second stochastic on the smoothed series, then smoothed again.
smooth_low = lowest (first_smooth, cycle_period)
smooth_range = highest (first_smooth, cycle_period) - smooth_low
second_stoch = iff (smooth_range > 0, ((first_smooth - smooth_low) / smooth_range) * 100, nz (second_stoch [1]))
stc_value = iff (na (stc_value [1]), second_stoch, stc_value [1] + smoothing_factor * (second_stoch - stc_value [1]))
-- Current-bar scalars for the Lua rule logic.
local stc_now = get_value (stc_value, nil)
local stc_before = get_value (stc_value [1], nil)
local settings_are_valid = short_cycle < long_cycle and low_level < high_level
local data_is_ready =
settings_are_valid and
stc_now ~= nil and
stc_before ~= nil and
get_value (stc_value [long_cycle + cycle_period * 2], nil) ~= nil
-- Event: STC crosses a level on this candle.
higher_setup = conditional (
data_is_ready and stc_before <= low_level and stc_now > low_level
)
lower_setup = conditional (
data_is_ready and stc_before >= high_level and stc_now < high_level
)
-- 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 { value = high_level, color = level_high_color, width = 1 }
hline { value = low_level, color = level_low_color, width = 1 }
hline { value = 50, color = middle_color, width = 1 }
hline { value = 105, color = "#0000000", show_label = false }
hline { value = -5, color = "#0000000", show_label = false }
if lines_visible then
plot (stc_value, "STC", stc_color, line_width)
end
if signals_visible then
plot_shape (
confirmed_higher,
"STC HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.bottom,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"STC 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
- Own panel
- Beginner
Ultimate Oscillator Cross
Marks the Ultimate Oscillator leaving its oversold or overbought zone. The oscillator blends three periods, so it reacts more evenly than a single-period oscillator.
Indicators: Ultimate Oscillator (7, 14, 28)
- Momentum
- Own panel
- Intermediate
Woodies CCI
Marks a Woodies CCI zero-line cross: the 14-period CCI changes side after six candles on the other side, while the faster Turbo CCI already agrees. The zero line is the baseline the article uses to define trend side.
Indicators: CCI (14) · Turbo CCI (6)
- Momentum
- Context indicator
- Own panel
- Beginner
Price EMA Distance Percent
Shows how far the selected price source is above or below an EMA in percentage terms. A configurable reference zone helps compare the current distance with your chosen scale.
Indicators: EMA (20) distance in %
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.