Price EMA Distance Percent

← All 56 scripts

  • Momentum
  • Context indicator
  • Own panel
  • Beginner

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.

  • File iqow-price-ema-distance-percent.lua
  • Version 1.0.0
  • Size 62 lines · 2 KB
  • Timeframes Any timeframe
  • License MIT
Price EMA Distance Percent 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.

How to read it

Above zero means price is above its EMA; the further from zero, the more stretched price is compared with its average.

Indicators used

  • EMA (20) distance in %

Same view with built-in indicators: Moving Average Deviation shows a similar distance with IQ Option's built-in indicator.

Default settings

EMA period20
Reference zone±1%

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

Key points

  1. This panel shows the gap between price and its 20 EMA in percent.
  2. Zero means price sits exactly on the average.
  3. The reference zone gives you a fixed scale for stretched conditions.
  4. A stretched reading can stay stretched in a strong trend.

Limitations. Distance from an average does not imply a reversal. 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: cfad946108444b5a8e79198691b5f97b6d0fc949e8f6f02ec1e1af3ff7379494

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Starter Library
-- IQOW Price EMA Distance Percent v1.0.0
--
-- Measures the selected price source's percentage distance from an EMA.
-- Positive values are above the EMA; negative values are below it.
-- This indicator does not place trades, predict outcomes, or provide signals.

instrument {
    name = "IQOW Price EMA Distance Percent",
    short_name = "IQOW EMA Distance %",
    icon = "indicators:MA",
    overlay = false
}

period = input (20, "EMA period", input.integer, 1, 500)
source = input (1, "Source", input.string_selection, inputs.titles)

input_group {
    "Distance line",
    line_color = input { default = "#B58CFF", type = input.color },
    line_width = input { default = 2, type = input.line_width }
}

input_group {
    "Reference zone",
    reference_value = input (1.0, "Reference percent", input.double, 0.1, 100, 0.1, false),
    upper_color = input { default = rgba(37, 225, 84, 0.55), type = input.color },
    lower_color = input { default = rgba(255, 108, 88, 0.55), type = input.color },
    center_color = input { default = rgba(255, 255, 255, 0.35), type = input.color },
    zone_color = input { default = rgba(255, 255, 255, 0.05), type = input.color },
    reference_width = input { default = 1, type = input.line_width }
}

local source_series = inputs [source]

ema_basis = ema (source_series, period)
distance_percent = (source_series - ema_basis) / ema_basis * 100

fill_area (reference_value, -reference_value, "Reference zone", zone_color)

plot (distance_percent, "Price to EMA distance %", line_color, line_width)

hline {
    value = reference_value,
    color = upper_color,
    width = reference_width,
    style = style.dash_line
}

hline {
    value = -reference_value,
    color = lower_color,
    width = reference_width,
    style = style.dash_line
}

hline {
    value = 0,
    color = center_color,
    width = reference_width
}

More momentum scripts

  • Momentum
  • Signal engine
  • On price
  • Advanced

IQ_WIKI_SCRIP_V1.1.0

A completed-candle adaptation of the regular IQOptionWiki Signals score. It weighs RSI, MACD, Bollinger %B, five directional candle patterns and optional chart-volume confirmation into one score and marks new qualifying setups.

Indicators: RSI · MACD · Bollinger %B (population deviation) · Five candlestick patterns · Optional chart volume

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

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.