TrendLine Toolkit w/ Breaks (Real-Time)The TrendLine Toolkit script introduces an innovating capability by extending the conventional use of trendlines beyond price action to include oscillators and other technical indicators. This tool allows traders to automatically detect and display trendlines on any TradingView built-in oscillator or community-built script, offering a versatile approach to trend analysis. With breakout detection and real-time alerts, this script enhances the way traders interpret trends in various indicators.
🔲 Methodology
Trendlines are a fundamental tool in technical analysis used to identify and visualize the direction and strength of a price trend. They are drawn by connecting two or more significant points on a price chart, typically the highs or lows of consecutive price movements (pivots).
Drawing Trendlines:
Uptrend Line - Connects a series of higher lows. It signals an upward price trend.
Downtrend Line - Connects a series of lower highs. It indicates a downward price trend.
Support and Resistance:
Support Line - A trendline drawn under rising prices, indicating a level where buying interest is historically strong.
Resistance Line - A trendline drawn above falling prices, showing a level where selling interest historically prevails.
Identification of Trends:
Uptrend - Prices making higher highs and higher lows.
Downtrend - Prices making lower highs and lower lows.
Sideways (or Range-bound) - Prices moving within a horizontal range.
A trendline helps confirm the existence and direction of a trend, providing guidance in aligning with the prevailing market sentiment. Additionally, they are usually paired with breakout analysis, a breakout occurs when the price breaches a trendline. This signals a potential change in trend direction or an acceleration of the existing trend.
The script adapts this methodology to oscillators and other indicators. Instead of relying on price pivots, which can only be detected in retrospect, the script utilizes a trailing stop on the oscillator to identify potential swings in real-time, you may find more info about it here (SuperTrend toolkit) . We detect swings or pivots simply by testing for crosses between the indicator and its trailing stop.
type oscillator
float o = Oscillator Value
float s = Trailing Stop Value
oscillator osc = oscillator.new()
bool l = ta.crossunder(osc.o, osc.s) => Utilized as a formed high
bool h = ta.crossover (osc.o, osc.s) => Utilized as a formed low
This approach enables the algorithm to detect trendlines between consecutive pivot highs or lows on the oscillator itself, providing a dynamic and immediate representation of trend dynamics.
🔲 Breakout Detection
The script goes beyond trendline creation by incorporating breakout detection directly within the oscillator. After identifying a trendline, the algorithm continuously monitors the oscillator for potential breakouts, signaling shifts in market sentiment.
🔲 Setup Guide
A simple example on one of my public scripts, Z-Score Heikin-Ashi Transformed
🔲 Settings
Source - Choose an oscillator source of which to base the Toolkit on.
Zeroing - The Mid-Line value of the oscillator, for example RSI & MFI use 50.
Sensitivity - Calibrates the Sensitivity of which TrendLines are detected, higher values result in more detections.
🔲 Alerts
Bearish TrendLine
Bullish TrendLine
Bearish Breakout
Bullish Breakout
As well as the option to trigger 'any alert' call.
By integrating trendline analysis into oscillators, this Toolkit enhances the capabilities of technical analysis, bringing a dynamic and comprehensive approach to identifying trends, support/resistance levels, and breakout signals across various indicators.
Toolkit
ICT Killzones Toolkit [LuxAlgo]The ICT Killzones Toolkit is a comprehensive set of tools designed to assist traders in identifying key trading zones and patterns within the market.
The ICT Killzones Toolkit includes the following Price Action components:
ICT Killzones with Pivot Highs/Lows
Order Blocks
Breaker Blocks
Fair Value Gaps
Market Structure Shifts
By combining these components, the ICT Killzones Toolkit provides traders with a comprehensive framework for analyzing the market and identifying setups of interest. Leveraging these tools effectively can enhance traders' decision-making process and improve killzones interpretability.
🔶 USAGE
In forex/futures trading, timing is crucial. ICT Killzone are specific periods when there's a higher chance of finding setups of interest. Mastering these time intervals can offer significant advantages to traders who know how to use them effectively.
The image above highlights a potential setup of interest when using the ICT Killzones Toolkit.
As another example for utilizing the ICT Killzones Toolkit, we can see in the image above when price retests setups generated from killzones such as Order Blocks or Fair Value Gaps, a potential strategy could be to look for entries on those & take profits as the next killzone appears.
🔹 Order Blocks
Order Blocks are sections on a price chart where notable buying or selling activity has occured, often signaling interest zones for institutional traders. This toolkit's Order Blocks component pinpoints these areas within the Killzone, which may act as potential support or resistance levels.
🔹 Breaker Blocks
Breaker Blocks are zones built from mitigated order blocks, and highlight zones on the chart where price has previously stalled or reversed. These areas may act as significant barriers to price movement in the future, and the Breaker Blocks component helps traders identify them for potential trading opportunities.
🔹 Fair Value Gaps
Fair value gaps are especially favored by price action traders and arise from market inefficiencies or imbalances, typically when buying and selling are unequal. These gaps often attract price movement before resuming in the same direction. the Fair Value Gaps component of the toolkit helps traders identify and analyze them.
🔹 Market Structure Shifts
Market Structure Shifts refer to significant changes in the overall structure of the market, such as shifts in trend direction, volatility, or trading activity. These shifts can provide valuable insights into market sentiment and potential trading opportunities, and the Market Structure Shifts component helps traders identify and interpret them.
Overall, the ICT Killzone Toolkit combines these components to provide traders with a comprehensive framework for analyzing the markets and identifying high-probability trading setups.
🔶 SETTINGS
🔹 ICT Killzones
Asian, London Open, New York, and London Close: toggles the visibility of specific Killzones, allowing users to customize time periods and Killzone colors.
Killzone Lines : Top/Bottom, Mean and Extend Top/Bottom: toggles the visibility of the Killzone's pivot high and low lines, mean (average) line, and allows users to extend the pivot lines.
Killzone Labels: Toggles the visibility of the Killzone labels.
Display Killzones within Timeframes Up To: Toggles the visibility of the Killzones up to selected Timeframes.
Open Price, Separator, Label, and Color: toggles the visibility of the open price of the Killzones or for the day, week, or month. If the day, week, or month is selected, a separator will be displayed to highlight the beginning of each respective period. Additionally, users can customize the color and toggle the label as needed.
🔹 Order Blocks & Breaker Blocks
Order Blocks | Breaker Blocks: toggles the visibility of the order blocks & breaker blocks.
Swing Detection Length: lookback period used for the detection of the swing points used to create order blocks & breaker blocks.
Mitigation Price: allows users to select between closing price or wick of the candle.
Use Candle Body in Detection: allows users to use candle bodies as order block areas instead of the full candle range.
Remove Mitigated Order Blocks & Breaker Blocks: toggles the visibility of the mitigated order blocks & breaker blocks.
Extend Order Blocks & Breaker Blocks: enables processing of the order blocks & breaker blocks beyond the boundaries of the killzones.
Display Order Blocks & Breaker Blocks: enables the display of the first, last, or all occurrences of the order blocks & breaker blocks.
Order Blocks : Bullish, Bearish Color: color customization option for order blocks.
Breaker Blocks : Bullish, Bearish Color: color customization option for breaker blocks.
Show Order Blocks & Breaker Blocks Text: toggles the visibility of the order blocks & breaker blocks labels.
🔹 Market Structure Shifts
Market Structure Shifts: toggles the visibility of the market structure shifts.
Detection Length: market structure shift detection length.
Display Market Structure Shifts: enables the display of the first, last, or all occurrences of the market structure shifts.
Market Structure Shifts : Bullish, Bearish Color: color custumization option for market structure shifts.
Show Market Structure Shifts Text: toggles the visibility of the market structure shifts labels.
🔹 Fair Value Gaps
Fair Value Gaps: toggles the visibility of the fair value gaps.
Fair Value Gap Width Filter: filtering threshold wile detecting fair value gaps.
Remove Mitigated Fair Value Gaps: removes mitigated fair value gaps.
Extend Fair Value Gaps: enables processing of the fair value gaps beyond the boundaries of the killzones.
Display Fair Value Gaps: enables the display of the first, last, or all occurrences of the fair value gaps.
Bullish Imbalance Color: color customization option.
Bearish Imbalance Color: color customization option.
Show Fair Value Gaps Text: toggles the visibility of the fair value gaps labels.
🔶 RELATED SCRIPTS
Smart-Money-Concepts
Order-Blocks-Breaker-Blocks
Thanks to our community for recommending this script. For more conceptual scripts and related content, we welcome you to explore by visiting >>> LuxAlgo-Scripts .
lib_fvgLibrary "lib_fvg"
further expansion of my object oriented library toolkit. This lib detects Fair Value Gaps and returns them as objects.
Drawing them is a separate step so the lib can be used with securities. It also allows for usage of current/close price to detect fill/invalidation of a gap and to adjust the fill level dynamically. FVGs can be detected while forming and extended indefinitely while they're unfilled.
method draw(this)
Namespace types: FVG
Parameters:
this (FVG)
method draw(fvgs)
Namespace types: FVG
Parameters:
fvgs (FVG )
is_fvg(mode, precondition, filter_insignificant, filter_insignificant_atr_factor, live)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
precondition (bool) : allows for other confluences to block/enable detection
filter_insignificant (bool) : allows to ignore small gaps
filter_insignificant_atr_factor (float) : allows to adjust how small (compared to a 50 period ATR)
live (bool) : allows to detect FVGs while the third bar is forming -> will cause repainting
Returns: a tuple of (bar_index of gap bar, gap top, gap bottom)
create_fvg(mode, idx, top, btm, filled_at_pc, config)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
idx (int) : the bar_index of the FVG gap bar
top (float) : the top level of the FVG
btm (float) : the bottom level of the FVG
filled_at_pc (float) : the ratio (0-1) that the fill source needs to retrace into the gap to consider it filled/invalidated/ready for removal
config (FVGConfig) : the plot configuration/styles for the FVG
Returns: a new FVG object if there was a new FVG, else na
detect_fvg(mode, filled_at_pc, precondition, filter_insignificant, filter_insignificant_atr_factor, live, config)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
filled_at_pc (float)
precondition (bool) : allows for other confluences to block/enable detection
filter_insignificant (bool) : allows to ignore small gaps
filter_insignificant_atr_factor (float) : allows to adjust how small (compared to a 50 period ATR)
live (bool) : allows to detect FVGs while the third bar is forming -> will cause repainting
config (FVGConfig)
Returns: a new FVG object if there was a new FVG, else na
method update(this, fill_src)
Namespace types: FVG
Parameters:
this (FVG)
fill_src (float) : allows for usage of different fill source series, e.g. high for bearish FVGs, low vor bullish FVGs or close for both
method update(all, fill_src)
Namespace types: FVG
Parameters:
all (FVG )
fill_src (float)
method remove_filled(unfilled_fvgs)
Namespace types: FVG
Parameters:
unfilled_fvgs (FVG )
method delete(this)
Namespace types: FVG
Parameters:
this (FVG)
method delete_filled_fvgs_buffered(filled_fvgs, max_keep)
Namespace types: FVG
Parameters:
filled_fvgs (FVG )
max_keep (int) : the number of filled, latest FVGs to retain on the chart.
FVGConfig
Fields:
box_args (|robbatt/lib_plot_objects/36;BoxArgs|#OBJ)
line_args (|robbatt/lib_plot_objects/36;LineArgs|#OBJ)
box_show (series__bool)
line_show (series__bool)
keep_filled (series__bool)
extend (series__bool)
FVG
Fields:
config (|FVGConfig|#OBJ)
startbar (series__integer)
mode (series__integer)
top (series__float)
btm (series__float)
center (series__float)
size (series__float)
fill_size (series__float)
fill_lvl_target (series__float)
fill_lvl_current (series__float)
fillbar (series__integer)
filled (series__bool)
_fvg_box (|robbatt/lib_plot_objects/36;Box|#OBJ)
_fill_line (|robbatt/lib_plot_objects/36;Line|#OBJ)
lib_retracement_patternsLibrary "lib_retracement_patterns"
types and functions for XABCD pattern detection and plotting
method set_tolerances(this, tolerance_Bmin, tolerance_Bmax, tolerance_Cmin, tolerance_Cmax, tolerance_Dmin, tolerance_Dmax)
sets tolerances for B, C and D retracements. This creates another Pattern instance that is set as tolerances field on the original and will be used for detection instead of the original ratios.
Namespace types: Pattern
create_config(pattern_line_args, pattern_point_args, name_label_args, retracement_line_args, retracement_label_args, line_args_Dtarget, line_args_completion, line_args_tp1, line_args_tp2, line_args_sl, label_args_completion, label_args_tp1, label_args_tp2, label_args_sl, label_terminal, label_terminal_up_char, label_terminal_down_char, color_bull, color_bear, color_muted, fill_opacity, draw_point_labels, draw_retracements, draw_target_range, draw_levels, hide_shorter_if_shared_legs_greater_than_max, hide_engulfed_pattern, hide_engulfed_pattern_of_same_type, hide_longer_pattern_with_same_X, mute_previous_pattern_when_next_overlaps, keep_failed_patterns)
method direction(this)
Namespace types: Match
method length(this)
return the length of this pattern, determined by the distance between X and D point
Namespace types: Match
method height(this)
return the height of this pattern, determined by the distance between the biggest distance between A/C and X/D
Namespace types: Match
method is_forming(this)
returns true if not complete, not expired and not invalidated
Namespace types: Match
method tostring(this)
return a string representation of all Matches in this map
Namespace types: Match
method tostring(this)
Namespace types: map
remove_complete_and_expired(this)
method add(this, item)
Namespace types: map
method is_engulfed_by(this, other)
checks if this Match is engulfed by the other
Namespace types: Match
method update(tracking_matches, zigzag, patterns, max_age_idx, detect_dir, pattern_minlen, pattern_maxlen, max_sub_waves, max_shared_legs, max_XB_BD_ratio, debug_log)
checks this map of tracking Matches if any of them was completed or invalidated in
Namespace types: map
method mute(this, mute_color, mute_fill_color)
mute this pattern by making it all one color (lines and labels, for pattern fill there's another)
Namespace types: Match
method mute(this, mute_color, mute_fill_color)
mute all patterns in this map by making it all one color (lines and labels, for pattern fill there's another)
Namespace types: map
method hide(this)
hide this pattern by muting it with a transparent color
Namespace types: Match
method reset_styles(this)
reset the style of a muted or hidden match back to the preset configuration
Namespace types: Match
method delete(this)
remove the plot of this Match from the chart
Namespace types: Match
method delete(this)
remove all the plots of the Matches in this map from the chart
Namespace types: map
method draw(this)
draw this Match on the chart
Namespace types: Match
method draw(this, config, all_patterns, debug_log)
draw all Matches in this map, considering all other patterns for engulfing and overlapping
Namespace types: map
method check_hide_or_mute(this, all, config, debug_log)
checks if this pattern needs to be hidden or muted based on other plotted patterns and given configuration
Namespace types: Match
method add_if(id, item, condition)
convenience function to add a search pattern to a list, only if given condition (input.bool) is true
Namespace types: Pattern
Pattern
type to hold retracement ratios and tolerances for this pattern, as well as targets for trades
Config
allows control of pattern plotting shape and colors, as well as settings for hiding overlapped patterns etc.
Match
holds all information on a Pattern and a successful match in the chart. Includes XABCD pivot points as well as all Line and Label objects to draw it
lib_plot_composite_objectsLibrary "lib_plot_composite_objects"
library building on top of lib_plot_objects for composite objects such as Triangles and Polygons. heavily using chart.points
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle)
date_format (simple string)
method tostring(this, date_format)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon)
date_format (simple string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle )
date_format (simple string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon )
date_format (simple string)
method tostring(this, date_format)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
date_format (simple string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
date_format (simple string)
method create_triangle(this, b, c, args)
Namespace types: chart.point
Parameters:
this (chart.point)
b (chart.point)
c (chart.point)
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_triangle(this, c)
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/32)
c (chart.point)
method create_polygon(points, args)
Namespace types: chart.point
Parameters:
points (chart.point )
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_polygon(start, others, args)
Namespace types: chart.point
Parameters:
start (chart.point)
others (chart.point )
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_fill(this, fill_color)
Namespace types: Triangle
Parameters:
this (Triangle)
fill_color (color)
method create_fill(this, fill_color)
Namespace types: Polygon
Parameters:
this (Polygon)
fill_color (color)
method create_center_label(this, txt, args, tooltip)
Namespace types: Triangle
Parameters:
this (Triangle)
txt (string)
args (LabelArgs type from robbatt/lib_plot_objects/32)
tooltip (string)
method create_label(this, txt, args, tooltip)
Namespace types: Polygon
Parameters:
this (Polygon)
txt (string)
args (LabelArgs type from robbatt/lib_plot_objects/32)
tooltip (string)
method nz(this, default)
Namespace types: Triangle
Parameters:
this (Triangle)
default (Triangle)
method nz(this, default)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
default (TriangleFill)
method nz(this, default)
Namespace types: Polygon
Parameters:
this (Polygon)
default (Polygon)
method nz(this, default)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
default (PolygonFill)
method enqueue(id, item, max)
Namespace types: Triangle
Parameters:
id (Triangle )
item (Triangle)
max (int)
method enqueue(id, item, max)
Namespace types: Polygon
Parameters:
id (Polygon )
item (Polygon)
max (int)
method enqueue(id, item, max)
Namespace types: TriangleFill
Parameters:
id (TriangleFill )
item (TriangleFill)
max (int)
method enqueue(id, item, max)
Namespace types: PolygonFill
Parameters:
id (PolygonFill )
item (PolygonFill)
max (int)
method update(this, a, b, c)
Namespace types: Triangle
Parameters:
this (Triangle)
a (chart.point)
b (chart.point)
c (chart.point)
method update(this, points)
Namespace types: Polygon
Parameters:
this (Polygon)
points (chart.point )
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle)
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle )
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon )
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
method draw(this, ab_args_override, ac_args_override, bc_args_override)
Namespace types: Triangle
Parameters:
this (Triangle)
ab_args_override (LineArgs type from robbatt/lib_plot_objects/32)
ac_args_override (LineArgs type from robbatt/lib_plot_objects/32)
bc_args_override (LineArgs type from robbatt/lib_plot_objects/32)
method draw(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method draw(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method draw(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
method draw(this)
Namespace types: Triangle
Parameters:
this (Triangle )
method draw(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
method draw(this)
Namespace types: Polygon
Parameters:
this (Polygon )
method draw(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
method apply_style(this, args)
Namespace types: Triangle
Parameters:
this (Triangle)
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Polygon
Parameters:
this (Polygon)
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Triangle
Parameters:
this (Triangle )
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Polygon
Parameters:
this (Polygon )
args (LineArgs type from robbatt/lib_plot_objects/32)
Triangle
Fields:
a (chart.point) : first Corner
b (chart.point) : second Corner
c (chart.point) : third Corner
args (LineArgs type from robbatt/lib_plot_objects/32) : Wrapper for reusable arguments for line.new()
ab (Line type from robbatt/lib_plot_objects/32)
ac (Line type from robbatt/lib_plot_objects/32)
bc (Line type from robbatt/lib_plot_objects/32)
TriangleFill
Fields:
triangle (Triangle) : The Triangle object
plot (LineFill type from robbatt/lib_plot_objects/32) : The linefill object to be added and plotted via draw()
Polygon
Fields:
points (chart.point ) : array of points that make up the Polygon
center (chart.point) : Center point of the Polygon, can be used for a label and will be center for PolygonFill
args (LineArgs type from robbatt/lib_plot_objects/32) : Wrapper for reusable arguments for line.new()
plot (Line type from robbatt/lib_plot_objects/32) : An array of Lines that form Polygon Border
PolygonFill
Fields:
poly (Polygon) : the Polygon
fill_color (series color) : The color used to fill the space between the lines.
plot (TriangleFill )
lib_profileLibrary "lib_profile"
a library with functions to calculate a volume profile for either a set of candles within the current chart, or a single candle from its lower timeframe security data. All you need is to feed the
method delete(this)
deletes this bucket's plot from the chart
Namespace types: Bucket
Parameters:
this (Bucket)
method delete(this)
Namespace types: Profile
Parameters:
this (Profile)
method delete(this)
Namespace types: Bucket
Parameters:
this (Bucket )
method delete(this)
Namespace types: Profile
Parameters:
this (Profile )
method update(this, top, bottom, value, fraction)
updates this bucket's data
Namespace types: Bucket
Parameters:
this (Bucket)
top (float)
bottom (float)
value (float)
fraction (float)
method update(this, tops, bottoms, values)
update this Profile's data (recalculates the whole profile and applies the result to this object) TODO optimisation to calculate this incremental to improve performance in realtime on high resolution
Namespace types: Profile
Parameters:
this (Profile)
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
method tostring(this)
allows debug print of a bucket
Namespace types: Bucket
Parameters:
this (Bucket)
method draw(this, start_t, start_i, end_t, end_i, args, line_color)
allows drawing a line in a Profile, representing this bucket and it's value + it's value's fraction of the Profile total value
Namespace types: Bucket
Parameters:
this (Bucket)
start_t (int) : the time x coordinate of the line's left end (depends on the Profile box)
start_i (int) : the bar_index x coordinate of the line's left end (depends on the Profile box)
end_t (int) : the time x coordinate of the line's right end (depends on the Profile box)
end_i (int) : the bar_index x coordinate of the line's right end (depends on the Profile box)
args (LineArgs type from robbatt/lib_plot_objects/24) : the default arguments for the line style
line_color (color) : the color override for POC/VAH/VAL lines
method draw(this, forced_width)
draw all components of this Profile (Box, Background, Bucket lines, POC/VAH/VAL overlay levels and labels)
Namespace types: Profile
Parameters:
this (Profile)
forced_width (int) : allows to force width of the Profile Box, overrides the ProfileArgs.default_size and ProfileArgs.extend arguments (default: na)
method init(this)
Namespace types: ProfileArgs
Parameters:
this (ProfileArgs)
method init(this)
Namespace types: Profile
Parameters:
this (Profile)
profile(tops, bottoms, values, resolution, vah_pc, val_pc, bucket_buffer)
split a chart/parent bar into 'resolution' sections, figure out in which section the most volume/time was spent, by analysing a given set of (intra)bars' top/bottom/volume values. Then return price center of the bin with the highest volume, essentially marking the point of control / highest volume (poc) in the chart/parent bar.
Parameters:
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
resolution (int) : amount of buckets/price ranges to sort the candle data into (analyse how much volume / time was spent in a certain bucket/price range) (default: 25)
vah_pc (float) : a threshold percentage (of values' total) for the top end of the value area (default: 80)
val_pc (float) : a threshold percentage (of values' total) for the bottom end of the value area (default: 20)
bucket_buffer (Bucket ) : optional buffer of empty Buckets to fill, if omitted a new one is created and returned. The buffer length must match the resolution
Returns: poc (price level), vah (price level), val (price level), poc_index (idx in buckets), vah_index (idx in buckets), val_index (idx in buckets), buckets (filled buffer or new)
create_profile(start_idx, tops, bottoms, values, resolution, vah_pc, val_pc, args)
split a chart/parent bar into 'resolution' sections, figure out in which section the most volume/time was spent, by analysing a given set of (intra)bars' top/bottom/volume values. Then return price center of the bin with the highest volume, essentially marking the point of control / highest volume (poc) in the chart/parent bar.
Parameters:
start_idx (int) : the bar_index at which the Profile should start drawing
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
resolution (int) : amount of buckets/price ranges to sort the candle data into (analyse how much volume / time was spent in a certain bucket/price range) (default: 25)
vah_pc (float) : a threshold percentage (of values' total) for the top end of the value area (default: 80)
val_pc (float) : a threshold percentage (of values' total) for the bottom end of the value area (default: 20)
args (ProfileArgs)
Returns: poc (price level), vah (price level), val (price level), poc_index (idx in buckets), vah_index (idx in buckets), val_index (idx in buckets), buckets (filled buffer or new)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (int)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (float)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (bool)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (string)
len (int)
offset (int)
Bucket
Fields:
idx (series int) : the index of this Bucket within the Profile starting with 0 for the lowest Bucket at the bottom of the Profile
value (series float) : the value of this Bucket, can be volume or time, for using time pass and array of 1s to the update function
top (series float) : the top of this Bucket's price range (for calculation)
btm (series float) : the bottom of this Bucket's price range (for calculation)
center (series float) : the center of this Bucket's price range (for plotting)
fraction (series float) : the fraction this Bucket's value is compared to the total of the Profile
plot_bucket_line (Line type from robbatt/lib_plot_objects/24) : the line that resembles this bucket and it's valeu in the Profile
ProfileArgs
Fields:
show_poc (series bool) : whether to plot a POC line across the Profile Box (default: true)
show_profile (series bool) : whether to plot a line for each Bucket in the Profile Box, indicating the value per Bucket (Price range), e.g. volume that occured in a certain time and price range (default: false)
show_va (series bool) : whether to plot a VAH/VAL line across the Profile Box (default: false)
show_va_fill (series bool) : whether to fill the 'value' area between VAH/VAL line (default: false)
show_background (series bool) : whether to fill the Profile Box with a background color (default: false)
show_labels (series bool) : whether to add labels to the right end of the POC/VAH/VAL line (default: false)
show_price_levels (series bool) : whether add price values to the labels to the right end of the POC/VAH/VAL line (default: false)
extend (series bool) : whether extend the Profile Box to the current candle (default: false)
default_size (series int) : the default min. width of the Profile Box (default: 30)
args_poc_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the poc line plot
args_va_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the va line plot
args_poc_label (LabelArgs type from robbatt/lib_plot_objects/24) : arguments for the poc label plot
args_va_label (LabelArgs type from robbatt/lib_plot_objects/24) : arguments for the va label plot
args_profile_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the Bucket line plots
args_profile_bg (BoxArgs type from robbatt/lib_plot_objects/24)
va_fill_color (series color) : color for the va area fill plot
Profile
Fields:
start (series int) : left x coordinate for the Profile Box
end (series int) : right x coordinate for the Profile Box
resolution (series int) : the amount of buckets/price ranges the Profile will dissect the data into
vah_threshold_pc (series float) : the percentage of the total data value to mark the upper threshold for the main value area
val_threshold_pc (series float) : the percentage of the total data value to mark the lower threshold for the main value area
args (ProfileArgs) : the style arguments for the Profile Box
h (series float) : the highest price of the data
l (series float) : the lowest price of the data
total (series float) : the total data value (e.g. volume of all candles, or just one each to analyse candle distribution over time)
buckets (Bucket ) : the Bucket objects holding the data for each price range bucket
poc_bucket_index (series int) : the Bucket index in buckets, that holds the poc Bucket
vah_bucket_index (series int) : the Bucket index in buckets, that holds the vah Bucket
val_bucket_index (series int) : the Bucket index in buckets, that holds the val Bucket
poc (series float) : the according price level marking the Point Of Control
vah (series float) : the according price level marking the Value Area High
val (series float) : the according price level marking the Value Area Low
plot_poc (Line type from robbatt/lib_plot_objects/24)
plot_vah (Line type from robbatt/lib_plot_objects/24)
plot_val (Line type from robbatt/lib_plot_objects/24)
plot_poc_label (Label type from robbatt/lib_plot_objects/24)
plot_vah_label (Label type from robbatt/lib_plot_objects/24)
plot_val_label (Label type from robbatt/lib_plot_objects/24)
plot_va_fill (LineFill type from robbatt/lib_plot_objects/24)
plot_profile_bg (Box type from robbatt/lib_plot_objects/24)
lib_retracement_labelLibrary "lib_retracement_label"
creates a retracement label between the origin and target of a retracement, updating it's position (via update + draw) when the target moves.
create_tooltip(name, min, max, tol_min, tol_max)
Parameters:
name (string)
min (float)
max (float)
tol_min (float)
tol_max (float)
method update(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method create_retracement_label(this, move_endpoint, args, tooltip)
Creates a new RetracementLabel object.
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/23)
move_endpoint (Point type from robbatt/lib_plot_objects/23)
args (LabelArgs type from robbatt/lib_plot_objects/23)
tooltip (string)
method create_retracement_label(this, move_end, args, tooltip)
Creates a new RetracementLabel object.
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/23)
move_end (Pivot type from robbatt/lib_pivot/43)
args (LabelArgs type from robbatt/lib_plot_objects/23)
tooltip (string)
method enqueue(id, item, max)
Namespace types: RetracementLabel
Parameters:
id (RetracementLabel )
item (RetracementLabel)
max (int)
method draw(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method draw(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel )
method delete(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method delete(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel )
RetracementLabel
Fields:
move_endpoint (|robbatt/lib_plot_objects/23;Point|#OBJ)
center_label (|robbatt/lib_plot_objects/23;CenterLabel|#OBJ)
lib_zigLibrary "lib_zig"
Object oriented implementation of ZigZag
method tostring(this, date_format)
Namespace types: Zigzag
Parameters:
this (Zigzag)
date_format (simple string)
method update(this)
Namespace types: Zigzag
Parameters:
this (Zigzag)
method draw(this, colors)
Namespace types: Zigzag
Parameters:
this (Zigzag)
colors (PivotColors type from robbatt/lib_pivot/19)
Zigzag
Fields:
max_pivots (series__integer)
hldata (|robbatt/lib_pivot/19;HLData|#OBJ)
pivots (array__|robbatt/lib_pivot/19;Pivot|#OBJ)
lib_pivotLibrary "lib_pivot"
Object oriented implementation of Pivot methods.
method tostring(this)
Converts HLData to a json string representation
Namespace types: HLData
Parameters:
this (HLData) : HLData
Returns: string representation of Pivot
method tostring(this, date_format)
Namespace types: Pivot
Parameters:
this (Pivot)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Pivot
Parameters:
this (Pivot )
date_format (simple string)
method get_color(this, mode)
Namespace types: PivotColors
Parameters:
this (PivotColors)
mode (int)
method get_label_text(this)
Namespace types: Pivot
Parameters:
this (Pivot)
method direction(this)
Namespace types: Pivot
Parameters:
this (Pivot)
method same_direction_as(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method exceeds(this, price)
Namespace types: Pivot
Parameters:
this (Pivot)
price (float)
method exceeds(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method exceeded_by(this, price)
Namespace types: Pivot
Parameters:
this (Pivot)
price (float)
method exceeded_by(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method retracement_ratio(this, lastPivot, sec_lastPivot)
Namespace types: Pivot
Parameters:
this (Pivot)
lastPivot (Pivot)
sec_lastPivot (Pivot)
ratio_target(sec_lastPivot, lastPivot, target_ratio)
Parameters:
sec_lastPivot (Pivot)
lastPivot (Pivot)
target_ratio (float)
method update(this, ref_highest, ref_lowest)
Namespace types: HLData
Parameters:
this (HLData)
ref_highest (float)
ref_lowest (float)
method update(this, bar_time, bar_idx, price, prev)
Namespace types: Pivot
Parameters:
this (Pivot)
bar_time (int)
bar_idx (int)
price (float)
prev (Pivot)
method create_next(this, bar_time, bar_idx, price)
Namespace types: Pivot
Parameters:
this (Pivot)
bar_time (int)
bar_idx (int)
price (float)
HLData
HLData wraps the data received from ta.highest, ta.highestbars, ta.lowest, ta.lowestbars, as well as the reference sources
Fields:
length (series int) : lookback length for pivot points
highest_offset (series int) : offset to highest value bar
lowest_offset (series int) : offset to lowest value bar
highest (series float) : highest value within lookback bars
lowest (series float) : lowest value within lookback bars
new_highest (series bool) : update() will set this true if the current candle forms a new highest high at the last (current) bar of set period (length)
new_lowest (series bool) : update() will set this true if the current candle forms a new lowest low at the last (current) bar of set period (length)
new_highest_fractal (series bool) : update() will set this true if the current candle forms a new fractal high at the center of set period (length)
new_lowest_fractal (series bool) : update() will set this true if the current candle forms a new fractal low at the center of set period (length)
PivotColors
Pivot colors for different modes
Fields:
hh (series color) : Color for Pivot mode 2 (HH)
lh (series color) : Color for Pivot mode 1 (LH)
hl (series color) : Color for Pivot mode -1 (HL)
ll (series color) : Color for Pivot mode -2 (LL)
Pivot
Pivot additional pivot data around basic Point
Fields:
point (Point type from robbatt/lib_plot_objects/5)
mode (series int) : can be -2/-1/1/2 for LL/HL/LH/HH
price_movement (series float) : The price difference between this and the previous pivot point in the opposite direction
retracement_ratio (series float) : The ratio between this price_movement and the previous
prev (Pivot)
lib_drawing_composite_typesLibrary "lib_drawing_composite_types"
User Defined Types for basic drawing structure. Other types and methods will be built on these. (added type Triangle and Polygon to )
TriangleProperties
TriangleProperties object
Fields:
border_color (series color) : Box border color. Default is color.blue
fill_color (series color) : Fill color
fill_transparency (series int)
border_width (series int) : Box border width. Default is 1
border_style (series string) : Box border style. Default is line.style_solid
xloc (series string) : defines if drawing needs to be done based on bar index or time. default is xloc.bar_index
Triangle
Triangle object
Fields:
p1 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : point one
p2 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : point two
p3 (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : point three
properties (TriangleProperties) : Triangle properties
l12 (series line) : line object created
l23 (series line) : line object created
l31 (series line) : line object created
Trianglefill
Trianglefill object
Fields:
triangle (Triangle) : to create a linefill for
fill_color (series color) : Fill color
transparency (series int) : Fill transparency range from 0 to 100
object (series linefill) : linefill object created
Polygon
Polygon object
Fields:
center (Point type from HeWhoMustNotBeNamed/DrawingTypes/2) : Point that triangles are using as common center
triangles (Triangle ) : an array of triangles that form the Polygon
Polygonfill
Polygonfill object
Fields:
_polygon (Polygon) : to create a fill for
_fills (Trianglefill ) : an array of Trianglefill objects that match the array of triangles in _polygon
lib_priceactionLibrary "lib_priceaction"
a library for everything related to price action, starting off with displacements
displacement(len, min_strength, o, c)
calculate if there is a displacement and how strong it is
Parameters:
len (int) : The amount of candles to consider for the deviation
min_strength (float) : The minimum displacement strength to trigger a signal
o (float) : The source series on which calculations are based
c (float) : The source series on which calculations are based
Returns: a tuple of (bool signal, float displacement_strength)
lib_statemachineLibrary "lib_statemachine"
simple state machine that allows tracking a state an manipulating it with conditions
method step(this, before, after, condition)
will step the state of the state machine from one to the next in case of condition
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
before (int) : (int) from state
after (int) : (int) to state
condition (bool) : (bool) if condition is true
Returns: true (bool) if the state of the statemachine changed
method step(this, after, condition)
will change the state of the state machine to the next in case of condition (not depending on previous state)
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
after (int) : (int) to state
condition (bool) : (bool) if condition is true
Returns: true (bool) if the state of the statemachine changed
method changed(this, within_bars)
will return true if the state of the state machine was changed in this iteration
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
within_bars (int)
Returns: true (bool) if the state of the statemachine changed
method reset(this, condition, min_occurrences)
will reset the state machine if a certain 'condition' appears 'min_occurrences' times
Namespace types: StateMachine
Parameters:
this (StateMachine) : (StateMachine) the state machine to use
condition (bool) : (bool) reset condition
min_occurrences (int) : (int) min times 'condition' must appear for the reset to happen
Returns: true (bool) if the state of the statemachine changed
StateMachine
Fields:
state (series__integer)
neutral (series__integer)
enabled (series__bool)
reset_counter (series__integer)
lib_colorLibrary "lib_color"
offset_mono(original, offset, transparency)
get offset color
Parameters:
original (simple color) : original color
offset (float) : offset for new color
transparency (float) : transparency for new color
Returns: offset color
lib_colorsLibrary "lib_colors"
offset_mono(original, offset, transparency)
get offset color
Parameters:
original (simple color) : original color
offset (float) : offset for new color
transparency (float) : transparency for new color
Returns: offset color
lib_arrayLibrary "lib_array"
several array functions for chained calls, batch conversion, incrementing and comparing arrays.
method sort(id, descending)
Namespace types: int
Parameters:
id (int ) : The array to sort (and return again)
descending (bool) : The sort order: order.ascending (default:false, meaning omit this param and just call myArray.sort()) or order.descending => set descending=true
@return The array that was passed as parameter id
method sort(id, descending)
Namespace types: float
Parameters:
id (float ) : The array to sort (and return again)
descending (bool) : The sort order: order.ascending (default:false, meaning omit this param and just call myArray.sort()) or order.descending => set descending=true
@return The array that was passed as parameter id
method sort(id, descending)
Namespace types: string
Parameters:
id (string ) : The array to sort (and return again)
descending (bool) : The sort order: order.ascending (default:false, meaning omit this param and just call myArray.sort()) or order.descending => set descending=true
@return The array that was passed as parameter id
method increment(id, by_value)
Namespace types: int
Parameters:
id (int ) : The array to increment (and return again)
by_value (int) : The value by which to increment (default: 1)
@return The array that was passed as parameter id
method increment(id, by_value)
Namespace types: float
Parameters:
id (float ) : The array to increment (and return again)
by_value (float) : The value by which to increment (default: 1.0)
@return The array that was passed as parameter id
method decrement(id, by_value)
Namespace types: int
Parameters:
id (int ) : The array to increment (and return again)
by_value (int) : The value by which to increment (default: 1)
@return The array that was passed as parameter id
method decrement(id, by_value)
Namespace types: float
Parameters:
id (float ) : The array to increment (and return again)
by_value (float) : The value by which to increment (default: 1.0)
@return The array that was passed as parameter id
method toint(id)
Namespace types: string
Parameters:
id (string ) : The array to convert
method toint(id)
Namespace types: float
Parameters:
id (float ) : The array to convert
method tofloat(id)
Namespace types: string
Parameters:
id (string ) : The array to convert
method tofloat(id)
Namespace types: int
Parameters:
id (int ) : The array to convert
method tostring(id)
Namespace types: int
Parameters:
id (int ) : The array to convert
method tostring(id)
Namespace types: float
Parameters:
id (float ) : The array to convert
method tobool(id)
Namespace types: float
Parameters:
id (float ) : The array to convert
method tobool(id)
Namespace types: int
Parameters:
id (int ) : The array to convert
method tobool(id)
Namespace types: string
Parameters:
id (string ) : The array to convert
method sum(id)
Namespace types: bool
Parameters:
id (bool ) : The array to convert
method enqueue(id, item, max, condition, lifo)
Namespace types: int
Parameters:
id (int ) : The array that is used as queue
item (int) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: float
Parameters:
id (float ) : The array that is used as queue
item (float) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: string
Parameters:
id (string ) : The array that is used as queue
item (string) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: line
Parameters:
id (line ) : The array that is used as queue
item (line) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
method enqueue(id, item, max, condition, lifo)
Namespace types: box
Parameters:
id (box ) : The array that is used as queue
item (box) : The item to enqueue (at pos 0, unless lifo = true)
max (int) : The max size of the queue
condition (bool) : An optional flag that allows disabling the adding, which in turn will prevent for in loops from ever running and save performance where not needed
lifo (bool) : An optional flag that allows to change the behavior from First In Last Out (default and consistent with pine scripts history operator with most recent elements at index 0) to a more common and resource efficient approach in programming languages: Last In First Out
Returns: The queue passed as param id
Reversal Signals [LuxAlgo]The Reversal Signals indicator is a technical analysis tool that aims to identify when a trend is fading and potentially starting to reverse.
As a counter-trend tool, the Reversal Signals indicator aims to solve the problem of several technical analysis indicators that perform well during trending markets but struggle in ranging markets. By understanding the key concepts and applications of the tool, traders can enhance their market timing and improve their trading strategies.
Note: It's important to explore the settings of the indicator to customize to your own usage & display as there are various options available as covered below.
🔶 USAGE
The Reversal Signals indicator is comprised of two main phases: Momentum Phase and Trend Exhaustion Phase . These phases help identify potential trend reversals in bullish, bearish, and ranging markets.
🔹The Momentum Phase
The momentum phase consists of a 9-candle count and in rare cases 8-candle count. In a bullish trend, a starting number ‘1’ is plotted if a candle closes higher than the close of a candle four periods ago. In a bearish trend, a starting number ‘1’ is plotted if a candle closes lower than the close of a candle four periods ago.
The following numbers are plotted when each successive candle satisfies the four-period rule. The potential reversal point comes when the Reversal Signals plot a label on top of a candle in a bullish trend or at the bottom of a candle in a bearish trend. The momentum phase is immediately canceled if, at any point, a candle fails to satisfy the four-period rule.
Based on the extremes of the momentum phase, the Reversal Signals generate support & resistance levels as well as risk/stop levels.
🔹 The Trend Exhaustion Phase
The trend exhaustion phase starts after completing the momentum phase and consists of a 13-candle count. In a bullish trend exhaustion phase, each candle’s close is compared to the close of two candles earlier, and the close must be greater than the close two periods earlier. In a bearish trend exhaustion phase, each candle’s close is compared to the close of two candles earlier, and the close must be lower than the close two periods earlier.
The trend exhaustion phase does not require a consecutive sequence of candles; if the order of candles is interrupted, the trend exhaustion phase is not canceled. The trend exhaustion phase generates stronger trading signals than the momentum phase, with the potential for longer-lasting price reversals.
🔹 Trading Signals
The Reversal Signals script presents an overall setup and some phase-specific trade setup options, where probable trades might be considered. All phase-specific trade setups, presented as options, are triggered once the selected phase is completed and followed by a price flip in the direction of the trade setup.
Please note that those setups are presented for educational purposes only and do not constitutes professional and/or financial advice
- Momentum: Enter a trade at momentum phase completion, and search for buy (sell) when the bullish (bearish) momentum phase pattern is complete. Ideally, the momentum phase completion should close near its support/resistance line but shall not be above them, which indicates continuation of the trend
- Exhaustion: Enter a trade on trend exhaustion phase completion, and search for buy (sell) when the bullish (bearish) trend exhaustion phase is complete
- Qualified: Buy (sell) when a bullish (bearish) trend exhaustion phase combined with another bullish (bearish) momentum phase sequence is complete
Long trade setups are presented with "L" label and short trade setups with "S" label, where the content of the label displays details related to the probable trade opportunity
Once a phase-specific trade setup is triggered then the Reversal Signals script keeps checking the status of the price action relative to the phase-specific trade setups and in case something goes wrong presents a caution label. Pay attention to the content of the caution labels as well as where they appear. A trade signal, followed immediately by a warning indication can be assumed as a continuation of the underlying trend and can be traded in the opposite direction of the suggested signal
It is strongly advised to confirm trading setups in conjunction with other forms of technical and fundamental analysis, including technical indicators, chart/candlestick pattern analysis, etc.
🔶 DETAILS
The Reversal Signals script performs the detection of the phases by counting the candlestick meeting the specific conditions, which includes:
- Detection of the 8th and 9th candle perfection during the momentum phase
- In some cases, the 8th count will be assumed as momentum phase completion
- Trend exhaustion phase counting stops in case any type of momentum phase completion is detected during the counting process
- Postponing the last count of the trend exhaustion phase, the 13th candle must be below/above the 8th candle and if not the candles will be indicated with '+' sign under them and the script continues to search for a 13th candle at the next ones until the conditions are met
🔶 ALERTS
When an alert is configured, the user will have the ability to be notified in case;
Momentum / Trend Exhaustion phase completion
Support & Resistance level cross detection
Stop / Risk level cross detection
Long / Short Trade Setups are triggered
Please note, alerts are available with 'any alert() function call' and the alerts will be received only for the features that are enabled during alert configuration
🔶 SETTINGS
🔹 Momentum Phase
Display Phases: displays the momentum phases, where the Completed option allows the display of only completed momentum phases. The detailed option allows the display of the entire process of the momentum phase processes
Support & Resistance Levels: Toggles the visibility of the Support & Resistance Levels and Line Styling options
Momentum Phase Risk Levels: Toggles the visibility of the momentum phase Stop/Risk Levels and Line Styling options
For color options please refer to the options available under the style tab
🔹 Trend Exhaustion Phase
Display Phases: displays the trend exhaustion phases, where the Completed option allows the display of only completed trend exhaustion phases. The detailed option allows the display of the entire process of the trend exhaustion phase processes
Trend Exhaustion Phase Risk Levels: Toggles the visibility of the trend exhaustion phase Stop/Risk Levels
Trend Exhaustion Phase Target Levels: Toggles the visibility of the trend exhaustion phase Target Levels
For color options please refer to the options available under the style tab
🔹 Trade Setups
Overall Trend Direction & Trade Setup: displays the overall trend and probable trade setup levels, the users should search for a price flip and confirm with other means of technical and fundamental analysis for the trade setups once the label is plotted
Phase-Specific Trade Setup Options
Momentum: Searches for a trade setup after momentum phase completion
Exhaustion: Searches for a trade setup after trend exhaustion phase completion, stronger trend reversal possibility compared to momentum phase setup
Qualified: Searches for a trade setup after the trend exhaustion phase followed by a momentum phase completion
None: No trade setups are presented
Price Flips against the Phase Specific Trade Setups: enables checking the price action relative to the phase-specific trade setups
🔶 RELATED SCRIPTS
Here are the scripts that may add additional insight during potential trading decisions.
Buyside-Sellside-Liquidity
Support-Resistance-Classification
Motion▮ FEATURES
Now as library version :)
String-based transition-effects
Performance optimization. Reduced memory consumption up to >90% by kicking the output to the "stdout".
Use marquee- or loader-effect on any possible string location.
Example: UI Price-Ticker
----------------------------------------------------------------------------
Library "Motion"
_getStringMono(_len, _str, _sep)
Parameters:
_len
_str
_sep
marquee(this, _extern, _ws, _subLen, _subStart)
Parameters:
this
_extern
_ws
_subLen
_subStart
transition(this, _subLen, _subStart)
Parameters:
this
_subLen
_subStart
hold(this)
Parameters:
this
keyframe
keyframe A keyframe object.
Fields:
seq
intv
step
length
update_no
frame_no
ltr
hold
[TEMPLATE] Code Block Comments█ OVERVIEW
Here I present to the community at large a collection of code comment blocks that I think will be useful, especially for larger script projects bordering on 2,000 lines or above of code.
█ PLANNED FUTURE UPDATES
Work with the community to expand this template to be even more useful with the inclusion of useful global colour sets, variables, tooltips, groups, etc.
better script thumbnail.
full-screen table or label outlining the script's use-cases.
Fibonacci Toolkit [LuxAlgo]This toolkit aims to display multiple Fibonacci drawing tools including retracements, arcs, circles, fans, timezones and spirals.
Usage
Upon adding the indicator to the chart, users will be prompted to choose a starting point and an ending point for the calculation of the drawing tools.
Users can then navigate to the settings of the toolkit and choose which drawing tool to display using the Fibonacci drop-down menu. Users are also free to change the default Fibonacci ratios used by the indicator from within the settings. Each tool is described below.
Retracements
Fibonacci retracements display multiple levels constructed using the starting price point, ending price point, and multiple Fibonacci ratios. These levels can be used as support and resistance.
Arcs
Fibonacci arcs display multiple semi-circles. Each semi-circle crosses the line connecting the starting & end price point at a certain percentage determined by Fibonacci ratios. These arcs can be used as support and resistance.
Circles
The Fibonacci circles are similar to the Fibonacci arcs but display a full circle instead. Users can expect the price to bounce off of the circles.
This tool is less commonly used by traders.
Fan
A Fibonacci fan is a tool displaying trendlines all connected to a starting point and extending to a point determined by Fibonacci ratios. These can also be used as support and resistance.
Timezone
Fibonacci timezones return a series of horizontal lines. The distance of the lines increases by a factor given by the numbers in the Fibonacci sequence.
This tool can be useful to highlight points where a trend might reverse assuming that their duration increases over time.
Spiral
The Fibonnaci spiral displays a spiral that grows by a factor given by the golden ratio. This indicator returns a spiral using 7 turns (5 internal) and sets the origin of the spiral to the ending point which is selected by the user. The height of the spiral is based on the price range between the starting point and ending point.
Note that potential display artifacts can be seen when fitting the spiral on stocks and forex pairs.