EMA50 CCI 100 Script

← All 56 scripts

  • Trend
  • On price
  • Beginner

Marks the first CCI break beyond +100 or -100 shortly after price crossed the EMA 50 and stayed on that side. The EMA sets the direction and CCI times the entry, at most once per EMA cross.

  • File iqow-ema50-cci-100.lua
  • Version 1.0.0
  • Size 157 lines · 5 KB
  • Timeframes 1-minute to 5-minute candles
  • License MIT
EMA50 CCI 100 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

Price closed above EMA 50 and stayed above it; the first CCI(14) close above +100 within 15 candles of that EMA cross.

LOWER marker

Price closed below EMA 50 and stayed below it; the first CCI(14) close below -100 within 15 candles of that EMA cross.

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 EMA 50. A green HIGHER triangle under a candle means price has been above the EMA since its last cross and CCI just closed above +100 for the first time in that run; a red LOWER triangle above a candle is the mirror case. CCI is not drawn on the price chart.

Indicators used

  • EMA (50)
  • CCI (14, levels +/-100)

Same view with built-in indicators: Add an Exponential Moving Average with period 50 on the price chart and the Commodity Channel Index (period 14, levels +100 and -100) in a panel.

Default settings

EMA period50
CCI period14
CCI level100
Candles after the EMA cross15

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

Key points

  1. First we need a direction. Price closing above the EMA 50 and staying there is the uptrend condition.
  2. Then we need momentum. CCI crossing above plus 100 shows an unusually strong move up.
  3. The first CCI break must come within 15 candles of the EMA cross, so the move is still fresh.
  4. Only the first break counts, so each EMA cross gives at most one marker.
  5. Below the EMA with CCI under minus 100 gives the mirror marker, LOWER.
  6. Markers use completed candles. Test the idea on the Practice balance.

Limitations. If price whipsaws around the EMA, the run on one side is short and the window resets often. A CCI break can also come late in a move that is already extended. 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: ea785bc35a77b8575346db41c05aa129db708dde75e93e3fe250b5a1a77791f4

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW EMA50 CCI 100 v1.0.0
--
-- Trend-following pairing. Price on one side of the EMA 50 sets the direction.
-- CCI(14) closing beyond +100 or -100 shows momentum in that direction. Only
-- the first CCI cross inside a window after the EMA cross is marked, so one
-- EMA cross produces at most one marker.
--
-- HIGHER: price closed above EMA 50 and has stayed above it since; the first
--         CCI(14) close above +100 within 15 candles of that EMA cross.
-- LOWER:  price closed below EMA 50 and has stayed below it since; the first
--         CCI(14) close below -100 within 15 candles of that EMA cross.
--
-- 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 EMA50 CCI 100",
    short_name = "IQOW EMA CCI",
    overlay = true
}

input_group {
    "1. Moving average",
    ema_period = input (50, "EMA period", input.integer, 2, 300)
}

input_group {
    "2. CCI",
    cci_period = input (14, "CCI period", input.integer, 2, 100),
    cci_level = input (100, "CCI level (+/-)", input.double, 20, 300, 5, false),
    window_candles = input (15, "Candles allowed after the EMA cross", input.integer, 1, 100)
}

input_group {
    "Display and advice",
    ema_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",
    ema_color = input { default = "#56CEFF", type = input.color },
    ema_width = input { default = 2, 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 }
}

ema_line = ema (close, ema_period)
cci_value = cci (hlc3, cci_period)

-- Current-bar scalars for the Lua rule logic.
local close_now = get_value (close, nil)
local ema_now = get_value (ema_line, nil)
local cci_now = get_value (cci_value, nil)
local cci_previous = get_value (cci_value [1], nil)

local has_history = get_value (close [ema_period], nil) ~= nil

local data_is_ready =
    has_history and
    close_now ~= nil and
    ema_now ~= nil and
    cci_now ~= nil and
    cci_previous ~= nil

local price_above = data_is_ready and close_now > ema_now
local price_below = data_is_ready and close_now < ema_now

-- Candles since price was last NOT on the current side of the EMA. When price
-- is above the EMA now, a value of 1 means the EMA cross happened this candle.
not_above_bars = bars_since (conditional (not price_above))
not_below_bars = bars_since (conditional (not price_below))
local bars_above = get_value (not_above_bars, nil)
local bars_below = get_value (not_below_bars, nil)

local fresh_above = bars_above ~= nil and bars_above <= window_candles
local fresh_below = bars_below ~= nil and bars_below <= window_candles

-- Event: CCI closes beyond its level on this candle.
local cci_breaks_up = data_is_ready and cci_previous <= cci_level and cci_now > cci_level
local cci_breaks_down = data_is_ready and cci_previous >= -cci_level and cci_now < -cci_level

-- "Fired" stays true for the rest of one run on the same side of the EMA, so
-- only the first CCI break after the EMA cross can create a marker.
local up_fired_before = get_value (up_fired [1], false)
local down_fired_before = get_value (down_fired [1], false)

up_fired = conditional (price_above and (up_fired_before or cci_breaks_up))
down_fired = conditional (price_below and (down_fired_before or cci_breaks_down))

higher_setup = conditional (
    price_above and fresh_above and cci_breaks_up and not up_fired_before
)

lower_setup = conditional (
    price_below and fresh_below and cci_breaks_down and not down_fired_before
)

-- 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)
)

if ema_visible then
    plot (ema_line, "EMA 50", ema_color, ema_width)
end

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

    plot_shape (
        confirmed_lower,
        "EMA CCI LOWER",
        shape_style.triangledown,
        shape_size.small,
        lower_color,
        shape_location.abovebar,
        -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 trend scripts

  • Trend
  • Context indicator
  • On price
  • Beginner

EMA Trend Ribbon

Plots a fast and slow exponential moving average over price and shades the space between them with a neutral ribbon, making the relationship between two smoothing speeds easier to see.

Indicators: EMA 9 · EMA 21

  • Trend
  • Signal engine
  • On price
  • Intermediate

IQ_WIKI_SCRIP_V1.0.1

A selective confluence overlay with five readable filters: EMA trend alignment and slope, RSI momentum without chasing extremes, ADX/DMI strength, ATR activity and a candle-quality guard.

Indicators: EMA 9/21/50 · RSI (14) · ADX/DMI (14) · ATR (14)

  • Trend
  • On price
  • Intermediate

ADX EMA28 Cross

Marks a candle that closes through the EMA 28 in the direction that +DI or -DI already favours. The DI lines act as a direction filter, the EMA cross as the trigger.

Indicators: ADX +DI / -DI (5) · EMA (28)

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.