ADX +- DiThis Adx +-Di is just a complete version of what the ADX is supposed to signal.
So you have:
15 (contraction), 20 (threshold), 30 (expansion), 40 (resistance) levels.
Below 20 the price is not trending
Above 30 the price is trending
Below 15 price has been in contraction for too long
Between 20 and 30 price is in a "transition zone".
I finally added a "Resistance" level (40), which has to be adapted to best represent the historical levels where price usually encounters resistance, and where the price can be declared "overtrending", which means a return to lower levels is likely to happen.
I've chosen mild colors, and set the Adx Color to White, because I use black background, you can easily change that.
Enjoy
-Maurice
在脚本中搜索"重庆30天天气预报"
ICHIMOKU MTFMultiple Time Frame Version of Ichimoku Kinko Hyo Indicator.
Created in 1940's by Goichi Hosoda withe the help of University students in Japan.
Ichimoku is one of the best trend following indicators that works nearly perfect in all markets and time frames.
Ichimoku is originally an built in indicator in Tradingview but there are some problems like:
the indicator hast 5 lines but you can change only 4 parameters in the settings menu of Tradingview Charts which you could only control 3 of the lines effectively. A second problem is that Tradingview preferred to use English titles for the ICHIMOKU lines instead of giving them the most common original Japanese ones. (So I rewrite the indicator)
Kijun Sen (blue line): Also called standard line or base line, this is calculated by averaging the highest high and the lowest low for the past 26 periods.
Tenkan Sen (red line): This is also known as the turning line and is derived by averaging the highest high and the lowest low for the past nine periods.
Chikou Span (Plum line): This is called the lagging line. It is today’s closing price plotted 26 periods behind.
Senkou SpanA (green line): The first Senkou line is calculated by averaging the Tenkan Sen and the Kijun Sen and plotted 26 periods ahead.
Senkou SpanB (purple line):
The second Senkou line is determined by averaging the highest high and the lowest low for the past 52 periods and plotted 26 periods ahead.
PERSONALLY I ADVISE YOU TO USE ICHIMOKU WITH DEAFULT LENGTHS (9,26,26,52,26) IN ORDER FOR STOCK MARKETS AND FOREX MARKETS
FOR CRYPTO YOU'D BETTER USE:
10,30,30,60,30 OR 20,60,60,120,60
THE TRICKY THING IS THAT KEEPING THE 1-3-3-6-3 RATIO CONSTANT IS NECESSARY
Here's a link of my Youtube video explaining ICHIMOKU but unfortunately only in TURKISH:
www.youtube.com
Developed by: Goichi Hosoda
Here's the link to a complete list of all my indicators:
tr.tradingview.com
Ichimoku kullanımı anlattığım detaylı video serisini linkten izleyebilirsiniz:
www.youtube.com
İndikatörü geliştiren: Goichi Hosoda
ICHIMOKU Kinko Hyo by KIVANC fr3762Created in 1940's by Goichi Hosoda withe the help of University students in Japan.
Ichimoku is one of the best trend following indicators that works nearly perfect in all markets and time frames.
Ichimoku is originally an built in indicator in Tradingview but there are some problems like:
the indicator hast 5 lines but you can change only 4 parameters in the settings menu of Tradingview Charts which you could only control 3 of the lines effectively. A second problem is that Tradingview preferred to use English titles for the ICHIMOKU lines instead of giving them the most common original Japanese ones. (So I rewrite the indicator)
Kijun Sen (blue line): Also called standard line or base line, this is calculated by averaging the highest high and the lowest low for the past 26 periods.
Tenkan Sen (red line): This is also known as the turning line and is derived by averaging the highest high and the lowest low for the past nine periods.
Chikou Span (Plum line): This is called the lagging line. It is today’s closing price plotted 26 periods behind.
Senkou SpanA (green line): The first Senkou line is calculated by averaging the Tenkan Sen and the Kijun Sen and plotted 26 periods ahead.
Senkou SpanB (purple line):
The second Senkou line is determined by averaging the highest high and the lowest low for the past 52 periods and plotted 26 periods ahead.
PERSONALLY I ADVISE YOU TO USE ICHIMOKU WITH DEAFULT LENGTHS (9,26,26,52,26) IN ORDER FOR STOCK MARKETS AND FOREX MARKETS
FOR CRYPTO YOU'D BETTER USE:
10,30,30,60,30 OR 20,60,60,120,60
THE TRICKY THING IS THAT KEEPING THE 1-3-3-6-3 RATIO CONSTANT IS NECESSARY
Here's a link of my Youtube video explaining ICHIMOKU but unfortunately only in TURKISH:
www.youtube.com
Developed by: Goichi Hosoda
RSI Multi-TimeframeThe Relative Strength Index (RSI) is an extremely useful oscillating momentum indicator that was developed by J. Welles Wilder and is one of the most widely used indicators in technical analysis.
HOW IS IT USED ?
In the classic view, a security is thought to be overbought when its RSI reading is above 70 and oversold when its RSI reading falls below 30. This makes it a good indicator for mean-reversion systems. Wilder recommended using the 70 and 30 levels as overbought and oversold levels respectively. When the RSI moves up over the 30 line it is considered a possible bullish reversal while a move down below the 70 line is considered a possible bearish reversal.
When the RSI is above 70 it is a potential exit signal if you are in a long position and when it is below 30 it is a potential exit signal if you are in a short position. Some traders use extreme readings for entry points in the direction of the long-term trend. Thus, if the long-term trend is bullish, then you'd wait for the RSI to reach oversold territory, which would be a potential entry point for a long position. Conversely, if the long-term trend is bearish, then overbought conditions could be a potential point to short the security.
I added the possibility to add on the chart a 2nd timeframe for confirmation.
If you found this script useful, a tip is always welcome... :)
Ichimoku Cloud w/SelIchimoku Cloud with selection for:
Regular:
conversionPeriods = 9,
basePeriods = 26
laggingSpan2Periods = 52,
displacement = 26
Crypto:
conversionPeriods = 10,
basePeriods = 30,
laggingSpan2Periods = 60,
displacement = 30
Crypto Doubled:
conversionPeriods = 20,
basePeriods = 60,
laggingSpan2Periods = 120,
displacement = 30
CM_Ultimate RSI Multi Time FrameAvailable Options on Inputs Tab!!!
RSI with ability to change first RSI to a different Time Frame.(Defaults To Current Chart Time Frame).
Ability To Turn On/Off Background Highlighting if First RSI is Above/Below 70 or 30 Lines.
Ability To Turn On/Off Background Highlighting When First RSI Crosses Above 30 Or Below 70.
Ability To Turn On/Off "B" Or "S" When First RSI Crosses Above 30 Or Below 70.
Ability To Turn On/Off Mid -Line Plot.
Option To Plot 2nd RSI to show different Time Frames on same chart!!!
Ability To Use Different Look Back Period If You Plot 2nd RSI.
Opening Range Breakout with 2 Profit Targets.Opening Range Breakout with 2 Profit Targets.
Updated Indicator now works on all Symbols with Many Different Session Options.
***Known PineScript Issue…While the Opening Range is being Formed the lines only adjust for that individual bar. Just reset Indicator after Opening Range Completes.
***All Times are Based on New York Time
Session Options Forex U.S. Banks Open (8:00), Gold U.S. Open (8:20), Oil U.S. Open (9:00), U.S. Cash Session - Stocks (9:30), NY Forex Open (17:00) , Europe Open (02:00), or if you choose Setting 0 the Session Runs from 00:00 to 00:00 (Midnight to Midnight).
***Ability to use 60 minute Opening Range, 30 minute, 15 minute, and many other options.
***However you can manually change the times in the Inputs Tab to adjust for any session you prefer. This is useful for Day Light Savings Adjustments. Also the default times work if your charts are set to EST Time. If you use A different time zone in your settings you need to Adjust the times in the inputs tab.
Initially Opening Range High and Low plot as Yellow Lines. If Price Goes Above Opening Range then Line Turns Green. If Price Goes Below Opening Range Line Turns Red.
By default the First Profit Target is 1/2 the Width of the Opening Range and the 2nd Profit Target is 1 Times the Opening Range. However these are Adjustable in the Inputs Tab.
By Default the Opening Range Length is 1 Hour. However, you can Change the Opening Range Length to 15 min, 30 min, 2 hours etc. in the Inputs Tab.
Plots a 1 Above or Below Candle when 1st Profit Target is Achieved, and a 2 when 2nd Profit Target is Achieved.
ICT Killzones & FVG// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © Mutharasan12
//@version=5
indicator("ICT Killzones & FVG", "ICT Killzones & FVG", overlay = true, max_labels_count = 500, max_lines_count = 500, max_boxes_count = 500)
// ---------------------------------------- Constant Functions --------------------------------------------------
get_line_type(_style) =>
result = switch _style
'Solid' => line.style_solid
'Dotted' => line.style_dotted
'Dashed' => line.style_dashed
result
get_size(x) =>
result = switch x
'Auto' => size.auto
'Tiny' => size.tiny
'Small' => size.small
'Normal' => size.normal
'Large' => size.large
'Huge' => size.huge
get_table_pos(pos) =>
result = switch pos
"Bottom Center" => position.bottom_center
"Bottom Left" => position.bottom_left
"Bottom Right" => position.bottom_right
"Middle Center" => position.middle_center
"Middle Left" => position.middle_left
"Middle Right" => position.middle_right
"Top Center" => position.top_center
"Top Left" => position.top_left
"Top Right" => position.top_right
get_font_style(s) =>
result = switch s
'Monospace' => font.family_monospace
'Default' => font.family_default
// ---------------------------------------- Constant Functions --------------------------------------------------
// ---------------------------------------- Inputs --------------------------------------------------
gmt_tz = input.string('America/New_York', "Timezone", options = , tooltip = "Note GMT is not adjusted to reflect Daylight Saving Time changes", group = 'Time Zone')
DWM_profile = input.bool(true,"Show All Profile",inline="Show",group = 'Profile')
D_profile = input.bool(true,"Show Daily",inline = "Show",group = 'Profile')
hide_lines_DO = input.timeframe("60","Daily:",inline = "Hide",group = 'Hide Above')
W_profile = input.bool(true,"Weekly",inline="Show",group = 'Profile')
hide_lines_WO = input.timeframe("240","Weekly:",inline="Hide",group = 'Hide Above')
M_profile = input.bool(true,"Monthly",inline="Show",group = 'Profile')
hide_lines_MO = input.timeframe("1D","Monthly:",inline="Hide",group = 'Hide Above')
show_kz = input.bool(false, "Show Killzone Boxes", inline = "skz", group = 'Hide KillZone')
var g_SETTINGS = "Settings"
max_days = input.int(60, "Drawing Limit", 1, inline = 'dl', tooltip = "Only this many drawings will be kept on the chart, for each selected drawing type (killzone boxes, pivot lines, open lines, etc.)", group = g_SETTINGS)
tf_limit = input.timeframe("30", "Timeframe Limit", inline = 'dl', tooltip = "Drawings will not appear on timeframes greater than or equal to this", group = g_SETTINGS)
lbl_size = get_size(input.string('Tiny', "Label Size", inline = 'sc', options = , tooltip = "The size of all labels", group = g_SETTINGS))
font_style = get_font_style(input.string('Monospace', "Font Style", inline = 'sc', group = g_SETTINGS, options = ))
txt_color = input.color(#000000, "Text Color", inline = 'sc', tooltip = "The color of all label and table text", group = g_SETTINGS)
use_cutoff = input.bool(true, "Drawing Cutoff Time", inline = "CO", tooltip = "When enabled, all pivots and open price lines will stop extending at this time", group = g_SETTINGS)
cutoff = input.session("1700-1701", "", inline = "CO", group = g_SETTINGS)
var g_KZ = "Killzones"
show_kz_text = input.bool(false, "Display Text", inline = "KZ", group = g_KZ)
box_transparency = input.int(85, "Box Transparency", 0, 100, group = g_KZ)
text_transparency = input.int(50, "Text Transparency", 0, 100, group = g_KZ)
use_asia = input.bool(true, "", inline = "ASIA", group = g_KZ)
as_txt = input.string("ASIA", "", inline = "ASIA", group = g_KZ)
asia = input.session("2000-0000", "", inline = "ASIA", group = g_KZ)
as_color = input.color(#9598a1, "", inline = "ASIA", group = g_KZ)
use_london = input.bool(true, "", inline = "LONDON", group = g_KZ)
lo_txt = input.string("OPEN", "", inline = "LONDON", group = g_KZ)
london = input.session("0200-0500", "", inline = "LONDON", group = g_KZ)
lo_color = input.color(#9598a1, "", inline = "LONDON", group = g_KZ)
use_nyam = input.bool(true, "", inline = "NYAM", group = g_KZ)
na_txt = input.string("NYAM", "", inline = "NYAM", group = g_KZ)
nyam = input.session("0700-1000", "", inline = "NYAM", group = g_KZ)
na_color = input.color(#9598a1, "", inline = "NYAM", group = g_KZ)
use_nylu = input.bool(false, "", inline = "NYLU", group = g_KZ)
nl_txt = input.string("Lunch", "", inline = "NYLU", group = g_KZ)
nylu = input.session("1200-1300", "", inline = "NYLU", group = g_KZ)
nl_color = input.color(#9598a1, "", inline = "NYLU", group = g_KZ)
use_nypm = input.bool(false, "", inline = "NYPM", group = g_KZ)
np_txt = input.string("NYPM", "", inline = "NYPM", group = g_KZ)
nypm = input.session("1300-1600", "", inline = "NYPM", group = g_KZ)
np_color = input.color(#9598a1, "", inline = "NYPM", group = g_KZ)
use_loop = input.bool(true, "", inline = "LOOP", group = g_KZ)
op_txt = input.string("CBDR", "", inline = "LOOP", group = g_KZ)
loop = input.session("1400-2000", "", inline = "LOOP", group = g_KZ)
op_color = input.color(#9598a1, "", inline = "LOOP", group = g_KZ)
use_locl = input.bool(true, "", inline = "LOCL", group = g_KZ)
cl_txt = input.string("CLOSE", "", inline = "LOCL", group = g_KZ)
locl = input.session("1000-1200", "", inline = "LOCL", group = g_KZ)
cl_color = input.color(#9598a1, "", inline = "LOCL", group = g_KZ)
use_sb1 = input.bool(false, "", inline = "SB1", group = g_KZ)
m1_txt = input.string("London SB", "", inline = "SB1", group = g_KZ)
sb1 = input.session("0300-0400", "", inline = "SB1", group = g_KZ)
m1_color = input.color(#9598a1, "", inline = "SB1", group = g_KZ)
use_sb2 = input.bool(false, "", inline = "SB2", group = g_KZ)
m2_txt = input.string("NewYork AM SB", "", inline = "SB2", group = g_KZ)
sb2 = input.session("1000-1100", "", inline = "SB2", group = g_KZ)
m2_color = input.color(#9598a1, "", inline = "SB2", group = g_KZ)
use_sb3 = input.bool(false, "", inline = "SB3", group = g_KZ)
m3_txt = input.string("NewYork PM SB", "", inline = "SB3", group = g_KZ)
sb3 = input.session("1400-1500", "", inline = "SB3", group = g_KZ)
m3_color = input.color(#9598a1, "", inline = "SB3", group = g_KZ)
var g_LABELS = "Killzone Pivots"
use_alerts = input.bool(false, "Alert Broken Pivots", inline = "PV", group = g_LABELS)
show_pivots = input.bool(false, "Show Pivots", inline = "SV", group = g_LABELS)
show_labels = input.bool(false, "Pivots Labels", inline = "SV", group = g_LABELS)
show_midpoints = input.bool(false, "Pivots Midpoints",inline = "SV", group = g_LABELS)
ext_pivots = input.string("Until Mitigated", "Extend Pivots...", options = , group = g_LABELS)
ext_which = input.string("Most Recent", "...From Which Sessions", options = , group = g_LABELS)
ash_str = input.string("AS.H", "Killzone 01 Labels", inline = "L_AS", group = g_LABELS)
asl_str = input.string("AS.L", "", inline = "L_AS", group = g_LABELS)
loh_str = input.string("LO.H", "Killzone 02 Labels", inline = "L_LO", group = g_LABELS)
lol_str = input.string("LO.L", "", inline = "L_LO", group = g_LABELS)
nah_str = input.string("NYAM.H", "Killzone 03 Labels", inline = "L_NA", group = g_LABELS)
nal_str = input.string("NYAM.L", "", inline = "L_NA", group = g_LABELS)
nlh_str = input.string("NYL.H", "Killzone 04 Labels", inline = "L_NL", group = g_LABELS)
nll_str = input.string("NYL.L", "", inline = "L_NL", group = g_LABELS)
nph_str = input.string("NYPM.H", "Killzone 05 Labels", inline = "L_NP", group = g_LABELS)
npl_str = input.string("NYPM.L", "", inline = "L_NP", group = g_LABELS)
oph_str = input.string("LOOP.H", "Killzone 06 Labels", inline = "L_OP", group = g_LABELS)
opl_str = input.string("LOOP.L", "", inline = "L_OP", group = g_LABELS)
clh_str = input.string("LOCL.H", "Killzone 07 Labels", inline = "L_CL", group = g_LABELS)
cll_str = input.string("LOCL.L", "", inline = "L_CL", group = g_LABELS)
m1h_str = input.string("SB1.H", "Killzone 08 Labels", inline = "L_M1", group = g_LABELS)
m1l_str = input.string("SB1.L", "", inline = "L_M1", group = g_LABELS)
m2h_str = input.string("SB2.H", "Killzone 09 Labels", inline = "L_M2", group = g_LABELS)
m2l_str = input.string("SB2.L", "", inline = "L_M2", group = g_LABELS)
m3h_str = input.string("SB3.H", "Killzone 10 Labels", inline = "L_M3", group = g_LABELS)
m3l_str = input.string("SB3.L", "", inline = "L_M3", group = g_LABELS)
kzp_style = get_line_type(input.string(defval = 'Solid', title = "Pivot Style", options = , inline = "KZP", group = g_LABELS))
kzp_width = input.int(1, "", inline = "KZP", group = g_LABELS)
kzm_style = get_line_type(input.string(defval = 'Dotted', title = "Midpoint Style", options = , inline = "KZM", group = g_LABELS))
kzm_width = input.int(1, "", inline = "KZM", group = g_LABELS)
var g_RNG = "Killzone Range"
show_range = input.bool(false, "Show Killzone Range", tooltip = "Show the most recent ranges of each selected killzone, from high to low", group = g_RNG)
show_range_avg = input.bool(true, "Show Average", tooltip = "Show the average range of each selected killzone", group = g_RNG)
range_avg = input.int(5, "Average Length", 0, tooltip = "This many previous sessions will be used to calculate the average. If there isn't enough data on the current chart, it will use as many sessions as possible", group = g_RNG)
range_pos = get_table_pos(input.string('Top Right', "Table Position", options = , group = g_RNG))
range_size = get_size(input.string('Normal', "Table Size", options = , group = g_RNG))
var g_DWM = "Day - Week - Month"
dow_labels = input.bool(false, "Day of Week Labels", inline = "DOW", group = g_DWM)
dow_yloc = input.string('Bottom', "", options = , inline = "DOW", group = g_DWM)
dow_xloc = input.string('Midnight', "", options = , inline = "DOW", group = g_DWM)
sep_unlimited = input.bool(true, "Unlimited", tooltip = "Unlimited will show as many of the selected lines as possible. Otherwise, the session drawing limit will be used", group = g_DWM)
show_d_open = input.bool(true, "D Open", inline = "DO", group = g_DWM)
dhl = input.bool(true, "High/Low", inline = "DO", tooltip = "", group = g_DWM)
ds = input.bool(true, "Separators", inline = "DO", tooltip = "Mark where a new day begins", group = g_DWM)
d_color = input.color(color.blue, "", inline = "DO", group = g_DWM)
show_w_open = input.bool(true, "W Open", inline = "WO", group = g_DWM)
whl = input.bool(true, "High/Low", inline = "WO", tooltip = "", group = g_DWM)
ws = input.bool(true, "Separators", inline = "WO", tooltip = "Mark where a new week begins", group = g_DWM)
w_color = input.color(#089981, "", inline = "WO", group = g_DWM)
show_m_open = input.bool(true, "M Open", inline = "MO", group = g_DWM)
mhl = input.bool(true, "High/Low", inline = "MO", tooltip = "", group = g_DWM)
ms = input.bool(true, "Separators", inline = "MO", tooltip = "Mark where a new month begins", group = g_DWM)
m_color = input.color(color.red, "", inline = "MO", group = g_DWM)
htf_style = get_line_type(input.string(defval = 'Dotted', title = "Style", options = , inline = "D0", group = g_DWM))
htf_width = input.int(1, "", inline = "D0", group = g_DWM)
var g_OPEN = "Opening Prices"
open_unlimited = input.bool(true, "Unlimited", tooltip = "Unlimited will show as many of the selected lines as possible. Otherwise, the session drawing limit will be used", group = g_OPEN)
hide_hline = input.bool(true,"Show Opening Price",group = g_OPEN)
hide_lines_h = input.timeframe("60","Hide Above Time Frame",group = g_OPEN)
use_h1 = input.bool(true, "", inline = "H1", group = g_OPEN)
h1_text = input.string("00:00", "", inline = "H1", group = g_OPEN)
h1 = input.session("0000-0001", "", inline = "H1", group = g_OPEN)
h1_color = input.color(#000000, "", inline = "H1", group = g_OPEN)
use_h2 = input.bool(true, "", inline = "H2", group = g_OPEN)
h2_text = input.string("08:30", "", inline = "H2", group = g_OPEN)
h2 = input.session("0830-0831", "", inline = "H2", group = g_OPEN)
h2_color = input.color(#000000, "", inline = "H2", group = g_OPEN)
use_h3 = input.bool(false, "", inline = "H3", group = g_OPEN)
h3_text = input.string("10:00", "", inline = "H3", group = g_OPEN)
h3 = input.session("1000-1001", "", inline = "H3", group = g_OPEN)
h3_color = input.color(#000000, "", inline = "H3", group = g_OPEN)
use_h4 = input.bool(false, "", inline = "H4", group = g_OPEN)
h4_text = input.string("14:00", "", inline = "H4", group = g_OPEN)
h4 = input.session("1400-1401", "", inline = "H4", group = g_OPEN)
h4_color = input.color(#000000, "", inline = "H4", group = g_OPEN)
hz_style = get_line_type(input.string(defval = 'Dotted', title = "Style", options = , inline = "H0", group = g_OPEN))
hz_width = input.int(1, "", inline = "H0", group = g_OPEN)
var g_VERTICAL = "Timestamps"
hide_vline = input.bool(true,"Show Timestamp",group = g_VERTICAL)
hide_lines_v = input.timeframe("60","Hide Above Time Frame",group = g_VERTICAL)
use_v1 = input.bool(true, "", inline = "V1", group = g_VERTICAL)
v1 = input.session("0000-0001", "", inline = "V1", group = g_VERTICAL)
v1_color = input.color(#000000, "", inline = "V1", group = g_VERTICAL)
use_v2 = input.bool(false, "", inline = "V2", group = g_VERTICAL)
v2 = input.session("0800-0801", "", inline = "V2", group = g_VERTICAL)
v2_color = input.color(#000000, "", inline = "V2", group = g_VERTICAL)
use_v3 = input.bool(false, "", inline = "V3", group = g_VERTICAL)
v3 = input.session("1000-1001", "", inline = "V3", group = g_VERTICAL)
v3_color = input.color(#000000, "", inline = "V3", group = g_VERTICAL)
use_v4 = input.bool(false, "", inline = "V4", group = g_VERTICAL)
v4 = input.session("1200-1201", "", inline = "V4", group = g_VERTICAL)
v4_color = input.color(#000000, "", inline = "V4", group = g_VERTICAL)
vl_style = get_line_type(input.string(defval = 'Dotted', title = "Style", options = , inline = "V0", group = g_VERTICAL))
vl_width = input.int(1, "", inline = "V0", group = g_VERTICAL)
// ---------------------------------------- Inputs --------------------------------------------------
// ---------------------------------------- Variables & Constants --------------------------------------------------
type kz
string _title
box _box
line _hi_line
line _md_line
line _lo_line
label _hi_label
label _lo_label
bool _hi_valid
bool _md_valid
bool _lo_valid
float _range_store
float _range_current
type hz
line LN
label LB
bool CO
type dwm_hl
line hi_line
line lo_line
label hi_label
label lo_label
type dwm_info
string tf
float o = na
float h = na
float l = na
float ph = na
float pl = na
var as_kz = kz.new(as_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var lo_kz = kz.new(lo_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var na_kz = kz.new(na_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var nl_kz = kz.new(nl_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var np_kz = kz.new(np_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var op_kz = kz.new(op_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var cl_kz = kz.new(cl_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var m1_kz = kz.new(m1_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var m2_kz = kz.new(m2_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var m3_kz = kz.new(m3_txt, array.new_box(), array.new_line(), array.new_line(), array.new_line(), array.new_label(), array.new_label(), array.new_bool(), array.new_bool(), array.new_bool(), array.new_float())
var hz_1 = hz.new(array.new_line(), array.new_label(), array.new_bool())
var hz_2 = hz.new(array.new_line(), array.new_label(), array.new_bool())
var hz_3 = hz.new(array.new_line(), array.new_label(), array.new_bool())
var hz_4 = hz.new(array.new_line(), array.new_label(), array.new_bool())
var d_hl = dwm_hl.new(array.new_line(), array.new_line(), array.new_label(), array.new_label())
var w_hl = dwm_hl.new(array.new_line(), array.new_line(), array.new_label(), array.new_label())
var m_hl = dwm_hl.new(array.new_line(), array.new_line(), array.new_label(), array.new_label())
var d_info = dwm_info.new("D")
var w_info = dwm_info.new("W")
var m_info = dwm_info.new("M")
t_as = not na(time("", asia, gmt_tz))
t_lo = not na(time("", london, gmt_tz))
t_na = not na(time("", nyam, gmt_tz))
t_nl = not na(time("", nylu, gmt_tz))
t_np = not na(time("", nypm, gmt_tz))
t_op = not na(time("", loop, gmt_tz))
t_cl = not na(time("", locl, gmt_tz))
t_m1 = not na(time("", sb1, gmt_tz))
t_m2 = not na(time("", sb2, gmt_tz))
t_m3 = not na(time("", sb3, gmt_tz))
t_co = not na(time("", cutoff, gmt_tz))
t_h1 = not na(time("", h1, gmt_tz))
t_h2 = not na(time("", h2, gmt_tz))
t_h3 = not na(time("", h3, gmt_tz))
t_h4 = not na(time("", h4, gmt_tz))
t_v1 = not na(time("", v1, gmt_tz))
t_v2 = not na(time("", v2, gmt_tz))
t_v3 = not na(time("", v3, gmt_tz))
t_v4 = not na(time("", v4, gmt_tz))
var d_sep_line = array.new_line()
var w_sep_line = array.new_line()
var m_sep_line = array.new_line()
var d_line = array.new_line()
var w_line = array.new_line()
var m_line = array.new_line()
var d_label = array.new_label()
var w_label = array.new_label()
var m_label = array.new_label()
var v1_line = array.new_line()
var v2_line = array.new_line()
var v3_line = array.new_line()
var v4_line = array.new_line()
var transparent = #ffffff00
var ext_current = ext_which == 'Most Recent'
var ext_past = ext_pivots == 'Past Mitigation'
update_dwm_info(dwm_info n) =>
if timeframe.change(n.tf)
n.ph := n.h
n.pl := n.l
n.o := open
n.h := high
n.l := low
else
n.h := math.max(high, n.h)
n.l := math.min(low, n.l)
if dhl or show_d_open
update_dwm_info(d_info)
if whl or show_w_open
update_dwm_info(w_info)
if mhl or show_m_open
update_dwm_info(m_info)
// ---------------------------------------- Variables & Constants --------------------------------------------------
// ---------------------------------------- Functions --------------------------------------------------
get_box_color(color c) =>
result = color.new(c, box_transparency)
get_text_color(color c) =>
result = color.new(c, text_transparency)
// ---------------------------------------- Functions --------------------------------------------------
// ---------------------------------------- Core Logic --------------------------------------------------
dwm_sep(string tf, bool use, line arr, color col) =>
if use
if timeframe.change(tf)
arr.unshift(line.new(bar_index, high*1.0001, bar_index, low, style = htf_style, width = htf_width, extend = extend.both, color = col))
if not sep_unlimited and arr.size() > max_days
arr.pop().delete()
dwm_open(string tf, bool use, line lns, label lbls, dwm_info n, color col) =>
if use
if timeframe.change(tf)
lns.unshift(line.new(time, n.o, time, n.o, xloc = xloc.bar_time, style = htf_style, width = htf_width, color = col))
lbls.unshift(label.new(time, n.o, tf + " OPEN", xloc = xloc.bar_time, style = label.style_label_left, color = transparent, textcolor = txt_color, size = lbl_size, text_font_family = font_style))
if not sep_unlimited and lns.size() > max_days
lns.pop().delete()
lbls.pop().delete()
else if lns.size() > 0
lns.get(0).set_x2(time)
lbls.get(0).set_x(time)
dwm_hl(string tf, bool use, dwm_hl hl, dwm_info n, color col) =>
if use
if timeframe.change(tf)
hl.hi_line.unshift(line.new(time, n.ph, time, n.ph, xloc = xloc.bar_time, style = htf_style, width = htf_width, color = col))
hl.lo_line.unshift(line.new(time, n.pl, time, n.pl, xloc = xloc.bar_time, style = htf_style, width = htf_width, color = col))
hl.hi_label.unshift(label.new(time, n.ph, "P"+tf+"H", xloc = xloc.bar_time, style = label.style_label_left, color = transparent, textcolor = txt_color, size = lbl_size, text_font_family = font_style))
hl.lo_label.unshift(label.new(time, n.pl, "P"+tf+"L", xloc = xloc.bar_time, style = label.style_label_left, color = transparent, textcolor = txt_color, size = lbl_size, text_font_family = font_style))
if not sep_unlimited and hl.hi_line.size() > max_days
hl.hi_line.pop().delete()
hl.lo_line.pop().delete()
hl.hi_label.pop().delete()
hl.lo_label.pop().delete()
else if hl.hi_line.size() > 0
hl.hi_line.get(0).set_x2(time)
hl.lo_line.get(0).set_x2(time)
hl.hi_label.get(0).set_x(time)
hl.lo_label.get(0).set_x(time)
dwm() =>
//if timeframe.in_seconds() <= hide_lines_sessions *60
if DWM_profile
if D_profile and timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_DO)
// Draw Daily separators, open lines, and high/low lines
dwm_sep("D", ds, d_sep_line, d_color)
dwm_open("D", show_d_open, d_line, d_label, d_info, d_color)
dwm_hl("D", dhl, d_hl, d_info, d_color)
// Draw Weekly and Monthly only if Daily profile allows it
if W_profile and timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_WO)
dwm_sep("W", ws, w_sep_line, w_color)
dwm_open("W", show_w_open, w_line, w_label, w_info, w_color)
dwm_hl("W", whl, w_hl, w_info, w_color)
if M_profile and timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_MO)
dwm_sep("M", ms, m_sep_line, m_color)
dwm_open("M", show_m_open, m_line, m_label, m_info, m_color)
dwm_hl("M", mhl, m_hl, m_info, m_color)
else if W_profile and timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_WO)
// Draw Weekly separators, open lines, and high/low lines
dwm_sep("W", ws, w_sep_line, w_color)
dwm_open("W", show_w_open, w_line, w_label, w_info, w_color)
dwm_hl("W", whl, w_hl, w_info, w_color)
// Draw Monthly only if Weekly profile allows it
if M_profile and timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_MO)
dwm_sep("M", ms, m_sep_line, m_color)
dwm_open("M", show_m_open, m_line, m_label, m_info, m_color)
dwm_hl("M", mhl, m_hl, m_info, m_color)
else if M_profile and timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_MO)
// Draw Monthly separators, open lines, and high/low lines
dwm_sep("M", ms, m_sep_line, m_color)
dwm_open("M", show_m_open, m_line, m_label, m_info, m_color)
dwm_hl("M", mhl, m_hl, m_info, m_color)
vline(bool use, bool t, line arr, color col) =>
if use
if t and not t
arr.unshift(line.new(bar_index, high*1.0001, bar_index, low, style = vl_style, width = vl_width, extend = extend.both, color = col))
vlines() =>
if hide_vline
if timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_v)
vline(use_v1, t_v1, v1_line, v1_color)
vline(use_v2, t_v2, v2_line, v2_color)
vline(use_v3, t_v3, v3_line, v3_color)
vline(use_v4, t_v4, v4_line, v4_color)
hz_line(bool use, bool t, hz hz, string txt, color col) =>
if use
if t and not t
hz.LN.unshift(line.new(bar_index, open, bar_index, open, style = hz_style, width = hz_width, color = col))
hz.LB.unshift(label.new(bar_index, open, txt, style = label.style_label_left, color = transparent, textcolor = txt_color, size = lbl_size, text_font_family = font_style))
array.unshift(hz.CO, false)
if not open_unlimited and hz.LN.size() > max_days
hz.LN.pop().delete()
hz.LB.pop().delete()
hz.CO.pop()
if not t and hz.CO.size() > 0
if not hz.CO.get(0)
hz.LN.get(0).set_x2(bar_index)
hz.LB.get(0).set_x(bar_index)
if (use_cutoff ? t_co : false)
hz.CO.set(0, true)
hz_lines() =>
if hide_hline
if timeframe.in_seconds("") <= timeframe.in_seconds(hide_lines_h)
hz_line(use_h1, t_h1, hz_1, h1_text, h1_color)
hz_line(use_h2, t_h2, hz_2, h2_text, h2_color)
hz_line(use_h3, t_h3, hz_3, h3_text, h3_color)
hz_line(use_h4, t_h4, hz_4, h4_text, h4_color)
del_kz(kz k) =>
if k._box.size() > max_days
k._box.pop().delete()
if k._hi_line.size() > max_days
k._hi_line.pop().delete()
k._lo_line.pop().delete()
k._hi_valid.pop()
k._lo_valid.pop()
if show_midpoints
k._md_line.pop().delete()
k._md_valid.pop()
if k._hi_label.size() > max_days
k._hi_label.pop().delete()
k._lo_label.pop().delete()
adjust_in_kz(kz kz, bool t) =>
if t
kz._box.get(0).set_right(time)
kz._box.get(0).set_top(math.max(kz._box.get(0).get_top(), high))
kz._box.get(0).set_bottom(math.min(kz._box.get(0).get_bottom(), low))
kz._range_current := kz._box.get(0).get_top() - kz._box.get(0).get_bottom()
if show_pivots and kz._hi_line.size() > 0
if high > kz._hi_line.get(0).get_y1()
kz._hi_line.get(0).set_xy1(time, high)
kz._hi_line.get(0).set_xy2(time, high)
if low < kz._lo_line.get(0).get_y1()
kz._lo_line.get(0).set_xy1(time, low)
kz._lo_line.get(0).set_xy2(time, low)
if show_midpoints
kz._md_line.get(0).set_xy1(time, math.avg(kz._hi_line.get(0).get_y2(), kz._lo_line.get(0).get_y2()))
kz._md_line.get(0).set_xy2(time, math.avg(kz._hi_line.get(0).get_y2(), kz._lo_line.get(0).get_y2()))
if show_labels and kz._hi_label.size() > 0
if high > kz._hi_label.get(0).get_y()
kz._hi_label.get(0).set_xy(time, high)
if low < kz._lo_label.get(0).get_y()
kz._lo_label.get(0).set_xy(time, low)
adjust_out_kz(kz kz, bool t) =>
if not t and kz._box.size() > 0
if t
array.unshift(kz._range_store, kz._range_current)
if kz._range_store.size() > range_avg
kz._range_store.pop()
if kz._box.size() > 0 and show_pivots
for i = 0 to kz._box.size() - 1
if not ext_current or (ext_current and i == 0)
if ext_past ? true : (kz._hi_valid.get(i) == true)
kz._hi_line.get(i).set_x2(time)
if high > kz._hi_line.get(i).get_y1() and kz._hi_valid.get(i) == true
if use_alerts and i == 0
alert("Broke "+kz._title+" High", alert.freq_once_per_bar)
kz._hi_valid.set(i, false)
else if (use_cutoff ? t_co : false)
kz._hi_valid.set(i, false)
if ext_past ? true : (kz._lo_valid.get(i) == true)
kz._lo_line.get(i).set_x2(time)
if low < kz._lo_line.get(i).get_y1() and kz._lo_valid.get(i) == true
if use_alerts and i == 0
alert("Broke "+kz._title+" Low", alert.freq_once_per_bar)
kz._lo_valid.set(i, false)
else if (use_cutoff ? t_co : false)
kz._lo_valid.set(i, false)
if show_midpoints
kz._md_line.get(i).set_x2(time)
else
break
manage_kz(kz kz, bool use, bool t, color c, string box_txt, string hi_txt, string lo_txt) =>
if timeframe.in_seconds("") <= timeframe.in_seconds(tf_limit) and use
if t and not t
_c = get_box_color(c)
_t = get_text_color(c)
kz._box.unshift(box.new(time, high, time, low, xloc = xloc.bar_time, border_color = show_kz ? _c : na, bgcolor = show_kz ? _c : na, text = (show_kz and show_kz_text) ? box_txt : na, text_color = _t))
if show_pivots
kz._hi_line.unshift(line.new(time, high, time, high, xloc = xloc.bar_time, style = kzp_style, color = c, width = kzp_width))
kz._lo_line.unshift(line.new(time, low, time, low, xloc = xloc.bar_time, style = kzp_style, color = c, width = kzp_width))
if show_midpoints
kz._md_line.unshift(line.new(time, math.avg(high, low), time, math.avg(high, low), xloc = xloc.bar_time, style = kzm_style, color = c, width = kzm_width))
array.unshift(kz._md_valid, true)
array.unshift(kz._hi_valid, true)
array.unshift(kz._lo_valid, true)
if show_labels
kz._hi_label.unshift(label.new(time, high, hi_txt, xloc = xloc.bar_time, color = transparent, textcolor = txt_color, style = label.style_label_down, size = lbl_size))
kz._lo_label.unshift(label.new(time, low, lo_txt, xloc = xloc.bar_time, color = transparent, textcolor = txt_color, style = label.style_label_up, size = lbl_size))
del_kz(kz)
adjust_in_kz(kz, t)
adjust_out_kz(kz, t)
manage_kz(as_kz, use_asia, t_as, as_color, as_txt, ash_str, asl_str)
manage_kz(lo_kz, use_london, t_lo, lo_color, lo_txt, loh_str, lol_str)
manage_kz(na_kz, use_nyam, t_na, na_color, na_txt, nah_str, nal_str)
manage_kz(nl_kz, use_nylu, t_nl, nl_color, nl_txt, nlh_str, nll_str)
manage_kz(np_kz, use_nypm, t_np, np_color, np_txt, nph_str, npl_str)
manage_kz(op_kz, use_loop, t_op, op_color, op_txt, oph_str, opl_str)
manage_kz(cl_kz, use_locl, t_cl, cl_color, cl_txt, clh_str, cll_str)
manage_kz(m1_kz, use_sb1, t_m1, m1_color, m1_txt, m1h_str, m1l_str)
manage_kz(m2_kz, use_sb2, t_m2, m2_color, m2_txt, m2h_str, m2l_str)
manage_kz(m3_kz, use_sb3, t_m3, m3_color, m3_txt, m3h_str, m3l_str)
dwm()
vlines()
hz_lines()
new_dow_time = dow_xloc == 'Midday' ? time - timeframe.in_seconds("D") / 2 * 1000 : time
new_day = dayofweek(new_dow_time, gmt_tz) != dayofweek(new_dow_time, gmt_tz)
var dow_top = dow_yloc == 'Top'
var sunday = "SUNDAY"
var monday = "MONDAY"
var tuesday = "TUESDAY"
var wednesday = "WEDNESDAY"
var thursday = "THURSDAY"
var friday = "FRIDAY"
plotchar(dow_labels and timeframe.isintraday and dayofweek(new_dow_time, gmt_tz) == 1 and new_day, location = dow_top ? location.top : location.bottom, char = "", textcolor = txt_color, text = sunday)
plotchar(dow_labels and timeframe.isintraday and dayofweek(new_dow_time, gmt_tz) == 2 and new_day, location = dow_top ? location.top : location.bottom, char = "", textcolor = txt_color, text = monday)
plotchar(dow_labels and timeframe.isintraday and dayofweek(new_dow_time, gmt_tz) == 3 and new_day, location = dow_top ? location.top : location.bottom, char = "", textcolor = txt_color, text = tuesday)
plotchar(dow_labels and timeframe.isintraday and dayofweek(new_dow_time, gmt_tz) == 4 and new_day, location = dow_top ? location.top : location.bottom, char = "", textcolor = txt_color, text = wednesday)
plotchar(dow_labels and timeframe.isintraday and dayofweek(new_dow_time, gmt_tz) == 5 and new_day, location = dow_top ? location.top : location.bottom, char = "", textcolor = txt_color, text = thursday)
plotchar(dow_labels and timeframe.isintraday and dayofweek(new_dow_time, gmt_tz) == 6 and new_day, location = dow_top ? location.top : location.bottom, char = "", textcolor = txt_color, text = friday)
get_min_days_stored() =>
store = array.new_int()
if as_kz._range_store.size() > 0
store.push(as_kz._range_store.size())
if lo_kz._range_store.size() > 0
store.push(lo_kz._range_store.size())
if na_kz._range_store.size() > 0
store.push(na_kz._range_store.size())
if nl_kz._range_store.size() > 0
store.push(nl_kz._range_store.size())
if np_kz._range_store.size() > 0
store.push(np_kz._range_store.size())
if op_kz._range_store.size() > 0
store.push(op_kz._range_store.size())
if cl_kz._range_store.size() > 0
store.push(cl_kz._range_store.size())
if m1_kz._range_store.size() > 0
store.push(m1_kz._range_store.size())
if m2_kz._range_store.size() > 0
store.push(m2_kz._range_store.size())
if m3_kz._range_store.size() > 0
store.push(m3_kz._range_store.size())
result = store.min()
set_table(table tbl, kz kz, int row, string txt, bool use, bool t, color col) =>
if use
table.cell(tbl, 0, row, txt, text_size = range_size, bgcolor = get_box_color(col), text_color = txt_color)
table.cell(tbl, 1, row, str.tostring(kz._range_current), text_size = range_size, bgcolor = t ? get_box_color(col) : na, text_color = txt_color)
if show_range_avg
table.cell(tbl, 2, row, str.tostring(kz._range_store.avg()), text_size = range_size, text_color = txt_color)
if show_range and barstate.islast
var tbl = table.new(range_pos, 10, 10, chart.bg_color, chart.fg_color, 2, chart.fg_color, 1)
table.cell(tbl, 0, 0, "Killzone", text_size = range_size, text_color = txt_color)
table.cell(tbl, 1, 0, "Range", text_size = range_size, text_color = txt_color)
if show_range_avg
table.cell(tbl, 2, 0, "Avg ("+str.tostring(get_min_days_stored())+")", text_size = range_size, text_color = txt_color)
set_table(tbl, as_kz, 1, as_txt, use_asia, t_as, as_color)
set_table(tbl, lo_kz, 2, lo_txt, use_london, t_lo, lo_color)
set_table(tbl, na_kz, 3, na_txt, use_nyam, t_na, na_color)
set_table(tbl, nl_kz, 4, nl_txt, use_nylu, t_nl, nl_color)
set_table(tbl, np_kz, 5, np_txt, use_nypm, t_np, np_color)
set_table(tbl, op_kz, 6, op_txt, use_loop, t_op, op_color)
set_table(tbl, cl_kz, 7, cl_txt, use_locl, t_cl, cl_color)
set_table(tbl, m1_kz, 8, m1_txt, use_sb1, t_m1, m1_color)
set_table(tbl, m2_kz, 9, m2_txt, use_sb2, t_m2, m2_color)
set_table(tbl, m3_kz, 10, m3_txt, use_sb3, t_m3, m3_color)
// ---------------------------------------- Core Logic --------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------------------------------//
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// ©Mutharasan2
// Prev Published: 608
// Curr Published: 907
//@version=5
//2nd indicator("ICT HTF Candles (fadi)", overlay=true, max_boxes_count = 500, max_lines_count = 500, max_bars_back = 5000)
type Candle
float o
float c
float h
float l
int o_idx
int c_idx
int h_idx
int l_idx
box body
line wick_up
line wick_down
type Trace
line o
line c
line h
line l
label o_l
label c_l
label h_l
label l_l
type Imbalance
box b
int idx
type CandleSettings
bool show
string htf
int max_display
type Settings
int max_sets
color bull_body
color bull_border
color bull_wick
color bear_body
color bear_border
color bear_wick
int offset
int buffer
int htf_buffer
int width
bool trace_show
color trace_o_color
string trace_o_style
int trace_o_size
color trace_c_color
string trace_c_style
int trace_c_size
color trace_h_color
string trace_h_style
int trace_h_size
color trace_l_color
string trace_l_style
int trace_l_size
string trace_anchor
bool label_show
color label_color
string label_size
bool fvg_show
color fvg_color
bool vi_show
color vi_color
bool htf_label_show
color htf_label_color
string htf_label_size
bool htf_timer_show
color htf_timer_color
string htf_timer_size
string level
string liquidity_open_style
string liquidity_claimed_style
color liquidity_open_color
color liquidity_claimed_color
int liquidity_open_size
int liquidity_claimed_size
int max_lines
int extend
type CandleSet
Candle candles
Imbalance imbalances
CandleSettings settings
label tfName
label tfTimer
type Helper
string name = "Helper"
Settings settings = Settings.new()
var CandleSettings SettingsHTF1 = CandleSettings.new()
var CandleSettings SettingsHTF2 = CandleSettings.new()
var CandleSettings SettingsHTF3 = CandleSettings.new()
var CandleSettings SettingsHTF4 = CandleSettings.new()
var CandleSettings SettingsHTF5 = CandleSettings.new()
var CandleSettings SettingsHTF6 = CandleSettings.new()
var Candle candles_1 = array.new(0)
var Candle candles_2 = array.new(0)
var Candle candles_3 = array.new(0)
var Candle candles_4 = array.new(0)
var Candle candles_5 = array.new(0)
var Candle candles_6 = array.new(0)
var Imbalance imbalances_1 = array.new()
var Imbalance imbalances_2 = array.new()
var Imbalance imbalances_3 = array.new()
var Imbalance imbalances_4 = array.new()
var Imbalance imbalances_5 = array.new()
var Imbalance imbalances_6 = array.new()
var CandleSet htf1 = CandleSet.new()
htf1.settings := SettingsHTF1
htf1.candles := candles_1
htf1.imbalances := imbalances_1
var CandleSet htf2 = CandleSet.new()
htf2.settings := SettingsHTF2
htf2.candles := candles_2
htf2.imbalances := imbalances_2
var CandleSet htf3 = CandleSet.new()
htf3.settings := SettingsHTF3
htf3.candles := candles_3
htf3.imbalances := imbalances_3
var CandleSet htf4 = CandleSet.new()
htf4.settings := SettingsHTF4
htf4.candles := candles_4
htf4.imbalances := imbalances_4
var CandleSet htf5 = CandleSet.new()
htf5.settings := SettingsHTF5
htf5.candles := candles_5
htf5.imbalances := imbalances_5
var CandleSet htf6 = CandleSet.new()
htf6.settings := SettingsHTF6
htf6.candles := candles_6
htf6.imbalances := imbalances_6
//+------------------------------------------------------------------------------------------------------------+//
//+--- Settings ---+//
//+------------------------------------------------------------------------------------------------------------+//
htf1.settings.show := input.bool(false, "HTF 1 ", inline="htf1")
htf_1 = input.timeframe("60", "", inline="htf1")
htf1.settings.htf := htf_1
htf1.settings.max_display := input.int(1, "", inline="htf1")
htf2.settings.show := input.bool(false, "HTF 2 ", inline="htf2")
htf_2 = input.timeframe("240", "", inline="htf2")
htf2.settings.htf := htf_2
htf2.settings.max_display := input.int(1, "", inline="htf2")
htf3.settings.show := input.bool(true, "HTF 3 ", inline="htf3")
htf_3 = input.timeframe("1D", "", inline="htf3")
htf3.settings.htf := htf_3
htf3.settings.max_display := input.int(1, "", inline="htf3")
htf4.settings.show := input.bool(true, "HTF 4 ", inline="htf4")
htf_4 = input.timeframe("1W", "", inline="htf4")
htf4.settings.htf := htf_4
htf4.settings.max_display := input.int(1, "", inline="htf4")
htf5.settings.show := input.bool(true, "HTF 5 ", inline="htf5")
htf_5 = input.timeframe("1M", "", inline="htf5")
htf5.settings.htf := htf_5
htf5.settings.max_display := input.int(1, "", inline="htf5")
htf6.settings.show := input.bool(false, "HTF 6 ", inline="htf6")
htf_6 = input.timeframe("3M", "", inline="htf6")
htf6.settings.htf := htf_6
htf6.settings.max_display := input.int(1, "", inline="htf6")
settings.max_sets := input.int(6, "Limit to next HTFs only", minval=1, maxval=6)
settings.bull_body := input.color(color.rgb(76, 175, 80), "Body ", inline="body")
settings.bear_body := input.color(color.rgb(0, 0, 0), "", inline="body")
settings.bull_border := input.color(color.rgb(93, 96, 107), "Borders", inline="borders")
settings.bear_border := input.color(color.rgb(0, 0, 0), "", inline="borders")
settings.bull_wick := input.color(color.rgb(93, 96, 107), "Wick ", inline="wick")
settings.bear_wick := input.color(color.rgb(93, 96, 107), "", inline="wick")
settings.offset := input.int(10, "padding from current candles", minval = 1)
settings.buffer := input.int(1, "space between candles", minval = 1, maxval = 4)
settings.htf_buffer := input.int(10, "space between Higher Timeframes", minval = 1, maxval = 10)
settings.width := input.int(4, "Candle Width", minval = 1, maxval = 10)*2
settings.htf_label_show := input.bool(false, "HTF Label ", inline="HTFlabel")
settings.htf_label_color := input.color(color.rgb(0, 0, 0), "", inline='HTFlabel')
settings.htf_label_size := input.string(size.tiny, "", , inline="HTFlabel")
settings.htf_timer_show := input.bool(false, "Remaining time ", inline="timer")
settings.htf_timer_color := input.color(color.rgb(0, 0, 0), "", inline='timer')
settings.htf_timer_size := input.string(size.tiny, "", , inline="timer")
settings.fvg_show := input.bool(true, "Fair Value Gap ", group="Imbalance", inline="fvg")
settings.fvg_color := input.color(color.new(color.gray, 80), "", inline='fvg', group="Imbalance")
settings.vi_show := input.bool(true, "Volume Imbalance", group="Imbalance", inline="vi")
settings.vi_color := input.color(color.new(color.red, 50), "", inline='vi', group="Imbalance")
settings.trace_show := input.bool(false, "Trace lines", group="trace")
settings.trace_o_color := input.color(color.rgb(0, 0, 0), "Open ", inline='1', group="trace")
settings.trace_o_style := input.string('····', '', options = , inline='1', group="trace")
settings.trace_o_size := input.int(1, '', options = , inline='1', group="trace")
settings.trace_c_color := input.color(color.rgb(0, 0, 0), "Close ", inline='2', group="trace")
settings.trace_c_style := input.string('····', '', options = , inline='2', group="trace")
settings.trace_c_size := input.int(1, '', options = , inline='2', group="trace")
settings.trace_h_color := input.color(color.rgb(0, 0, 0), "High ", inline='3', group="trace")
settings.trace_h_style := input.string('····', '', options = , inline='3', group="trace")
settings.trace_h_size := input.int(1, '', options = , inline='3', group="trace")
settings.trace_l_color := input.color(color.rgb(0, 0, 0), "Low ", inline='4', group="trace")
settings.trace_l_style := input.string('····', '', options = , inline='4', group="trace")
settings.trace_l_size := input.int(1, '', options = , inline='4', group="trace")
settings.trace_anchor := input.string("First Timeframe", "Anchor to", options= , group="trace")
settings.label_show := input.bool(false, "Price Label ", inline="label")
settings.label_color := input.color(color.rgb(0, 0, 0), "", inline='label')
settings.label_size := input.string(size.small, "", , inline="label")
//+------------------------------------------------------------------------------------------------------------+//
//+--- Variables ---+//
//+------------------------------------------------------------------------------------------------------------+//
Helper helper = Helper.new()
var Trace trace = Trace.new()
color color_transparent = #ffffff00
//+------------------------------------------------------------------------------------------------------------+//
//+--- Internal Functions ---+//
//+------------------------------------------------------------------------------------------------------------+//
method LineStyle(Helper helper, string style) =>
helper.name := style
out = switch style
'----' => line.style_dashed
'····' => line.style_dotted
=> line.style_solid
method ValidTimeframe(Helper helper, string HTF) =>
helper.name := HTF
if timeframe.in_seconds(HTF) >= timeframe.in_seconds("D") and timeframe.in_seconds(HTF) > timeframe.in_seconds()
true
else
n1 = timeframe.in_seconds()
n2 = timeframe.in_seconds(HTF)
n3 = n1 % n2
(n1 < n2 and math.round(n2/n1) == n2/n1)
method RemainingTime(Helper helper, string HTF) =>
helper.name := HTF
if barstate.isrealtime
timeRemaining = (time_close(HTF) - timenow)/1000
days = math.floor(timeRemaining / 86400)
hours = math.floor((timeRemaining - (days*86400)) / 3600)
minutes = math.floor((timeRemaining - (days*86400) - (hours*3600))/ 60)
seconds = math.floor(timeRemaining - (days*86400) - (hours*3600) - (minutes*60))
r = str.tostring(seconds, "00")
if minutes > 0 or hours > 0 or days > 0
r := str.tostring(minutes, "00") + ":" + r
if hours > 0 or days > 0
r := str.tostring(hours, "00") + ":" + r
if days > 0
r := str.tostring(days) + "D " + r
r
else
"n/a"
method HTFName(Helper helper, string HTF) =>
helper.name := "HTFName"
formatted = HTF
seconds = timeframe.in_seconds(HTF)
if seconds < 60
formatted := str.tostring(seconds) + "s"
else if (seconds / 60) < 60
formatted := str.tostring((seconds/60)) + "m"
else if (seconds/60/60) < 24
formatted := str.tostring((seconds/60/60)) + "H"
formatted
method HTFEnabled(Helper helper) =>
helper.name := "HTFEnabled"
int enabled =0
enabled += htf1.settings.show ? 1 : 0
enabled += htf2.settings.show ? 1 : 0
enabled += htf3.settings.show ? 1 : 0
enabled += htf4.settings.show ? 1 : 0
enabled += htf5.settings.show ? 1 : 0
enabled += htf6.settings.show ? 1 : 0
int last = math.min(enabled, settings.max_sets)
last
method CandleSetHigh(Helper helper, Candle candles, float h) =>
helper.name := "CandlesSetHigh"
float _h = h
if array.size(candles) > 0
for i = 0 to array.size(candles)-1
Candle c = array.get(candles, i)
if c.h > _h
_h := c.h
_h
method CandlesHigh(Helper helper, Candle candles) =>
helper.name := "CandlesHigh"
h = 0.0
int cnt = 0
int last = helper.HTFEnabled()
if htf1.settings.show and helper.ValidTimeframe(htf1.settings.htf)
h := helper.CandleSetHigh(htf1.candles, h)
cnt += 1
if htf2.settings.show and helper.ValidTimeframe(htf2.settings.htf) and cnt < last
h := helper.CandleSetHigh(htf2.candles, h)
cnt +=1
if htf3.settings.show and helper.ValidTimeframe(htf3.settings.htf) and cnt < last
h := helper.CandleSetHigh(htf3.candles, h)
cnt += 1
if htf4.settings.show and helper.ValidTimeframe(htf4.settings.htf) and cnt < last
h := helper.CandleSetHigh(htf4.candles, h)
cnt += 1
if htf5.settings.show and helper.ValidTimeframe(htf5.settings.htf) and cnt < last
h := helper.CandleSetHigh(htf5.candles, h)
cnt += 1
if htf6.settings.show and helper.ValidTimeframe(htf6.settings.htf) and cnt < last
h := helper.CandleSetHigh(htf6.candles, h)
h
if array.size(candles) > 0
for i = 0 to array.size(candles)-1
Candle c = array.get(candles, i)
if c.h > h
h := c.h
h
method Reorder(CandleSet candleSet, int offset) =>
size = candleSet.candles.size()
if size > 0
for i = size-1 to 0
Candle candle = candleSet.candles.get(i)
t_buffer = offset + ((settings.width+settings.buffer)*(size-i-1))
box.set_left(candle.body, bar_index + t_buffer)
box.set_right(candle.body, bar_index + settings.width + t_buffer)
line.set_x1(candle.wick_up, bar_index+((settings.width)/2) + t_buffer)
line.set_x2(candle.wick_up, bar_index+((settings.width)/2) + t_buffer)
line.set_x1(candle.wick_down, bar_index+((settings.width)/2) + t_buffer)
line.set_x2(candle.wick_down, bar_index+((settings.width)/2) + t_buffer)
candleSet
top = helper.CandlesHigh(candleSet.candles)
left = bar_index + offset + ((settings.width+settings.buffer)*(size-1))/2
if settings.htf_label_show
var label l = candleSet.tfName
string lbl = helper.HTFName(candleSet.settings.htf)
if settings.htf_timer_show
lbl += "\n"
if not na(l)
label.set_xy(l, left, top)
else
l := label.new(left, top, lbl, color=color_transparent, textcolor = settings.htf_label_color, style=label.style_label_down, size = settings.htf_label_size)
if settings.htf_timer_show
var label t = candleSet.tfTimer
string tmr = "(" + helper.RemainingTime(candleSet.settings.htf) + ")"
if not na(t)
label.set_xy(t, left, top)
else
t := label.new(left, top, tmr, color=color_transparent, textcolor = settings.htf_timer_color, style=label.style_label_down, size = settings.htf_timer_size)
candleSet
method FindImbalance(CandleSet candleSet) =>
if barstate.isrealtime or barstate.islast
if candleSet.imbalances.size() > 0
for i = candleSet.imbalances.size()-1 to 0
Imbalance del = candleSet.imbalances.get(i)
box.delete(del.b)
candleSet.imbalances.pop()
if candleSet.candles.size() > 3 and settings.fvg_show
for i = 1 to candleSet.candles.size() -3
candle1 = candleSet.candles.get(i)
candle2 = candleSet.candles.get(i+2)
candle3 = candleSet.candles.get(i+1)
if (candle1.l > candle2.h and math.min(candle1.o, candle1.c) > math.max(candle2.o, candle2.c))
Imbalance imb = Imbalance.new()
imb.b := box.new(box.get_left(candle2.body), candle2.h, box.get_right(candle1.body), candle1.l, bgcolor=settings.fvg_color, border_color = color_transparent, xloc=xloc.bar_index)
candleSet.imbalances.push(imb)
if (candle1.h < candle2.l and math.max(candle1.o, candle1.c) < math.min(candle2.o, candle2.c))
Imbalance imb = Imbalance.new()
imb.b := box.new(box.get_right(candle1.body), candle1.h, box.get_left(candle2.body), candle2.l, bgcolor=settings.fvg_color, border_color = color_transparent)
candleSet.imbalances.push(imb)
box temp = box.copy(candle3.body)
box.delete(candle3.body)
candle3.body := temp
if candleSet.candles.size() > 2 and settings.vi_show
for i = 1 to candleSet.candles.size() -2
candle1 = candleSet.candles.get(i)
candle2 = candleSet.candles.get(i+1)
if (candle1.l < candle2.h and math.min(candle1.o, candle1.c) > math.max(candle2.o, candle2.c))
Imbalance imb = Imbalance.new()
imb.b := box.new(box.get_left(candle2.body), math.min(candle1.o, candle1.c), box.get_right(candle1.body), math.max(candle2.o, candle2.c), bgcolor=settings.vi_color, border_color = color_transparent)
candleSet.imbalances.push(imb)
if (candle1.h > candle2.l and math.max(candle1.o, candle1.c) < math.min(candle2.o, candle2.c))
Imbalance imb = Imbalance.new()
imb.b := box.new(box.get_right(candle1.body), math.min(candle2.o, candle2.c), box.get_left(candle2.body), math.max(candle1.o, candle1.c), bgcolor=settings.vi_color, border_color = color_transparent)
candleSet.imbalances.push(imb)
candleSet
method Monitor(CandleSet candleSet) =>
HTFBarTime = time(candleSet.settings.htf)
isNewHTFCandle = ta.change(HTFBarTime)
if isNewHTFCandle
Candle candle = Candle.new()
candle.o := open
candle.c := close
candle.h := high
candle.l := low
candle.o_idx := bar_index
candle.c_idx := bar_index
candle.h_idx := bar_index
candle.l_idx := bar_index
bull = candle.c > candle.o
candle.body := box.new(bar_index, math.max(candle.o, candle.c), bar_index+2, math.min(candle.o, candle.c), bull ? settings.bull_border : settings.bear_border, 1, bgcolor = bull ? settings.bull_body : settings.bear_body)
candle.wick_up := line.new(bar_index+1, candle.h, bar_index, math.max(candle.o, candle.c), color=bull ? settings.bull_wick : settings.bear_wick)
candle.wick_down := line.new(bar_index+1, math.min(candle.o, candle.c), bar_index, candle.l, color=bull ? settings.bull_wick : settings.bear_wick)
candleSet.candles.unshift(candle)
if candleSet.candles.size() > candleSet.settings.max_display
Candle delCandle = array.pop(candleSet.candles)
box.delete(delCandle.body)
line.delete(delCandle.wick_up)
line.delete(delCandle.wick_down)
candleSet
method Update(CandleSet candleSet, int offset, bool showTrace) =>
if candleSet.candles.size() > 0
Candle candle = candleSet.candles.first()
candle.h_idx := high > candle.h ? bar_index : candle.h_idx
candle.h := high > candle.h ? high : candle.h
candle.l_idx := low < candle.l ? bar_index : candle.l_idx
candle.l := low < candle.l ? low : candle.l
candle.c := close
candle.c_idx := bar_index
bull = candle.c > candle.o
box.set_top(candle.body, candle.o)
box.set_bottom(candle.body, candle.c)
box.set_bgcolor(candle.body, bull ? settings.bull_body : settings.bear_body)
box.set_border_color(candle.body, bull ? settings.bull_border : settings.bear_border)
line.set_color(candle.wick_up, bull ? settings.bull_wick : settings.bear_wick)
line.set_color(candle.wick_down, bull ? settings.bull_wick : settings.bear_wick)
line.set_y1(candle.wick_up, candle.h)
line.set_y2(candle.wick_up, math.max(candle.o, candle.c))
line.set_y1(candle.wick_down, candle.l)
line.set_y2(candle.wick_down, math.min(candle.o, candle.c))
if barstate.isrealtime or barstate.islast
candleSet.Reorder(offset)
if settings.trace_show and showTrace
if bar_index - candle.o_idx < 5000
if na(trace.o)
trace.o := line.new(candle.o_idx, candle.o, box.get_left(candle.body), candle.o, xloc= xloc.bar_index, color=settings.trace_o_color, style= helper.LineStyle(settings.trace_o_style), width=settings.trace_o_size)
else
line.set_xy1(trace.o, candle.o_idx, candle.o)
line.set_xy2(trace.o, box.get_left(candle.body), candle.o)
if settings.label_show
if na(trace.o_l)
trace.o_l := label.new(box.get_right(candle.body), candle.o, str.tostring(candle.o), textalign = text.align_center, style=label.style_label_left, size=settings.label_size, color=color_transparent, textcolor=settings.label_color)
else
label.set_xy(trace.o_l, box.get_right(candle.body), candle.o)
label.set_text(trace.o_l, str.tostring(candle.o))
if bar_index - candle.c_idx < 5000
if na(trace.c)
trace.c := line.new(candle.c_idx, candle.c, box.get_left(candle.body), candle.c, xloc= xloc.bar_index, color=settings.trace_c_color, style=helper.LineStyle(settings.trace_c_style), width=settings.trace_c_size)
else
line.set_xy1(trace.c, candle.c_idx, candle.c)
line.set_xy2(trace.c, box.get_left(candle.body), candle.c)
if settings.label_show
if na(trace.c_l)
trace.c_l := label.new(box.get_right(candle.body), candle.c, str.tostring(candle.c), textalign = text.align_center, style=label.style_label_left, size=settings.label_size, color=color_transparent, textcolor=settings.label_color)
else
label.set_xy(trace.c_l, box.get_right(candle.body), candle.c)
label.set_text(trace.c_l, str.tostring(candle.c))
if bar_index - candle.h_idx < 5000
if na(trace.h)
trace.h := line.new(candle.h_idx, candle.h, line.get_x1(candle.wick_up), candle.h, xloc= xloc.bar_index, color=settings.trace_h_color, style=helper.LineStyle(settings.trace_h_style), width=settings.trace_h_size)
else
line.set_xy1(trace.h, candle.h_idx, candle.h)
line.set_xy2(trace.h, line.get_x1(candle.wick_up), candle.h)
if settings.label_show
if na(trace.h_l)
trace.h_l := label.new(box.get_right(candle.body), candle.h, str.tostring(candle.h), textalign = text.align_center, style=label.style_label_left, size=settings.label_size, color=color_transparent, textcolor=settings.label_color)
else
label.set_xy(trace.h_l, box.get_right(candle.body), candle.h)
label.set_text(trace.h_l, str.tostring(candle.o))
if bar_index - candle.l_idx < 5000
if na(trace.l)
trace.l := line.new(candle.l_idx, candle.l, line.get_x1(candle.wick_down), candle.l, xloc= xloc.bar_index, color=settings.trace_l_color, style=helper.LineStyle(settings.trace_l_style), width=settings.trace_l_size)
else
line.set_xy1(trace.l, candle.l_idx, candle.l)
line.set_xy2(trace.l, line.get_x1(candle.wick_down), candle.l)
if settings.label_show
if na(trace.l_l)
trace.l_l := label.new(box.get_right(candle.body), candle.l, str.tostring(candle.l), textalign = text.align_center, style=label.style_label_left, size=settings.label_size, color=color_transparent, textcolor=settings.label_color)
else
label.set_xy(trace.l_l, box.get_right(candle.body), candle.l)
label.set_text(trace.l_l, str.tostring(candle.o))
candleSet
int cnt = 0
int last = helper.HTFEnabled()
int offset = settings.offset
if htf1.settings.show and helper.ValidTimeframe(htf1.settings.htf)
bool showTrace = false
if settings.trace_anchor == "First Timeframe"
showTrace := true
if settings.trace_anchor == "Last Timeframe" and settings.max_sets == 1
showTrace := true
htf1.Monitor().Update(offset, showTrace).FindImbalance()
cnt +=1
offset += cnt > 0 ? (htf1.candles.size() * settings.width) + (htf1.candles.size() > 0 ? htf1.candles.size()-1 * settings.buffer : 0) + settings.htf_buffer : 0
if htf2.settings.show and helper.ValidTimeframe(htf2.settings.htf) and cnt < last
bool showTrace = false
if settings.trace_anchor == "First Timeframe" and cnt == 0
showTrace := true
if settings.trace_anchor == "Last Timeframe" and cnt == last-1
showTrace := true
htf2.Monitor().Update(offset, showTrace).FindImbalance()
cnt+=1
offset += cnt > 0 ? (htf2.candles.size() * settings.width) + (htf2.candles.size() > 0 ? htf2.candles.size()-1 * settings.buffer : 0) + settings.htf_buffer : 0
if htf3.settings.show and helper.ValidTimeframe(htf3.settings.htf) and cnt < last
bool showTrace = false
if settings.trace_anchor == "First Timeframe" and cnt == 0
showTrace := true
if settings.trace_anchor == "Last Timeframe" and cnt == last-1
showTrace := true
htf3.Monitor().Update(offset, showTrace).FindImbalance()
cnt+=1
offset += cnt > 0 ? (htf3.candles.size() * settings.width) + (htf3.candles.size() > 0 ? htf3.candles.size()-1 * settings.buffer : 0) + settings.htf_buffer : 0
if htf4.settings.show and helper.ValidTimeframe(htf4.settings.htf) and cnt < last
bool showTrace = false
if settings.trace_anchor == "First Timeframe" and cnt == 0
showTrace := true
if settings.trace_anchor == "Last Timeframe" and cnt == last-1
showTrace := true
htf4.Monitor().Update(offset, showTrace).FindImbalance()
cnt+=1
offset += cnt > 0 ? (htf4.candles.size() * settings.width) + (htf4.candles.size() > 0 ? htf4.candles.size()-1 * settings.buffer : 0) + settings.htf_buffer : 0
if htf5.settings.show and helper.ValidTimeframe(htf5.settings.htf) and cnt < last
bool showTrace = false
if settings.trace_anchor == "First Timeframe" and cnt == 0
showTrace := true
if settings.trace_anchor == "Last Timeframe" and cnt == last-1
showTrace := true
htf5.Monitor().Update(offset, showTrace).FindImbalance()
cnt+=1
offset += cnt > 0 ? (htf5.candles.size() * settings.width) + (htf5.candles.size() > 0 ? htf5.candles.size()-1 * settings.buffer : 0) + settings.htf_buffer : 0
if htf6.settings.show and helper.ValidTimeframe(htf6.settings.htf) and cnt < last
bool showTrace = false
if settings.trace_anchor == "First Timeframe" and cnt == 0
showTrace := true
if settings.trace_anchor == "Last Timeframe"
showTrace := true
htf6.Monitor().Update(offset, showTrace).FindImbalance()
//------------------------------------------------------------------------------------------------//
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// ©Mutharasan12
//@version=5
//indicator("Notes, Watermark",overlay = true)
// STICKY NOTES #BEGIN --------------------------------------------------------------------------------------------------------------------------------------------------------//
var StickyNote_settings = "STICKY NOTES --------------------------------------------------"
showStickyNotes = input.bool(false, "Show Sticky Notes?", group = StickyNote_settings)
if showStickyNotes
stickynote01 = input.text_area("Your Note Here","NOTES",group = StickyNote_settings)
tl1 = input.string("top", title = "Sticky Note Position (Vertical)", options = , group = StickyNote_settings)
tl2 = input.string("right", title = "Sticky Note Position (Horizontal)", options = , group = StickyNote_settings)
font_size = input.string("Normal", title = "Sticky Note Text Size", options = , group = StickyNote_settings)
font_type = input.string("Default", title = "Font Type", options = , group = StickyNote_settings)
font_color = input.color(color.rgb(0,0,0,0), title = "Note Color", inline = 'nc', group = StickyNote_settings)
note_color = input.color(color (color.rgb(0,0,0,100)), title = "Note Background", inline='nc', group = StickyNote_settings)
selected_font = font_type == "Default" ? font.family_default : font.family_monospace
selected_size = font_size == "Auto" ? size.auto : font_size == "Huge" ? size.huge : font_size == "Large" ? size.large : font_size == "Normal" ? size.normal : font_size == "Small" ? size.small : font_size == "Tiny" ? size.tiny : na
var table t1 = table.new(tl1 + "_" + tl2, 1, 10)
if barstate.islast
if not na(stickynote01) and stickynote01 != ""
table.cell(t1,0,0, text = stickynote01 , bgcolor = note_color, text_color = font_color, text_halign = text.align_left, text_size = selected_size, text_font_family = selected_font)
// STICKY NOTES #END ----------------------------------------------------------------------------------------------------------------------------------------------------------//
// WATERMARK #BEGIN --
ORB - Openning Range BreakoutORB - Opening Range Breakout (Indicator)
This indicator visualizes the Opening Range Breakout (ORB) for the New York market session (9:30 AM – 4:00 PM NY), highlighting the High and Low of the first 5 minutes of the session.
Key Features:
Automatically calculates the High and Low of the 9:30 AM candle and updates if subsequent candles expand the range within the first 5 minutes.
Plots invisible lines representing the High and Low of the opening range throughout the session.
Fills the area between High and Low with a semi-transparent background, clearly showing the opening range zone.
Works on any intraday timeframe and adapts automatically to the NY session.
Perfect for breakout strategies, visually marking early support and resistance zones.
How to Use:
The shaded area between High and Low indicates the opening range.
Traders can watch for breakouts above the High or breakdowns below the Low for potential entry signals.
Can be combined with trend or volume indicators for confirmation.
Notes:
The session is automatically calculated using New York time.
Background transparency can be adjusted to your preference.
MACD Volume VWAP Scalping (2min) by Obiii📘 Strategy Description (for TradingView)
MACD Volume VWAP Scalping Strategy (2-Minute Intraday Momentum)
This strategy is designed for scalpers and short-term intraday traders who focus on capturing small, high-probability moves during the most active hours of the trading session — typically between 9:45 AM and 11:30 AM (New York time).
The system combines three key momentum confirmations:
MACD crossovers to detect short-term trend shifts,
Volume spikes to validate real market participation, and
VWAP / EMA alignment to filter trades in the direction of the prevailing intraday trend.
🔹 Entry Logic
Long Entry:
MACD line crosses above the signal line
Both MACD and Signal are above zero
Current volume > average of the last 10 candles
Price is above VWAP and (optionally) above EMA 9 and EMA 20
Short Entry:
MACD line crosses below the signal line
Both MACD and Signal are below zero
Current volume > average of the last 10 candles
Price is below VWAP and (optionally) below EMA 9 and EMA 20
🎯 Exit Logic
Fixed Take Profit: +0.25%
Fixed Stop Loss: -0.15% to -0.20%
Optionally, switch to the 5-minute chart after entry to monitor momentum and manage exits more smoothly.
⚙️ Recommended Settings
Timeframe: 2 minutes (entries), 5 minutes (monitoring)
Market Session: 9:45 AM – 11:30 AM EST
Assets: Highly liquid instruments such as SPY, QQQ, NVDA, TSLA, AAPL, or large-cap momentum stocks.
💡 Notes
This is a momentum-based scalping strategy — precision and discipline are key.
It performs best in high-volume environments where clear direction emerges after the morning volatility settles.
The system can be fine-tuned for different profit targets, MACD settings, or volume thresholds depending on volatility.
📋 Trading Checklist – Precision Entry SystemTake your trading discipline to the next level with this Precision Trading Checklist for TradingView. Designed for intraday traders following liquidity, structure, and Smart Money Concepts (SMC) AKA ICT Concepts, this overlay ensures you never miss a key confirmation before entering a trade.
Features:
✅ Pre-Market Preparation: Track previous session highs/lows, AM/PM sessions, and key liquidity zones.
✅ Bias & Narrative Check: Quickly confirm daily trend, price position relative to daily open, and higher timeframe confluence.
✅ Session-Specific Rules: Focused sessions like Silver Bullet (10:00–11:30), Afternoon (13:30–15:00), and Final Hour (15:00–16:00).
✅ Structure & Setup Validation: Confirm liquidity sweeps, market structure shifts, expansion candles, fair value gaps, and order blocks.
✅ Risk Management Reminders: Stop-loss, target points, risk percentage, breakeven management, and pyramiding rules.
✅ Post-Trade Journaling: Document entries, session, setup type, trade outcome, and grading for continuous improvement.
✅ Golden Rules: Visual reminders to enforce discipline, avoid emotional trades, and respect session limits.
Why Use It:
This checklist is perfect for traders who want to stay consistent, minimise mistakes, and follow a disciplined routine. Displayed as an overlay on your chart, it provides all essential checks in one glance, keeping you focused on the setup rather than scrolling through notes or separate trackers.
How to use:
Add the indicator to your chart
Click the settings/gear icon
Check off items as you complete them
The checklist on your chart updates in real-time with green checkmarks!
The checkboxes will persist as long as the indicator is on your chart,
making it perfect for tracking your pre-trade and post-trade routines!
Follow the checklist items step by step before entering trades.
Use the session-specific guidelines to filter setups.
Journal your trades post-execution for growth and analysis.
Complete DashboardPA+AI PRE/GO Trading Dashboard v0.1.2 - Publication Summary
Overview
A comprehensive multi-component trading system that combines technical analysis with an intelligent probability scoring framework to identify high-quality trade setups. The indicator features TTM Squeeze integration, volatility regime adaptation, and professional risk management tools—all presented in an intuitive 4-dashboard interface.
Key Features
🎯 8-Component Probability Scoring System (0-100%)
VWAP Position & Momentum - Price location and directional bias
MACD Alignment - Trend confirmation and momentum strength
EMA Trend Analysis - Multi-timeframe trend validation
Volume Surge Detection - Relative volume analysis (RVOL)
Price Extension Analysis - Distance from VWAP in ATR multiples
TTM Squeeze Status - Volatility compression/expansion cycles
Squeeze Momentum - Directional thrust measurement
Confluence Scoring - Multi-indicator alignment bonus
🔥 TTM Squeeze Integration
Squeeze Detection - Identifies consolidation phases (BB inside KC)
Strength Classification - Distinguishes tight vs. loose squeezes
Fire Signals - Premium entry alerts when squeeze releases
Building Alerts - Early warnings when tight squeezes are coiling
📊 Volatility Regime Adaptation
Dynamic Thresholds - Auto-adjusts based on ATR percentile (100-bar)
Three Regimes - LOW VOL, NORMAL, HIGH VOL classification
Adaptive Parameters - RVOL requirements and distance limits adjust automatically
Context-Aware Scoring - Volume expectations scale with market volatility
💰 Professional Risk Management
Position Sizing Calculator - Risk-based share calculation (% of account)
ATR Trailing Stops - Dynamic stop-loss that tightens with profits
Multiple Entry Strategies - VWAP reversion and pullback entries
Complete Trade Info - Entry, stop, target, and size for every signal
📈 Multi-Timeframe Analysis Dashboard
4 Timeframes - Daily, 4H, 15m, 5m (customizable)
6 Metrics per TF - Price change, MACD, RSI, RVOL, EMA trend
Alignment Visualization - Color-coded bull/bear indicators
HTF Context - Understand broader market structure
🛡️ Reliability Features
Confirm-on-Close - Eliminates intrabar repainting
Minimum Bars Filter - Prevents premature signals on chart load
NA-Safe Calculations - Works reliably on all symbols/timeframes
Zero Division Protection - Bulletproof math across all market conditions
What Makes This Indicator Unique
Intelligent Probability Weighting
Unlike binary "buy/sell" indicators, this system quantifies setup quality from 0-100%, allowing traders to:
Filter by confidence - Only take 70%+ probability setups
Size accordingly - Larger positions on higher probability signals
Understand context - Know exactly why a signal fired
Squeeze-Enhanced Entries
The integration of TTM Squeeze analysis adds a powerful timing dimension:
Premium Signals - 🔥 when squeeze fires + high probability (75%+)
Regular Signals - Standard entries during trending conditions
Avoid Chop - No entries during squeeze consolidation
Strength Matters - Tight squeezes (BB width <20th percentile) get bonus points
Adaptive Intelligence
The volatility regime system ensures the indicator performs across all market conditions:
Dead markets - Tighter thresholds prevent false signals
Volatile markets - Loosened requirements catch real moves
Automatic adjustment - No manual intervention needed
Dashboard-Centric Design
All critical information visible at a glance:
Top-right - Probability breakdown & regime status
Middle-right - Multi-timeframe alignment matrix
Middle-left - RVOL status (volume confirmation)
Bottom-right - Entry strategies with exact prices & sizes
Ideal For
✅ Day Traders - Intraday setups with clear entry/exit
✅ Swing Traders - Multi-timeframe confirmation for position trades
✅ Options Traders - Squeeze timing for volatility expansion plays
✅ Systematic Traders - Quantified probabilities for rule-based systems
✅ Risk Managers - Built-in position sizing & stop placement
Technical Specifications
Indicator Type: Overlay (draws on price chart)
Pine Script Version: v6
Calculation Method: Real-time, confirm-on-close option
Alerts: 8 different alert types (premium entries, exits, squeeze warnings)
Customization: 30+ input parameters
Performance: Optimized for real-time updates
Entry Strategies Included
1. VWAP Reversion
Enter when price bounces off VWAP ± 0.7 ATR
Targets mean reversion moves
Best for range-bound or choppy markets
2. Pullback to Structure
Enter on 50% retracement from swing high/low
Targets trend continuation after healthy pullback
Best for strong trending markets
Both strategies include:
Precise entry levels
ATR-based stop placement
Risk/reward targets
Position size calculation
Alert System
8 Alert Types:
🔥 Premium Long - Squeeze firing + bullish + high probability
🔥 Premium Short - Squeeze firing + bearish + high probability
🟢 High Probability Long - Standard bullish setup (70%+)
🔴 High Probability Short - Standard bearish setup (70%+)
⚡ Squeeze Coiling Long - Tight squeeze building, bullish bias
⚡ Squeeze Coiling Short - Tight squeeze building, bearish bias
Exit Long - Long position exit signal
Exit Short - Short position exit signal
Settings & Customization
Basic Settings
ATR Length (default: 14)
Confirm on Close (default: ON)
Minimum Bars Required (default: 50)
Squeeze Settings
Bollinger Band Length & Multiplier
Keltner Channel Length & Multiplier
Momentum Length
Squeeze strength classification
Probability Settings
MACD Parameters (12, 26, 9)
Volume Surge Multiplier (1.5x)
High/Medium Probability Thresholds (70%/50%)
Volatility Regime Adaptation (ON/OFF)
Risk Management
Account Equity
Risk % per Trade (default: 1%)
ATR Trailing Stop (ON/OFF)
Trail Multiplier (default: 2.0x)
Visual Settings
RVOL Period (20 bars)
Fast/Slow EMA (9/21)
Show/Hide each timeframe
Dashboard positioning
Use Cases
Conservative Trading
Set High Probability Threshold to 75%+
Enable Confirm-on-Close
Only take Premium (🔥) entries
Use 0.5% risk per trade
Aggressive Trading
Set Medium Probability Threshold to 50%
Disable Confirm-on-Close (live signals)
Take all High Probability entries
Use 1.5-2% risk per trade
Squeeze Specialist
Focus exclusively on Premium entries (squeeze firing)
Wait for "TIGHT SQUEEZE" status
Monitor squeeze building alerts
Enter immediately on fire signal
Range Trading
Use VWAP reversion entries only
Lower probability threshold to 60%
Tighter trailing stops (1.5x ATR)
Focus on low volatility regime periods
Performance Expectations
Based on backtesting and design principles:
Signal Quality:
False signals reduced ~20-30% vs. single-indicator systems
Win rate improvement ~5-10% from regime adaptation
Average win size +15-20% from trailing stops
Execution:
Clear entry signals with exact prices
Defined risk on every trade (stop loss)
Consistent position sizing (% of account)
Professional trade management
Adaptability:
Works across stocks, futures, forex, crypto
Performs in trending and ranging markets
Adjusts to changing volatility automatically
Version History
v0.1.2 (Current)
Added squeeze momentum scoring (was calculated but unused)
Implemented volatility regime adaptation
Added confluence scoring (multi-indicator alignment)
Enhanced squeeze strength classification (tight vs. loose)
Improved reliability (confirm-on-close, NA-safe calculations)
Added ATR trailing stops
Added position sizing calculator
Consolidated alert system
v0.1.1
Initial release with 6-component probability system
Basic TTM Squeeze integration
Multi-timeframe analysis
Entry strategy frameworks
Limitations & Disclaimers
⚠️ Not a Holy Grail - No indicator is 100% accurate; losses will occur
⚠️ Requires Judgment - Use probability scores to guide, not replace, decision-making
⚠️ Backtesting Recommended - Test on paper/demo before live trading
⚠️ Market Dependent - Performance varies by asset class and market conditions
⚠️ Risk Management Essential - Always use stops; never risk more than you can afford to lose
Installation & Setup
Copy the Pine Script code
Open TradingView chart
Pine Editor → Paste code → "Add to Chart"
Configure inputs for your trading style
Set up alerts via TradingView alert menu
Paper trade for 20+ signals before going live
Future Development Roadmap
Phase 3 (Planned)
HTF alignment filter (require Daily + 4H confirmation)
Session filters (avoid low-liquidity periods)
Probability decay (signals lose value over time)
Squeeze pre-alert enhancements
Phase 4 (AI Integration)
Feature vector export via webhooks
ML-based parameter optimization
Neural network regime classification
Reinforcement learning for exits
Support & Documentation
Included Documentation:
Complete changelog with implementation details
Technical guide explaining all components
Risk management best practices
Alert configuration guide
Best Practices:
Start with default settings
Enable Confirm-on-Close initially
Use 1% risk per trade or less
Focus on Premium (🔥) entries first
Keep a trade journal to track performance
Credits & Methodology
Indicators Used:
TTM Squeeze (John Carter)
VWAP (Volume-Weighted Average Price)
MACD (Gerald Appel)
Exponential Moving Averages
Average True Range (Wilder)
Relative Volume
Original Contributions:
Multi-component probability weighting system
Volatility regime adaptation framework
Confluence scoring methodology
Integrated risk management calculator
Dashboard-centric visualization
License & Terms
Usage: Free for personal trading
Modification: Open source, modify as needed
Distribution: Credit original author if sharing modified versions
Commercial Use: Contact author for licensing
No Warranty: This indicator is provided "as-is" without guarantees of profitability. Trading involves substantial risk. Past performance does not guarantee future results.
Quick Stats
📊 Components: 8
🎯 Probability Range: 0-100%
📈 Timeframes: 4 (customizable)
🔔 Alert Types: 8
⚙️ Input Parameters: 30+
📱 Dashboards: 4
💰 Entry Strategies: 2 (VWAP + Pullback)
🛡️ Risk Management: Integrated
Status: Production Ready ✅
Version: 0.1.2
Last Updated: November 2025
Pine Script: v6
File Name: PA_AI_PRE_GO_v0.1.2_FIXED.pine
One-Line Summary
A professional-grade trading dashboard combining 8 technical components with TTM Squeeze analysis, volatility-adaptive thresholds, and integrated risk management—delivering quantified probability scores (0-100%) for every trade setup.
[AA] - Market Valuation (Mean Based) - Market Valuation (Mean Based)
What it does
This indicator estimates whether price is overvalued, undervalued, or fairly valued relative to its structural mean across multiple lookback windows. It builds a single normalized oscillator from short-, mid-, and long-term ranges so traders can quickly see when price is stretched away from equilibrium.
This is not a mashup of existing tools. It’s a custom mean-deviation model that aggregates multi-window range positioning into one score.
How it works (concepts)
For each lookback length (13, 25, 30, 50, 100, 200):
Range & midpoint:
Highest high H and lowest low L.
Structural midpoint Mid = (H + L)/2.
Normalized deviation:
Dev = (Close − Mid) / (H − L) → location of price within its own range.
Aggregation:
The oscillator z_struct is the average of the deviations from the five windows.
Result: a smoothed, dimensionless value (roughly −1 to +1 in typical markets) showing multi-horizon displacement from the mean.
Plots & levels
Oscillator (area): z_struct
Reference lines: +0.40 (OB), 0.00 (equilibrium), −0.30 (OS)
Coloring:
Red when z_struct > OB (extended above mean)
Blue when z_struct < OS (extended below mean)
White in between
Suggested use
Mean reversion context: Fade extremes in range-bound conditions; take profits into OB/OS.
Trend awareness: In strong trends, extremes can persist—use levels as exhaustion context rather than standalone entry.
Filter/confirm: Combine with your trend filter or structure tools to time pullbacks and avoid chasing extended moves.
Inputs
Lookbacks: 13, 25, 30, 50, 100, 200
Thresholds: OB = 0.40, OS = −0.30
Notes & limitations
Works on the current symbol/timeframe only; no security() calls and no repainting beyond normal bar completion.
In very tight or flat ranges (H ≈ L), normalized deviations can become sensitive; consider longer windows or higher timeframes.
This is an indicator, not a strategy. No signals are generated; use with risk management.
Originality statement
This script implements an original, multi-window mean-deviation aggregation. It does not replicate a built-in or a public indicator; its purpose is to quantify cross-horizon valuation in a single, normalized measure.
Realtime Squeeze Box [CHE] Realtime Squeeze Box — Detects lowvolatility consolidation periods and draws trimmed price range boxes in realtime to highlight potential breakout setups without clutter from outliers.
Summary
This indicator identifies "squeeze" phases where recent price volatility falls below a dynamic baseline threshold, signaling potential energy buildup for directional moves. By requiring a minimum number of consecutive bars in squeeze, it reduces noise from fleeting dips, making signals more reliable than simple threshold crosses. The core innovation is realtime box visualization: during active squeezes, it builds and updates a box capturing the price range while ignoring extreme values via quantile trimming, providing a cleaner view of consolidation bounds. This differs from static volatility bands by focusing on trimmed ranges and suppressing overlapping boxes, which helps traders spot genuine setups amid choppy markets. Overall, it aids in anticipating breakouts by combining volatility filtering with visual containment of price action.
Motivation: Why this design?
Traders often face whipsaws during brief volatility lulls that mimic true consolidations, leading to premature entries, or miss setups because standard volatility measures lag in adapting to changing market regimes. This design addresses that by using a hold requirement on consecutive lowvolatility bars to denoise signals, ensuring only sustained squeezes trigger visuals. The core idea—comparing rolling standard deviation to a smoothed baseline—creates a responsive yet stable filter for lowenergy periods, while the trimmed box approach isolates the core price cluster, making it easier to gauge breakout potential without distortion from spikes.
What’s different vs. standard approaches?
Reference baseline: Traditional squeeze indicators like the Bollinger Band Squeeze or TTM Squeeze rely on fixed multiples of bands or momentum oscillators crossing zero, which can fire on isolated bars or ignore range compression nuances.
Architecture differences:
Realtime box construction that updates barbybar during squeezes, using arrays to track and trim price values.
Quantilebased outlier rejection to define box bounds, focusing on the bulk of prices rather than full range.
Overlap suppression logic that skips redundant boxes if the new range intersects heavily with the prior one.
Hold counter for consecutive bar validation, adding persistence before signaling.
Practical effect: Charts show fewer, more defined orange boxes encapsulating tight price action, with a horizontal line extension marking the midpoint postsqueeze—visibly reducing clutter in sideways markets and highlighting "coiled" ranges that standard plots might blur with full highs/lows. This matters for quicker visual scanning of multitimeframe setups, as boxes selflimit to recent history and avoid piling up.
How it works (technical)
The indicator starts by computing a rolling average and standard deviation over a userdefined length on the chosen source price series. This deviation measure is then smoothed into a baseline using either a simple or exponential average over a longer window, serving as a reference for normal volatility. A squeeze triggers when the current deviation dips below this baseline scaled by a multiplier less than one, but only after a minimum number of consecutive bars confirm it, which resets the counter on breaks.
Upon squeeze start, it clears a buffer and begins collecting source prices barbybar, limited to the first few bars to keep computation light. For visualization, if enabled, it sorts the buffer and finds a quantile threshold, then identifies the minimum value at or below that threshold to set upper and lower box bounds—effectively clamping the range to exclude tails above the quantile. The box draws from the start bar to the current one, updating its right edge and levels dynamically; if the new bounds overlap significantly with the last completed box, it suppresses drawing to avoid redundancy.
Once the hold limit or squeeze ends, the box freezes: its final bounds become the last reference, a midpoint line extends rightward from the end, and a tiny circle label marks the point. Buffers and states reset on new squeezes, with historical boxes and lines capped to prevent overload. All logic runs on every bar but uses confirmed historical data for calculations, with realtime updates only affecting the active box's position—no future peeking occurs. Initialization seeds with null values, building states progressively from the first bars.
Parameter Guide
Source: Selects the price series (e.g., close, hl2) for deviation and box building; influences sensitivity to wicks or bodies. Default: close. Tradeoffs/Tips: Use hl2 for balanced range view in volatile assets; stick to close for pure directional focus—test on your timeframe to avoid oversmoothing trends.
Length (Mean/SD): Sets window for average and deviation calculation; shorter values make detection quicker but noisier. Default: 20. Tradeoffs/Tips: Increase to 30+ for stability in higher timeframes, reducing false starts; below 10 risks overreacting to singlebar noise.
Baseline Length: Defines smoothing window for the deviation baseline; longer periods create a steadier reference, filtering regime shifts. Default: 50. Tradeoffs/Tips: Pair with Length at 1:2 ratio for calm markets; shorten to 30 if baselines lag during fast volatility drops, but watch for added whips.
Squeeze Multiplier (<1.0): Scales the baseline downward to set the squeeze threshold; lower values tighten criteria for rarer, stronger signals. Default: 0.8. Tradeoffs/Tips: Tighten to 0.6 for highvol assets like crypto to cut noise; loosen to 0.9 in forex for more frequent but shallower setups—balances hit rate vs. depth.
Baseline via EMA (instead of SMA): Switches baseline smoothing to exponential for faster adaptation to recent changes vs. equalweighted simple average. Default: false. Tradeoffs/Tips: Enable in trending markets for quicker baseline drops; disable for uniform history weighting in rangebound conditions to avoid overreacting.
SD: Sample (len1) instead of Population (len): Adjusts deviation formula to divide by length minus one for smallsample bias correction, slightly inflating values. Default: false. Tradeoffs/Tips: Use sample in short windows (<20) for more conservative thresholds; population suits long looks where bias is negligible, keeping signals tighter.
Min. Hold Bars in Squeeze: Requires this many consecutive squeeze bars before confirming; higher denoise but may clip early setups. Default: 1. Tradeoffs/Tips: Bump to 35 for intraday to filter ticks; keep at 1 for swings where quick consolidations matter—trades off timeliness for reliability.
Debug: Plot SD & Threshold: Toggles lines showing raw deviation and threshold for visual backtesting of squeeze logic. Default: false. Tradeoffs/Tips: Enable during tuning to eyeball crossovers; disable live to declutter—great for verifying multiplier impact without alerts.
Tint Bars when Squeeze Active: Overlays semitransparent color on bars during open box phases for quick squeeze spotting. Default: false. Tradeoffs/Tips: Pair with low opacity for subtlety; turn off if using boxes alone, as tint can obscure candlesticks in dense charts.
Tint Opacity (0..100): Controls background tint strength during active squeezes; higher values darken for emphasis. Default: 85. Tradeoffs/Tips: Dial to 60 for light touch; max at 100 risks hiding price action—adjust per chart theme for visibility.
Stored Price (during Squeeze): Price series captured in the buffer for box bounds; defaults to source but allows customization. Default: close. Tradeoffs/Tips: Switch to high/low for wider boxes in gappy markets; keep close for midline focus—impacts trim effectiveness on outliers.
Quantile q (0..1): Fraction of sorted prices below which tails are cut; higher q keeps more data but risks including spikes. Default: 0.718. Tradeoffs/Tips: Lower to 0.5 for aggressive trim in noisy assets; raise to 0.8 for fuller ranges—tune via debug to match your consolidation depth.
Box Fill Color: Sets interior shade of squeeze boxes; semitransparent for layering. Default: orange (80% trans.). Tradeoffs/Tips: Soften with more transparency in multiindicator setups; bold for standalone use—ensures boxes pop without overwhelming.
Box Border Color: Defines outline hue and solidity for box edges. Default: orange (0% trans.). Tradeoffs/Tips: Match fill for cohesion or contrast for edges; thin width keeps it clean—helps delineate bounds in zoomed views.
Keep Last N Boxes: Limits historical boxes/lines/labels to this count, deleting oldest for performance. Default: 10. Tradeoffs/Tips: Increase to 50 for weekly reviews; set to 0 for unlimited (risks lag)—balances history vs. speed on long charts.
Draw Box in Realtime (build/update): Enables live extension of boxes during squeezes vs. waiting for end. Default: true. Tradeoffs/Tips: Disable for confirmedonly views to mimic backtests; enable for proactive trading—adds minor repaint on live bars.
Box: Max First N Bars: Caps buffer collection to initial squeeze bars, freezing after for efficiency. Default: 15. Tradeoffs/Tips: Shorten to 510 for fast intraday; extend to 20 in dailies—prevents bloated arrays but may truncate long squeezes.
Reading & Interpretation
Squeeze phases appear as orange boxes encapsulating the trimmed price cluster during lowvolatility holds—narrow boxes signal tight consolidations, while wider ones indicate looser ranges within the threshold. The box's top and bottom represent the quantilecapped high and low of collected prices, with the interior fill shading the containment zone; ignore extremes outside for "true" bounds. Postsqueeze, a solid horizontal line extends right from the box's midpoint, acting as a reference level for potential breakout tests—drifting prices toward or away from it can hint at building momentum. Tiny orange circles at the line's start mark completion points for easy scanning. Debug lines (if on) show deviation hugging or crossing the threshold, confirming hold logic; a persistent hug below suggests prolonged calm, while spikes above reset counters.
Practical Workflows & Combinations
Trend following: Enter long on squeezeend close above the box top (or midpoint line) confirmed by higher high in structure; filter with rising 50period average to avoid countertrend traps. Use boxes as support/resistance proxies—short below bottom in downtrends.
Exits/Stops: Trail stops to the box midpoint during postsqueeze runs for conservative holds; go aggressive by exiting on retest of opposite box side. If debug shows repeated threshold grazes, tighten stops to curb drawdowns in ranging followups.
Multiasset/MultiTF: Defaults work across stocks, forex, and crypto on 15min+ frames; scale Length proportionally (e.g., x2 on hourly). Layer with highertimeframe boxes for confluence—e.g., daily squeeze + 1H box for entry timing. (Unknown/Optional: Specific multiTF scaling recipes beyond proportional adjustment.)
Behavior, Constraints & Performance
Repaint/confirmation: Core calculations use historical closes, confirming on bar close; active boxes repaint their right edge and levels live during squeezes if enabled, but freeze irrevocably on hold limit or end—mitigates via barbybar buffer adds without future leaks. No lookahead indexes.
security()/HTF: None used, so no external timeframe repaints; all native to chart resolution.
Resources: Caps at 300 boxes/lines/labels total; small arrays (up to 20 elements) and short loops in sorting/minfinding keep it light—suitable for 10k+ bar charts without throttling. Persistent variables track state across bars efficiently.
Known limits: May lag on ultrasharp volatility spikes due to baseline smoothing; gaps or thin markets can skew trims if buffer hits cap early; overlaps suppress visuals but might hide chained squeezes—(Unknown/Optional: Edge cases in nonstandard sessions).
Sensible Defaults & Quick Tuning
Start with defaults for most liquid assets on 1Hdaily: Length 20, Multiplier 0.8, Hold 1, Quantile 0.718—yields balanced detection without excess noise. For too many false starts (choppy charts), increase Hold to 3 and Baseline Length to 70 for stricter confirmation, reducing signals by 3050%. If squeezes feel sluggish or miss quick coils, shorten Length to 14 and enable EMA baseline for snappier adaptation, but monitor for added flips. In highvol environments like options, tighten Multiplier to 0.6 and Quantile to 0.6 to focus on core ranges; reverse for calm pairs by loosening to 0.95. Always backtest tweaks on your asset's history.
What this indicator is—and isn’t
This is a volatilityfiltered visualization tool for spotting and bounding consolidation phases, best as a signal layer atop price action and trend filters—not a standalone predictor of direction or strength. It highlights setups but ignores volume, momentum, or news context, so pair with discreteness rules like higher highs/lows. Never use it alone for entries; always layer risk management, such as 12% stops beyond box extremes, and position sizing based on account drawdown tolerance.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on HeikinAshi, Renko, Kagi, PointandFigure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Fibonacci//@version=5
indicator("Fib", overlay = true)
// === INPUTS ===
lineLength = input.int(4, "Line Length (Bars)", minval = 1)
labelSize = input.string("large", "Label Size", options = )
// === Session Start (9:30 AM NY time) ===
sessionStart = timestamp("America/New_York", year(time), month(time), dayofmonth(time), 9, 30)
isNewDay = ta.change(time("D")) != 0
inSession = time >= sessionStart
// === Track High/Low from session start ===
var float dayHigh = na
var float dayLow = na
if isNewDay
dayHigh := na
dayLow := na
if inSession
dayHigh := na(dayHigh) ? high : math.max(dayHigh, high)
dayLow := na(dayLow) ? low : math.min(dayLow, low)
// === Fibonacci Levels ===
range1 = dayHigh - dayLow
fib_0 = dayHigh
fib_236 = dayHigh - 0.236 * range1
fib_382 = dayHigh - 0.382 * range1
fib_500 = dayHigh - 0.500 * range1
fib_618 = dayHigh - 0.618 * range1
fib_764 = dayHigh - 0.764 * range1
fib_100 = dayLow
// === Line and Label Handles ===
var line line_0 = na
var line line_236 = na
var line line_382 = na
var line line_500 = na
var line line_618 = na
var line line_764 = na
var line line_100 = na
var label label_0 = na
var label label_236 = na
var label label_382 = na
var label label_500 = na
var label label_618 = na
var label label_764 = na
var label label_100 = na
// === Redraw Conditions ===
justEnteredSession = inSession and na(dayHigh )
redrawInterval = 2 // ← Redraw every 2 candles
shouldDraw = inSession and not na(dayHigh) and not na(dayLow) and (justEnteredSession or bar_index % redrawInterval == 0)
if shouldDraw
// Delete old lines and labels
line.delete(line_0)
line.delete(line_236)
line.delete(line_382)
line.delete(line_500)
line.delete(line_618)
line.delete(line_764)
line.delete(line_100)
label.delete(label_0)
label.delete(label_236)
label.delete(label_382)
label.delete(label_500)
label.delete(label_618)
label.delete(label_764)
label.delete(label_100)
// Calculate midpoint of line
int midX = bar_index + lineLength / 1
// Label size
labelSizeEnum = labelSize == "large" ? size.large : labelSize == "normal" ? size.normal : size.small
// === Draw lines and % labels ===
// Uncomment the levels you want to show
// line_0 := line.new(bar_index, fib_0, bar_index + lineLength, fib_0, color = color.white, width = 1)
// label_0 := label.new(midX, fib_0, text = str.tostring(fib_0, format.mintick), xloc = xloc.bar_index, yloc = yloc.price, size = labelSizeEnum, style = label.style_label_left, textcolor = color.white, color = color.new(color.white, 85))
// line_236 := line.new(bar_index, fib_236, bar_index + lineLength, fib_236, color = color.green, width = 1)
// label_236 := label.new(midX, fib_236, text = str.tostring(fib_236, format.mintick), xloc = xloc.bar_index, yloc = yloc.price, size = labelSizeEnum, style = label.style_label_left, textcolor = color.green, color = color.new(color.green, 85))
// line_382 := line.new(bar_index, fib_382, bar_index + lineLength, fib_382, color = color.green, width = 1)
// label_382 := label.new(midX, fib_382, text = str.tostring(fib_382, format.mintick), xloc = xloc.bar_index, yloc = yloc.price, size = labelSizeEnum, style = label.style_label_left, textcolor = color.green, color = color.new(color.green, 85))
line_500 := line.new(bar_index, fib_500, bar_index + lineLength, fib_500, color = color.white, width = 1)
label_500 := label.new(midX, fib_500, text = str.tostring(fib_500, format.mintick), xloc = xloc.bar_index, yloc = yloc.price, size = labelSizeEnum, style = label.style_label_left, textcolor = color.white, color = color.new(color.white, 85))
// line_618 := line.new(bar_index, fib_618, bar_index + lineLength, fib_618, color = color.green, width = 1)
// label_618 := label.new(midX, fib_618, text = str.tostring(fib_618, format.mintick), xloc = xloc.bar_index, yloc = yloc.price, size = labelSizeEnum, style = label.style_label_left, textcolor = color.green, color = color.new(color.green, 85))
// line_764 := line.new(bar_index, fib_764, bar_index + lineLength, fib_764, color = color.green, width = 1)
// label_764 := label.new(midX, fib_764, text = str.tostring(fib_764, format.mintick), xloc = xloc.bar_index, yloc = yloc.price, size = labelSizeEnum, style = label.style_label_left, textcolor = color.green, color = color.new(color.green, 85))
// line_100 := line.new(bar_index, fib_100, bar_index + lineLength, fib_100, color = color.white, width = 1)
// label_100 := label.new(midX, fib_100, text = str.tostring(fib_100, format.mintick), xloc = xloc.bar_index, yloc = yloc.price, size = labelSizeEnum, style = label.style_label_left, textcolor = color.white, color = color.new(color.white, 85))
Range Percentage Analyzer This indicator is a tool for analyzing the market range and trend. It calculates the extent of price movement between a specified starting point and the current price, displaying it as a percentage.
The calculation can be based on a fixed lookback period (e.g., the last 30 candles) or from a fixed start date. It also provides a clear table that shows the general trend in "Trend" mode, and the relative strength of the base and quote currencies of forex pairs (e.g., EURUSD) in "Forex" mode.
User Guide
Calculation Method
This setting determines how the indicator defines the starting point for the calculation.
Lookback Period: In this mode, the indicator uses the last N candles (the number can be specified in the "Lookback Period (bars)" field, maximum 250).
The starting point is "floating," meaning it shifts with each new candle. For example, with a setting of 30, the 30th candle from the current one will always be the starting point.
Date Based: In this mode, the calculation starts from a fixed date and time you select.
This mode is ideal for measuring performance from a specific event (e.g., news, start of a week/month).
Note: If you select a date in "Date Based" mode for which no data is available on the current timeframe (e.g., switching to a very low timeframe), the indicator will automatically use the earliest available candle as the starting point.
Start Date & Time
This setting is only active in "Date Based" mode.
Here you can specify the fixed starting point for the calculation.
The specified time is in the Exchange timezone.
Important limitation: Due to TradingView platform limits, visual elements (box, line) are only drawn for a maximum of 250 candles back.
If the set date is older than this, the calculation still applies to the entire period (from the set date), but the drawing only covers the last 250 candles.
When switching to a higher timeframe, the range may restart from a slightly later bar due to TradingView's bar alignment. For best accuracy, set your timeframe first, then select the start date.
Table Mode
This setting controls what data the information table displays.
Trend: This is the default mode, which works on any symbol (stock, index, crypto, etc.). It displays information related to the trend.
Forex: This is a special mode used to measure the strength of currency pairs.
It only works on symbols with exactly 6 characters (e.g., "EURUSD", "BTCUSD"). It treats the first 3 characters as the base currency (e.g., EUR) and the last 3 as the quote currency (e.g., USD).
If the symbol does not have 6 characters, the table will automatically display in "Trend" mode.
Extremes Trend Row
If this is enabled, the table displays an additional row that determines the trend based on the formation order of the high and low within the analyzed range.
The logic is as follows:
Bullish: Indicated if the low was formed before the high.
(Or if they formed on the same candle, which was a bullish candle).
Bearish: Indicated if the high was formed before the low.
(Or if they formed on the same candle, which was a bearish candle).
Neutral: Indicated if the high and low formed on the same candle, and it was a "doji" candle (close = open).
Upper & Lower Threshold
These settings control the logic for the "Change Trend" and "Forex Display" rows at the top of the table.
They determine when the total percentage change for the entire period is considered "Bullish/Strong", "Bearish/Weak", or "Neutral".
Upper Threshold (%): The percentage value (default 0.1%) above which the indicator considers the change "Bullish/Strong".
Lower Threshold (%): The percentage value (default -0.1%) below which the indicator considers the change "Bearish/Weak".
If the change is between the two, the signal is Neutral.
RMBS Smart Detector - Multi-Factor Momentum System v2# RMBS Smart Detector - Multi-Factor Momentum System
## Overview
RMBS (Smart Detector - Multi-Factor Momentum System) is a proprietary scoring method developed by Ario, combining normalized RSI and Bollinger band positioning into a single composite metric.
---
## Core Methodology
### Buy/Sell Logic
Marker (green or red )appear when **all four filters** pass:
**1. RMBS Score (Momentum Strength)**
From the formula Bellow
Combined Range: -10 (extreme bearish) to +10 (extreme bullish)
Signal Thresholds:
• BUY: Score > +3.0
• SELL: Score < -3.0
2. EMA Trend Filter
BUY: EMA(21) > EMA(55) → Uptrend confirmed
SELL: EMA(21) < EMA(55) → Downtrend confirmed
3. ADX Strength Filter
Minimum ADX: 25 (adjustable 20-30)
ADX > 25: Trending market → Signal allowed
ADX < 25: Range-bound → Signal blocked
4. Alternating Logic
Prevents signal spam by requiring alternation:
✓ BUY → SELL → BUY (allowed)
✗ BUY → BUY → BUY (blocked)
________________________________________
Mathematical Foundation
RMBS Formula: scoring method developed by Ario
RMBS = (RSI – 50) / 10 + ((BB_pos – 50) / 10)
where:
• RSI = Relative Strength Index (close, L)
• BB_pos = (Close – (SMA – 2 σ)) / ((SMA + 2 σ) – (SMA – 2 σ)) × 100
• σ = standard deviation of close over lookback L
• SMA = simple moving average of close over lookback L
• L = rmbs_length (period setting)
This produces a normalized composite score around zero:
• Positive → bullish momentum and upper band dominance
• Negative → bearish momentum and lower band pressure
• Near 0 → neutral or transitional zone
Input Parameters
ADX Threshold (default: 25)
• Lower (20-23): More signals, less filtering
• Higher (28-30): Fewer signals, stronger trends
• Recommended: 25 for balanced filtering
Signal Thresholds
• BUY: +3.0 (adjustable)
• SELL: -3.0 (adjustable)
Visual Options
• Marker colors
• Background highlights
• Alert settings
________________________________________
Usage Guidelines
How to Interpret
• 🟢 Green Marker: All conditions met for Bull condition
• 🔴 Red Marker: All conditions met for Bear condition
• No Marker: Waiting for confirmation
________________________________________
Important Disclaimers
⚠️ Educational Purpose Only
• This tool demonstrates multi-factor technical analysis concepts
• Not financial advice or trade recommendations
• No guarantee of profitability
⚠️ Known Limitations
• Less effective in ranging/choppy markets
• Requires proper risk management (stop-loss, position sizing)
• Should be combined with fundamental analysis
⚠️ Risk Warning
Trading involves substantial risk of loss. Past performance does not indicate future results. Always conduct your own research and consult professionals before trading.
________________________________________
Open Source
Full Pine Script code available for educational study and modification. Feedback and improvement suggestions welcome.
“All logic is presented for research and educational visualization.”
Oversold Screener · v4# Step-2 Oversold Screener · v3.3
US equities · 15-minute event engine · AVWAP entries A–F · optional CVD/RSI/Z guards
## What this script does
Finds short, emotion-driven selloffs in large, healthy US stocks and turns them into actionable, right-side opportunities.
On a qualified 15-minute close it:
1. emits a minimal webhook so your backend/AI can vet the news and fundamentals, and
2. anchors an Event-AVWAP and plots ±1/±2/±3σ bands to guide entries A–F as price mean-reverts.
The logic runs in a fixed 15-minute space, independent of the chart timeframe you view.
## How an event is detected (Step-2 signal)
All conditions are evaluated on 15-minute data, including extended hours.
Depth, measured vs yesterday’s RTH reference
* Reference = min(yesterday’s RTH VWAP proxy, yesterday’s Close).
* 4h depth: current price vs reference across 16×15m bars ≤ threshold (default −4%).
* 8h depth: lowest close across the last 32×15m bars vs reference ≤ threshold (default −6%).
Relative underperformance
* Versus market ETF (SPY/QQQ) and sector ETF (XLK/XLF/XLY… or KWEB/CQQQ).
* Uses the same 16/32×15m windows; stock must be weaker by at least the set margins (default −3%).
Macro circuit breakers (any one trips = suppress signal)
* VIX level ≥ fuse (default 28).
* Market 4h/8h drawdown ≤ limits (default −2.0% / −3.5%).
* Sector 4h/8h drawdown ≤ limits (default −2.5% / −4.0%).
Momentum and distribution guards
* RSI(1h) < 30 by default (computed from 15m series).
* Optional Z-score filters: stock Z ≤ zTrig, and macro Z floors for market/sector.
* Cooldown per symbol so you don’t get spammed by repeated events.
When the event closes, the script posts a tiny JSON to your alert webhook and pins an on-chart “S2” marker at the event bar.
## Event-AVWAP and bands
From the event bar forward the script computes AVWAP natively in 15m space and draws bands at ±1σ/±2σ/±3σ.
σ is a rolling standard deviation of typical price with optional EMA smoothing and an optional cap.
Why this helps
* AVWAP from the shock timestamp approximates the crowd’s average position after the selloff.
* Reclaiming key bands often marks the start of orderly mean reversion rather than a dead-cat bounce.
## Entry proposals A–F (right-side confirmations)
Each entry requires first touching a lower band, then reclaiming a higher band.
A touch ≤ −2σ, then cross up through −1σ
B touch ≤ −1σ, then reclaim AVWAP
C break above −1σ, retest near −1σ within N bars, then bounce
D after compression (low ATR%), reclaim AVWAP
E touch ≤ −3σ, then cross up through −2σ
F touch ≤ −3σ, then cross up through −1σ (fast, aggressive)
Labeling hygiene
* Only the first three occurrences of each type A–F are shown within a one-week window after the event.
* A debounce interval avoids over-labeling across adjacent bars.
## Optional CVD gate (order-flow confirmation)
When enabled, entries must also pass a 15-minute CVD gate that looks for sell pressure exhaustion and a turn-up in cumulative delta.
Defaults are conservative; start with CVD off until you’re comfortable, then enable to filter chop after capitulations.
## Alert payload (minimal by design)
On the event bar close the script fires one alert with a tiny JSON that is easy to route and process in bulk:
```json
{
"event": "Crash_signal_15m",
"symbol": "NVDA",
"symbol_id": "NASDAQ:NVDA",
"ts_alert_15m_ms": 1730898900000,
"ts_alert_15m_local": "2025-11-06 10:45"
}
```
Notes
* ts_alert_15m_ms is the 15-minute close time in milliseconds since epoch (UTC reference).
* ts_alert_15m_local uses your chart’s timezone for readability.
Optional: a 24-hour streaming mode can resend this minimal payload on every 15-minute close during the day after the event (tiny patch available on request).
## Inputs you will actually touch
Bench/Sector symbols
* Bench: SPY or QQQ. Sector: XLK/XLF/XLY… or KWEB/CQQQ depending on the name.
Depth and relative thresholds
* 4h depth ≤ −4%, 8h depth ≤ −6%.
* Relative to market/sector ≤ −3% each.
Macro fuses
* VIX ≥ 28; market ≤ −2.0%/−3.5%; sector ≤ −2.5%/−4.0%.
Z/RSI guards
* Z window 80 bars (15m), stock zTrig ≤ −1.5, macro floors ≥ −1.0.
* RSI(1h) < 30.
AVWAP band engine
* σ EMA length 3; σ cap off by default.
* Retest window for entry C: 24 bars (≈6 hours).
Presentation and hygiene
* One-week entry window; per-type cap 3; debounce 8×15m bars.
* Signal table on/off, label pinning on/off.
## How to run it
1. Open a 15-minute chart (extended hours enabled recommended).
2. Add the indicator and choose Bench/Sector for the names you are reviewing.
3. Create a single alert per chart with Condition = Any alert() function call and Options = Once per bar close.
4. Point the alert to your webhook URL (or use app/email if you don’t have a URL).
5. Let your backend/AI receive the minimal JSON, do the news/fundamentals check, and decide Allow / Hold / Reject.
6. For Allowed names, use the on-chart A–F markers to stage in; manage risk against Event-AVWAP and upper HVNs/POC.
## Defaults that work well
* RSI(1h) < 30
* Depth 4h/8h ≤ −4%/−6% vs yesterday’s reference
* Relative to market/sector ≤ −3%
* Z: stock ≤ −1.5; macro floors ≥ −1.0
* Fuses: VIX ≥ 28; market ≤ −2.0%/−3.5%; sector ≤ −2.5%/−4.0%
* Bands: σ EMA = 3; no σ cap; one-week window; 3 labels per type
## Notes and limitations
* This is an indicator, not an auto-trader. Position sizing and exits are up to you.
* Designed for liquid US equities; thin ADRs and micro-caps are noisy.
* All event logic and entries are evaluated on bar close; AVWAP and bands do not repaint.
* If you need to monitor many symbols without a server, a Scanner variant can batch 10–17 tickers per script and alert without a webhook.
0DTE Options - Iron Condor & ButterflyTo help options traders:
Plan and structure Iron Condor or Butterfly spreads in “Setup Mode.”
Track live trades, including P&L, breach risk, and strike distances, in “Live Mode.”
Visualize the trade on the price chart with profit zones, breakeven lines, strike markers, and alerts.
Evaluate market conditions using IV Rank, ATR-based range modeling, and modeled Delta approximation.
Essentially, it turns your TradingView chart into an options risk graph + planning terminal.
⚙️ Core Modes of Operation
🧱 1. Setup Mode
Used for planning new trades. It automatically suggests strikes based on:
ATR (volatility proxy)
IV Rank
Target Delta
Chosen risk tier (High / Mid / Low / Delta)
You can:
Preview recommended short and long strikes.
See estimated credit, width, and risk/reward ratios in a setup table.
Auto-feed these calculated strikes into the Live Mode to track them later.
Example Use:
Before market open, choose Setup Mode → Mid Risk Tier → see what strike widths and credits make sense for the day.
📈 2. Live Mode
Used to track real trades you’ve already opened.
You can:
Paste your real trade data (strikes, credits, etc.) into the 📋 paste field.
Or auto-feed from Setup Mode (if “Auto-Feed” is enabled).
The indicator then plots:
Short/long strikes
Breakevens
Profit/loss zone
Real-time breach detection and delta drift
Alerts when price nears your strikes or exits your safe zone.
Example Use:
After opening an Iron Condor on SPX, paste in 626,628,620,618,1.20,1, and the chart visually shows your safe range and warning zones.
🧮 Built-In Calculations
1. IV Rank (Volatility Environment)
Uses a 20-day log return volatility model to calculate IV Rank (percentile of volatility over the last 252 bars).
You can use this automatically or manually override it if you have data from your broker.
→ High IV Rank (>50) = better for selling Iron Condors (more premium).
2. ATR (Average True Range)
Measures short-term volatility to estimate expected daily price movement.
Used in Setup Mode to model distance between strikes.
3. Strike Calculations (Setup Mode)
Based on risk tier:
High Risk → wide wings, high credit, high potential drawdown
Mid Risk → balanced setup
Low Risk → narrow wings, safer but less credit
Delta Mode → based purely on target delta (e.g., 0.20)
Uses ATR × multiplier to determine how far short strikes should be from current price.
4. Credit Estimation
Based on strike width × IV Rank multiplier:
IV > 50 → 30% of width
IV 30–50 → 25%
IV < 30 → 20%
5. Profit & Loss Modeling
The indicator computes:
Max Profit:
Iron Condor → credit × 100 × contracts
Butterfly → (wing width − debit) × 100 × contracts
Max Loss:
Iron Condor → width − credit
Butterfly → debit × 100 × contracts
Breakevens:
Iron Condor → short strikes ± credit
Butterfly → body ± debit
Current P&L: Approximated by where the underlying is relative to the short/long strikes.
6. Delta Modeling
Estimates each short strike’s modeled delta based on how far it is from current price.
Displays total delta balance to show directional bias.
If Delta drifts too high → market imbalance → consider rolling or adjusting.
7. Breach Detection System
Automatically classifies your trade as:
🟢 In Range: Price between short strikes (safe zone).
🟠 Near Breach: Price close to short strike (risk zone).
🔴 Breached: Price outside long strike (stop or adjust zone).
This dynamically changes color in your profit box and info label.
🎨 Visual Components
Element Meaning Color
Red Line Put side strikes 🔻 Red
Green Line Call side strikes 🔺 Green
Yellow Dotted Lines Breakevens 🟡 Yellow
Green Box Profit zone 🟩 Light green
Orange Box Adjustment zone (near breach) 🟧 Orange
Red Box Breach zone 🟥 Red
White Line Current price ⚪ White
Optional labels display strike details and distances (e.g., “📉 Short Put: 620 – 5 pts away”).
📊 Setup Table (Setup Mode Only)
Displays a grid comparing all risk tiers:
Tier Short Call Short Put Width Est. Credit R:R
High 632 614 4.0 $1.20 0.43
Mid 630 616 3.0 $0.90 0.43
Low 628 618 2.0 $0.60 0.43
Highlighted row = selected risk tier.
This lets you compare how wide/narrow each setup is before committing to a trade.
🧾 Info Box (Live Mode)
Displays real-time stats such as:
🔶 IRON CONDOR | 1 Contract
📊 Calls: 626 / 628 | Puts: 620 / 618
💵 Credit: $1.20 | 💰 Profit: $120 | 🔴 Loss: $180
⬆️ BE: 627.2 | ⬇️ BE: 618.8
📍 Current: $623 | 💵 P&L: +$35.00 (+29.1%)
📏 To Short Call: 3 | To Short Put: 3
📊 Delta: 0.05 | IV Rank: 56% (FAVORABLE)
🔴 BREACH STATUS: In Range
🚨 Alerts
The indicator generates TradingView alerts for:
⚠️ Approaching Call Zone → nearing short call
⚠️ Approaching Put Zone → nearing short put
🛑 Stop Loss Triggered → current P&L exceeds loss threshold
🟠 Near Breach → price entering adjustment zone
🔴 Breached → price outside protection (long strikes)
These alerts can be used with TradingView notifications or webhooks.
🧠 How to Use It Step-by-Step
A. Planning (Setup Mode)
Set mode to “Setup.”
Adjust:
Risk Tier (High / Mid / Low / Delta)
Target Delta (0.15–0.30 recommended)
Strike Interval (e.g., 1.0 or 5.0)
Check Setup Table → see suggested strikes & credits.
Optionally toggle Auto-Feed → Live to send to live mode later.
B. Executing (Broker)
Confirm and enter your trade in your brokerage (use the strikes shown).
Record your strikes, net credit/debit, and number of contracts.
C. Tracking (Live Mode)
Switch to “Live” mode.
Paste your strikes in the 📋 Paste Data field:
Iron Condor Example: 626,628,620,618,1.20,1
Butterfly Example: 600,620,640,2.50,2
The chart updates:
Lines = your strikes
Boxes = profit/risk zones
Labels = strike info, distance to price
Info box = P&L, delta, IV rank, breach status
Set alerts for automatic notifications.
D. Managing the Trade
When the chart turns orange or red, you’re approaching or breaching a strike.
Use this signal to roll, hedge, or close your trade.
Monitor Gamma Risk: warning appears when price nears short strikes (explosive delta risk).
📌 Summary
Feature Description
Mode Switching Plan (Setup) or Track (Live)
IV Rank & ATR Modeling Estimates volatility environment
Auto Strike Planning Suggests strikes based on risk/delta
Visual Range Map Profit, breakeven, and adjustment zones
Real-Time Alerts Warns when nearing or breaching strikes
Trade Info Box Displays live risk, reward, delta, IV, and P&L
Setup Table Compares setups across risk tiers
Fully Configurable Works for Iron Condors or Butterflies
Time & Session Dividers### indicator Summary
This indicator is a powerful utility designed to help you visualize time-based market structure by drawing customizable vertical lines on your chart. It allows you to clearly mark the beginning of new timeframes (like hours, days, or weeks) and highlight specific trading sessions or time slots (like the London open or a news event).
It comes with **6 independent dividers** that you can configure to your exact needs:
* **3 Timeframe Dividers**
* **3 Custom Time Slot Dividers**
### Key Features
* **Timeframe Separators:** Set up to 3 different higher timeframes (e.g., 1H, 4H, 1D). The indicator will automatically draw a vertical line at the start of each new bar for that timeframe, helping you easily see hourly, daily, or weekly boundaries.
* **Custom Time Slots (Sessions):** Define up to 3 specific time windows (e.g., "09:30-16:00" for the New York session). The indicator will draw a line at the **start** of this session and another line at the **end**, allowing you to isolate specific periods of market activity.
* **Full Customization:** Each of the 6 dividers is fully independent and can be customized with:
* A simple toggle to turn it on or off.
* A unique color.
* A line style (Solid, Dotted, or Dashed).
* A toggle to show or hide its text label.
* **Smart Labels:** Labels for timeframe dividers display the timeframe (e.g., "4H"), while labels for time slots automatically format to show the precise start or end time (e.g., "09:30" and "16:00").
### How to Use
1. Add the "Timeframe Vertical Lines" indicator to your chart.
2. Open the indicator's **Settings** panel.
3. **To add a timeframe line (e.g., Daily):**
* Go to the "Timeframe Divider 1" group.
* Check the "Show Divider 1" box.
* Set the "Timeframe 1" to "1D".
* Adjust the color, style, and text visibility to your liking.
4. **To add a session line (e.g., London Session):**
* Go to the "Time Slot Divider 1" group.
* Check the "Show Time Slot Divider 1" box.
* Set the "Time Slot 1" to your desired session, e.g., "0800-1700".
* Adjust the color and style. The script will now draw lines at 08:00 and 17:00 (based on the chart's timezone).
5. Repeat the process using the other available divider slots to build a complete temporal map of your chart.
Sesiones Globales 🌍 Londres / Wall Street / Tokio / SydneyA clean visualization of the four main trading sessions — all shown in Argentina time (UTC−3) for easier global market tracking.
🕒 Sessions covered:
London 🇬🇧 — 05:00 to 13:30
Wall Street 🇺🇸 — 11:30 to 18:00
Tokyo 🇯🇵 — 21:00 to 03:00
Sydney 🇦🇺 — 20:00 to 02:00
✨ Features:
Soft background colors for each market session (non-intrusive and chart-friendly)
“OPEN” and “CLOSE” labels in matching session colors
Correct weekend handling — Tokyo and Sydney extend into early Saturday mornings (no false sessions shown)
Works on any asset — BTC, SP500, FX, or indices
Designed for dark charts and visual clarity
🎯 Why use it:
See where global liquidity overlaps, detect volatility zones, and plan your trades around real session activity — especially helpful for BTC and SP500 traders following institutional flow.
💡 Tip: All times are set to Argentina (UTC−3) by default. Adjust manually if you prefer another timezone.
NY VIX Channel Trend US Futures Day Trade StrategyNY VIX Channel Trend Strategy
Summary in one paragraph
Session anchored intraday strategy for index futures such as ES and NQ on one to fifteen minute charts. It acts only after the first configurable window of New York Regular Trading Hours and uses a VIX derived daily implied move to form a realistic channel from the session open. Originality comes from using a pure implied volatility yardstick as portable support and resistance, then committing in the direction of the first window close relative to the open. Add it to a clean chart and trade the simple visuals. For conservative alerts use on bar close.
Scope and intent
• Markets. Index futures ES and NQ
• Timeframes. One to thirty minutes
• Default demo. ES1 on five minutes
• Purpose. Provide a portable intraday yardstick for entries and exits without curve fitting
• Limits. This is a strategy. Orders are simulated on standard candles
Originality and usefulness
• Unique concept. A VIX only channel anchored at 09:30 New York plus a single window trend test
• Addresses. False urgency at session open and unrealistic bands from arbitrary multipliers
• Testability. Every input is visible and the channel is plotted so users can audit behavior
• Portable yardstick. Daily implied move equals VIX percent divided by square root of two hundred fifty two
• Protected status. None. Method and use are fully disclosed
Method overview in plain language
Take the daily VIX or VIX9D value, convert it to a daily fraction by dividing by square root of two hundred fifty two, then anchor a symmetric channel at the New York session open. Observe the first N minutes. If that window closes above the open the bias is long. If it closes below the open the bias is short. One trade per session. Exits occur at the channel boundary or at a bracket based on a user selected VIX factor. Positions are closed a set number of minutes before the session ends.
Base measures
Return basis. The daily implied move unit equals VIX percent divided by square root of two hundred fifty two and serves as the distance unit for targets and stops.
Components
• VIX Channel. Top, mid, bottom lines anchored at 09:30 New York. No extra multipliers
• Window Trend. Close of the first N minutes relative to the session open sets direction
• Risk Bracket. Take profit and stop loss equal to VIX unit times user factor
• Session Window. Uses the exchange time of the chart
Fusion rule
Minimum gates count equals one. The trade only arms after the window has elapsed and a direction exists. One entry per session.
Signal rule
• Long when the window close is above the session open and the window has completed
• Short when the window close is below the session open and the window has completed
• Exit on channel touch. Long exits at the top. Short exits at the bottom
• Flat thirty minutes before the session close or at the user setting
Inputs with guidance
Setup
• Use VIX9D. Width source. Typical true for fast tone or false for baseline
• Use daily OPEN. Toggle for sensitivity to overnight changes
Logic
• Window minutes. Five to one hundred twenty. Larger values delay entries and reduce whipsaw
• VIX factor for TP. Zero point five to two. Raising it widens the profit target
• VIX factor for SL. Zero point five to two. Raising it widens the stop
• Exit minutes before close. Fifteen to ninety. Raising it exits earlier
Properties visible in this publication
• Initial capital one hundred thousand USD
• Base currency USD
• request.security uses lookahead off
• Commission cash per contract two point five $ per each contract. Slippage one tick
• Default order size method FIXED with value one contract. Pyramiding zero. Process orders on close ON. Bar magnifier OFF. Recalculate after order is filled OFF. Calc on every tick ON
Realism and responsible publication
No performance claims. Past results never guarantee future outcomes. Fills and slippage vary by venue. Shapes can move while a bar forms and settle on close. Strategy uses standard candles.
Honest limitations and failure modes
Economic releases and thin liquidity can break the channel. Very quiet regimes can reduce signal contrast. Session windows follow the exchange time of the chart. If both stop and target can be hit within one bar, assume stop first for conservative reading without bar magnifier.
Works best in liquid hours of New York RTH. Very large gaps and surprise news may exceed the implied channel. Always validate on the symbols you trade.
Entries and exits
• Entry logic. After the first window, go long if the window close is above the session open, go short if below
• Exit logic. Long exits at the channel top or at the take profit or stop. Short exits at the channel bottom or at the take profit or stop. Flat before session close by the configured minutes
• Risk model. Initial stop and target based on the VIX unit times user factors. No trail and no break even. No cooldown
• Tie handling. Treat as stop first for conservative interpretation
Position sizing
Fixed size one contract per trade. Target risk per trade should generally remain near one percent of account equity. Risk is based on the daily volatility value, the max loss from the tests for one year duration with 5min chart was 4%, while the avg loss was below <1% of the total capital.
If you have any questions please let me know. Thank you for coming by !
Enhanced MA Crossover Pro📝 Strategy Summary: Enhanced MA Crossover Pro
This strategy is an advanced, highly configurable moving average (MA) crossover system designed for algorithmic trading. It uses the crossover of two customizable MAs (a "Fast" MA 1 and a "Slow" MA 2) as its core entry signal, but aggressively integrates multiple technical filters, time controls, and dynamic position management to create a robust and comprehensive trading system.
💡 Core Logic
Entry Signal: A bullish crossover (MA1 > MA2) generates a Long signal, and a bearish crossover (MA1 < MA2) generates a Short signal. Users can opt to use MA crossovers from a Higher Timeframe (HTF) for the entry signal.
Confirmation/Filters: The basic MA cross signal is filtered by several optional indicators (see Filters section below) to ensure trades align with a broader trend or momentum context.
Position Management: Trades are managed with a sophisticated system of Stop Loss, Take Profit, Trailing Stops, and Breakeven stops that can be fixed, ATR-based, or dynamically adjusted.
Risk Management: Daily limits are enforced for maximum profit/loss and maximum trades per day.
⚙️ Key Features and Customization
1. Moving Averages
Primary MAs (MA1 & MA2): Highly configurable lengths (default 8 & 20) and types: EMA, WMA, SMA, or SMMA/RMA.
Higher Timeframe (HTF) MAs: Optional MAs calculated on a user-defined resolution (e.g., "60" for 1-hour) for use as an entry signal or as a trend confirmation filter.
2. Multi-Filter System
The entry signal can be filtered by the following optional conditions:
SMA Filter: Price must be above a 200-period SMA for long trades, and below it for short trades.
VWAP Filter: Price must be above VWAP for long trades, and below it for short trades.
RSI Filter: Long trades are blocked if RSI is overbought (default 70); short trades are blocked if RSI is oversold (default 30).
MACD Filter: Requires the MACD Line to be above the Signal Line for long trades (and vice versa for short trades).
HTF Confirmation: Requires the HTF MA1 to be above HTF MA2 for long entries (and vice versa).
3. Dynamic Stop and Target Management (S/L & T/P)
The strategy provides extensive control over exits:
Stop Loss Methods:
Fixed: Fixed tick amount.
ATR: Based on a multiple of the Average True Range (ATR).
Capped ATR: ATR stop limited by a maximum fixed tick amount.
Exit on Close Cross MA: Position is closed if the price crosses back over the chosen MA (MA1 or MA2).
Breakeven Stop: A stop can be moved to the entry price once a trigger distance (fixed ticks or Adaptive Breakeven based on ATR%) is reached.
Trailing Stop: Can be fixed or ATR-based, with an optional feature to auto-tighten the trailing multiplier after the breakeven condition is met.
Profit Target: Can be a fixed tick amount or a dynamic target based on an ATR multiplier.
4. Time and Session Control
Trading Session: Trades are only taken between defined Start/End Hours and Minutes (e.g., 9:30 to 16:00).
Forced Close: All open positions are closed near the end of the session (e.g., 15:45).
Trading Days: Allows specific days of the week to be enabled or disabled for trading.
5. Risk and Position Limits
Daily Profit/Loss Limits: The strategy tracks daily realized and unrealized PnL in ticks and will close all positions and block new entries if the user-defined maximum profit or maximum loss is hit.
Max Trades Per Day: Limits the number of executed trades in a single day.
🎨 Outputs and Alerts
Plots: Plots the MA1, MA2, SMA, VWAP, and HTF MAs (if enabled) on the chart.
Shapes: Plots visual markers (BUY/SELL labels) on the bar where the MA crossover occurs.
Trailing Stop: Plots the dynamic trailing stop level when a position is open.
Alerts: Generates JSON-formatted alerts for entry ({"action":"buy", "price":...}) and exit ({"action":"exit", "position":"long", "price":...}).






















