Morning Evening Star RSI Script

← All 56 scripts

  • Reversal
  • On price
  • Intermediate

Marks morning star and evening star candle patterns when RSI on the middle candle was at a low or high zone. RSI helps check that the pattern follows a push in the opposite direction.

  • File iqow-morning-evening-star-rsi.lua
  • Version 1.0.0
  • Size 146 lines · 5 KB
  • Timeframes 5-minute to 15-minute candles
  • License MIT
Morning Evening Star RSI 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

A full bearish candle, a small-bodied middle candle (at most 30% of the first body) and a bullish candle closing above the midpoint of the first candle's body, with RSI(14) below 40 on the middle candle.

LOWER marker

A full bullish candle, a small-bodied middle candle (at most 30% of the first body) and a bearish candle closing below the midpoint of the first candle's body, with RSI(14) above 60 on the middle 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

There are no lines on the chart; read the candles. A green HIGHER triangle marks the third candle of a morning star, and a red LOWER triangle the third candle of an evening star. The RSI zones are thresholds inside the script and can be changed in the inputs.

Indicators used

  • Morning and evening star candles
  • RSI (14, 40/60)

Same view with built-in indicators: Add RSI (14) with levels 40 and 60 and look for the three-candle star shape by eye.

Default settings

First candle minimum body share of range0.5
Middle candle maximum body share of first body0.3
RSI period14
RSI level for morning star40
RSI level for evening star60

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

Key points

  1. A morning star is three candles: a big bearish candle, a small indecisive candle and a bullish candle.
  2. The third candle must close above the midpoint of the first.
  3. RSI below 40 on the middle candle shows price had been pushed down first.
  4. The evening star is the mirror image with RSI above 60.
  5. Markers confirm on a completed candle.
  6. Look at the surrounding trend and levels, and practise on the Practice balance.

Limitations. The article describes the pattern with a doji-like middle candle and a preceding trend; the 50% and 30% body shares and the RSI levels are this script's way of defining that geometry. The pattern is rare and can fail without context such as support and resistance. 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: 73762d59b15bd63dac7148b3eb6593dfa158c710d4fe4f91ff99a065a8816428

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Morning Evening Star RSI v1.0.0
--
-- Three-candle star reversal patterns, filtered by RSI so the pattern forms
-- after a push into an oversold or overbought area. The middle candle must
-- have a small body (indecision) compared with the first candle.
--
-- HIGHER: morning star. Candle 1 is a full bearish candle, candle 2 has a
--         small body, candle 3 is bullish and closes above the midpoint of
--         candle 1's body. RSI(14) on candle 2 is below 40.
-- LOWER:  evening star. Mirror image, RSI(14) on candle 2 is above 60.
--
-- 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 Morning Evening Star RSI",
    short_name = "IQOW STAR RSI",
    overlay = true
}

input_group {
    "1. Candle geometry",
    first_body_ratio = input (0.5, "First candle: minimum body share of range", input.double, 0.1, 0.95, 0.05, false),
    small_body_ratio = input (0.3, "Middle candle: maximum body share of first body", input.double, 0.05, 0.9, 0.05, false)
}

input_group {
    "2. RSI",
    rsi_period = input (14, "RSI period", input.integer, 2, 100),
    oversold_level = input (40, "Morning star: RSI below", input.double, 5, 50, 1, false),
    overbought_level = input (60, "Evening star: RSI above", input.double, 50, 95, 1, false)
}

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

input_group {
    "Colors",
    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 }
}

rsi_value = rsi (close, rsi_period)

-- Candle 1 is two bars back, candle 2 one bar back, candle 3 is this bar.
local open_1 = get_value (open [2], nil)
local close_1 = get_value (close [2], nil)
local high_1 = get_value (high [2], nil)
local low_1 = get_value (low [2], nil)
local open_2 = get_value (open [1], nil)
local close_2 = get_value (close [1], nil)
local open_3 = get_value (open, nil)
local close_3 = get_value (close, nil)
local rsi_2 = get_value (rsi_value [1], nil)

local levels_are_valid = oversold_level < overbought_level

local data_is_ready =
    levels_are_valid and
    open_1 ~= nil and close_1 ~= nil and high_1 ~= nil and low_1 ~= nil and
    open_2 ~= nil and close_2 ~= nil and
    open_3 ~= nil and close_3 ~= nil and
    rsi_2 ~= nil

-- Body sizes and the first candle's range. A zero body or range never qualifies.
local body_1 = data_is_ready and math.abs (close_1 - open_1) or 0
local range_1 = data_is_ready and (high_1 - low_1) or 0
local body_2 = data_is_ready and math.abs (close_2 - open_2) or 0
local first_is_full = range_1 > 0 and body_1 >= first_body_ratio * range_1
local middle_is_small = body_1 > 0 and body_2 <= small_body_ratio * body_1

-- Candle 3 must close beyond the midpoint of candle 1's body.
local midpoint_1 = data_is_ready and (open_1 + close_1) / 2 or 0

local morning_star =
    data_is_ready and first_is_full and middle_is_small and
    close_1 < open_1 and
    close_3 > open_3 and close_3 > midpoint_1 and
    rsi_2 < oversold_level

local evening_star =
    data_is_ready and first_is_full and middle_is_small and
    close_1 > open_1 and
    close_3 < open_3 and close_3 < midpoint_1 and
    rsi_2 > overbought_level

higher_setup = conditional (morning_star)
lower_setup = conditional (evening_star)

-- 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 signals_visible then
    plot_shape (
        confirmed_higher,
        "Star HIGHER",
        shape_style.triangleup,
        shape_size.small,
        higher_color,
        shape_location.belowbar,
        -1,
        "HIGHER",
        signal_text_color
    )

    plot_shape (
        confirmed_lower,
        "Star 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 reversal scripts

  • Reversal
  • On price
  • Beginner

Donchian RSI Reversal

Marks the moment RSI leaves its oversold or overbought zone after price touched the matching Donchian band in the same excursion. The channel shows where price is stretched; RSI shows when momentum starts to turn.

Indicators: Donchian Channel (20) · RSI (14, 30/70)

  • Reversal
  • Own panel
  • Intermediate

Double Stochastic

Marks the candle where a slow Stochastic confirms a reversal cross that the fast Stochastic already showed in the same oversold or overbought zone. Using two settings asks the same question on two time scales before a marker appears.

Indicators: Stochastic fast (8, 3, 5) · Stochastic slow (17, 3, 7)

  • Reversal
  • On price
  • Beginner

Envelopes RSI

Marks a bounce from the Envelope lines: a candle reaches the outer line, closes back inside, and RSI confirms that price was stretched. It follows the 'bounce from the sides' method in the related article.

Indicators: Moving Average Envelopes (SMA 20, deviation 1) · RSI (14, 35/65)

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.