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 )
Points
MATHR3E LINES█ OVERVIEW
MATHR3E LINES automatically draws Demand lines and Supply lines with their associated targets
█ CONCEPTS
Disclaimer:
MATHR3E LINES indicator is intended for advanced traders and may fit your profile, whether you are a day trader or a long-term investor.
It was originally developed by a renowned market analyst and documented in numerous books. Among them is the author Jason Perl.
It is recommended to have read the trading techniques mentioned in the books covering this indicator beforehand.
How to use:
The indicator draws Demand lines and Supply lines with their associated targets.
These lines connect pivot points which are:
- Lows surrounded on either side by higher lows
- Highs surrounded on either side by lower highs.
The key to drawing trend lines objectively is to select the right pivot points. Their significance is determined by the number of surrounding highs and lows.
By default, these are set to 1 since they are more sensitive to price action than higher level pivot points, and therefore provide an earlier breakout signal.
Another approach suggests that the most significant points to connect are those whose levels coincide with trend reversals.
Once you have chosen a demand line, there are 3 conditions that must be met for the trend line to be used.
As far as one or more of the conditions is met, a break of the intrabar trendline is expected, and a closing violation above the breakout level is likely.
Qualifiers
• Qualifier #1: Reverse Break
• Qualifier #2: Gap Break
• Qualifier #3: Pressure Break
In turn, a confirmed breakout entry may be invalidated the following bar, if any of the disqualifying conditions occur:
Disqualifiers
• Open Failure
• Close Failure
• H/L Failure
█ FEATURES & BENEFITS
Versatile:
This indicator can be applied to any market or time frame.
The methodology is equally relevant whether you are day trading or position trading.
Breakout confirmation:
• If a breakout is confirmed, its associated lines will turn solid.
• Otherwise, for invalidated breakouts or broken trendlines , they will remain dashed
Alerts
Get notified on:
•Demand/Supply Line Confirmed Breaks
•Demand/Supply Invalidated Breaks
•Demand/Supply Target Reached
Support & Resistance Trendlines with PP + Fib. Channel█ Support & Resistance Trendlines with Pivot Points + Fibonacci Channel
This script automatically draw support and resistance trend lines based on pivot points and add a fibonacci channel.
It will show potential patterns with the help of support and resistance lines as well as breakout target and pullback entry with the fibonacci extension and retracement levels.
It is based on atolelole's script, I only made it more configurable so please check out his script.
I added the possibility to change values and add additional retracement and extension levels.
I also made it customizable with the possibility to change lines color, width and style.
MapMap - an indicator that shows the highest and lowest points on the price movement road.
The calculation is based on the type of price data specified in the "Source" parameter and the length of the time interval specified in the "Length" parameter.
The indicator helps to visually find a local trend and rebound points.
Thanks for your attention!
Unraided Liquidity and S/R PivotsThis indicator is designed to show key pivot points, also known as levels, which could provide good trade entries.
Utilising liquidity concepts, untested pivot levels can be a good place to enter a trade after the pivot is tested, liquidity is taken and the direction reverses.
Alternatively, utilising the option of viewing already tested levels, you can easily see the key support and resistance areas that price is likely to have a strong reaction to, whether it wants to go toward or bounce away from these levels.
The indicator does not give buy and sell signals, it is up to you to use the levels to form your trading plan.
Oorah.
Pivot Order Blocks// How it Works \\
Order Blocks based on pivot reversal candle
When a pivot High or Pivot Low is found and confirmed, a box will be plotted on the open and close values of that pivot candle
// Settings \\
In the settings you have the ability to change the distances required to confirm an pivot High or Low
These are the lengths where the script checks to see if it is at its local high or low.
You also have the ability to change the amount of candles the box stretches over as well as the colors of the bullish and bearish boxes
// Use Case \\
Pivot points often provide Support and Resistance points on their own,
one way of marking up order blocks is by taking the pivot candle and marking that up as a resistance area where you could be looking for price to reverse
// Suggestions \\
Happy for anyone to make any suggestions on changes which could improve the script,
// Terms \\
Feel free to use the script, If you do use the script could you please just tag me as I am interested to see how people are using it. Good Luck!
PointsLibrary "Points"
Provides functions for simplifying operations with collections of x+y coordinates. Where x is typically a bar index or time (millisecond) value.
new(size) Creates two arrays. One for X (int ) and another for Y (float ).
Parameters:
size : The initial size of the arrays.
size(xA, yA) Checks the size of the arrays and if they're equal returns the size.
Parameters:
xA : The X array.
yA : The Y array.
get(xA, yA, index) Gets the X and Y values of the arrays at the index.
Parameters:
xA : The X array.
yA : The Y array.
index : The index.
Returns:
set(xA, yA, index, x, y) Sets the X and Y values of the arrays at the index.
Parameters:
xA : The X array.
yA : The Y array.
index : The index.
x : The x value.
y : The y value.
Returns:
push(xA, yA, x, y) Adds X and Y values to the end of the arrays (as the last element).
Parameters:
xA : The X array.
yA : The Y array.
x : The x value.
y : The y value.
Returns:
unshift(xA, yA, x, y) Adds X and Y values to the beginning of the arrays (as the first element).
Parameters:
xA : The X array.
yA : The Y array.
x : The x value.
y : The y value.
Returns:
insert(xA, yA, index, x, y) Inserts X and Y values to the arrays at the index.
Parameters:
xA : The X array.
yA : The Y array.
index : The index to insert at.
x : The x value.
y : The y value.
Returns:
pop(xA, yA) Removes the last element from the arrays and returns their value.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
shift(xA, yA) Removes the first element from the arrays and returns their value.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
remove(xA, yA) Removes the element from the arrays at the index and returns their value.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
first(xA, yA) Gets the X and Y values of the first element.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
last(xA, yA) Gets the X and Y values of the last element.
Parameters:
xA : The X array.
yA : The Y array.
Returns:
allIndexesBetween(xA, lo, hi, start, ordered) Gets the indexes that have values at or above the low value and below the high value.
Parameters:
xA : The X array.
lo : The inclusive low value.
hi : The excluded hi value.
start : The optional index to start the backwards search.
ordered : If true, the search ends when the first value is found that is less than the low.
lastIndexBetween(xA, lo, hi, start, ordered) Gets the first found from the end that has a value at or above the low value and below the high value.
Parameters:
xA : The X array.
lo : The inclusive low value.
hi : The excluded hi value.
start : The optional index to start the backwards search.
ordered : If true, the search ends when the first value is found that is less than the low.
lastIndexBelow(xA, hi, start) Gets the first found from the end that has a value below the high value.
Parameters:
xA : The X array.
hi : The excluded hi value.
start : The optional index to start the backwards search.
Pivot Points High Low MTF [Anan]█ OVERVIEW
Pivot Points High Low with Multi Time Frames support and bull/bear signal depends on pivot average
█ FEATURES
- Fully control of pivot (Source / Length Left / Length Right)
- Show HH, LL, LH, HL price on candles
- Show Avg Pivot High Low.
- Show Bull/Bear Labels.
- Control of signal accuracy (default: 0.5%)
- Show Pivot High Low Levels as a Fractal Chaos Channel.
- Multi-timeframe Table with support of Pivot High Low and pivot Average.
- BreakOut and BreakDown Labels in the table.
- Full control of displaying any row or any column.
- Full control of Table position and Size and Colors.
Logging in Pine ScriptI'm building quite a lot of pretty complicated indicators/strategies in Pine Script. Quite often they don't work from the 1 try so I have to debug them heavily.
In Pine Script there are no fancy debuggers so you have to be creative. You can plot values on your screens, check them in the data window, etc.
If you want to display some textual information, you can plot some info as labels on the screen.
It's not the most convenient way, so with the appearance of tables in Pine Script, I decided to implement a custom logger that will allow me to track some useful information about my indicator over time.
Tables work much better for this kind of thing than labels. They're attached to your screen, you can nicely scale them and you can style them much better.
The idea behind it is very simple. I used few arrays to store the message, bar number, timestamp, and type of the message (you can color messages depend on the type for example).
There is a function log_msg that just append new messages to these arrays.
In the end, for the last bar, I create the table and display the last X messages in it.
In parameters, you can show/hide the entire journal, change the number of messages displayed and choose an offset. With offset, you can basically scroll through the history of messages.
Currently, I implemented 3 types of messages, and I color messages according to these types:
Message - gray
Warning - yellow
Error - red
Of course, it's a pretty simple example, you can create a much fancier way of styling your logs.
What do you think about it? Is it useful for you? What do you use to debug code in Pine Script?
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as good as in historical backtesting.
This post and the script don’t provide any financial advice.
Percentage Or Point Bar CalculatorHello Everyone This Indicator Base on Bar (Candle)
How to work its indicator?
➤This indicator calculating Every Bar Percentage Or Point with any Time Frame For eg: if you want to 50 Percentage above or below bar
Indicator Feature
➤ Long Signal with Alert
➤ Short Signal with Alert
➤ You can add Custom Point
➤ You can add Custom Percentage
Coming soon Feature
Take Profit
Stop Lose
Trailing Stoplose
Important: This Indicator we are using for Automation Trading if You Want This Indicator Access, Please Contact me PM on Tradingview
Pocket PivotPockets Pivot were introduced by Gil Morales and Chris Katcher in the book "Trading like an O'Neil Disciple",
Pocket Pivot day occurs when the Volume has been higher than any down day 10 days prior and with a positive close.
Here is shown 5 days Pocket Pivots and 10 Days Pocket Pivots
Fractals | Swing Points | Highs & Lows | Custom PeriodsSimple script which marks out key swing highs & lows.
One of the only indicators I have on the chart most days
- perfect for naked charting
- quickly helps you to visually identify key areas of interest
An extension of Bill Williams fractals
- aka short term swing points
Allows you to filter for only the most prominent swing points
- you can even overlay multiple swingpoint filters in different colours (as per example chart)
The number ( Fractal Periods) is simply:
- the number of less prominent points either side of your swing high/low
- example shown on the chart
Otherwise make a fist
- look at your 5 knuckles
- swing high is your middle knuckle
- 2 lower points either side
Bill Williams Original Fractal:
Fractal Periods = 2
Your Fractal Period for Filtering:
3, 4, 5, 30, 365, etc
Allows you to find swing points down to:
Fractal Periods = 1
Simple, easy, shared to enjoy =)
Fractals | Swing Points | Highs & Lows | Custom PeriodsSimple script which marks out key swing highs & lows.
One of the only indicators I have on the chart most days
- perfect for naked charting
- quickly helps you to visually identify key areas of interest
An extension of Bill Williams fractals
- aka short term swing points
Allows you to filter for only the most prominent swing points
- you can even overlay multiple swingpoint filters in different colours (as per example chart)
The number (Fractal Periods) is simply:
- the number of less prominent points either side of your swing high/low
- example shown on the chart
Otherwise make a fist
- look at your 5 knuckles
- swing high is your middle knuckle
- 2 lower points either side
Bill Williams Original Fractal:
Fractal Periods = 2
Your Fractal Period for Filtering:
3, 4, 5, 30, 365, etc
Simple, easy, shared to enjoy =)
Pivot H/LPivot high low based on 3 candles. Pivot low= low->lower low->higher low. Pivot high = high->higher high> lower high.
That shows me referal points where i would like to setup stop loss.
It also shows me trend or rotation and supports and rezists.
Chonky Pivot Pointsstandard pivot points re-written with circle plots.
Only shows the current pivot points. P, R1/R2, S1/S2
I don't use R3, R4 etc. so I didnt include them but feel free to modify the code.
You can change the resolution in indicator settings, default is set to Monthly.
Also to change the size of the circles all at once, you can input a number 1-4 in the inputs section.
Weekly Pivot Points with Colored Mid Pivots from HalcyonUpdated version of the Weekly Pivots Points that include mid pivot lines.
Target trading zones for the week are shaded green and red respectively. The mid pivot area is shaded aqua.
Use: buy (green) zones are buys, red zones are sells with respective color targets.
Scoring Development Sample [BigBitsIO]This script shows a sample of how to do confidence weighted scoring indicators and for loops with Pine. This indicator may or may not be found useful, it's intent is to provide a sample on how to create such an indicator and use certain Pine features.
Features:
- Defined points based on the confidence of RSI and Stochastic indicator
- Defined points based on candle color and sma trend direction
- For loops used to calculate bonus points for "extended periods" of confidence.
*** DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB. ***
Pivot Points, Daily, Weekly, Open and Close lines What is a Pivot Point?
A pivot point is a technical analysis indicator, or calculations, used to determine the overall trend of the market over different time frames. The pivot point itself is simply the average of the high, low and closing prices from the previous trading day. On the subsequent day, trading above the pivot point is thought to indicate ongoing bullish sentiment, while trading below the pivot point indicates bearish sentiment.
The pivot point is the basis for the indicator, but it also includes other support and resistance levels that are projected based on the pivot point calculation. All these levels help traders see where the price could experience support or resistance. Similarly, if the price moves through these levels it lets the trader know the price is trending in that direction.
When the price of an asset is trading above the pivot point, it indicates the day is bullish or positive.
When the price of an asset is trading below the pivot point, it indicates the day is bearish or negative.
The indicator typically includes four additional levels: S1, S2, R1, and R2. These stand for support one and two, and resistance one and two.
Support and resistance one and two may cause reversals, but they may also be used to confirm the trend. For example, if the price is falling and moves below S1, it helps confirm the downtrend and indicate a possible continuation to S2.
This Script includes the Mid Pivot Points, Open and Close levels