Patrick [TFO]This Patrick indicator was made for the 1 year anniversary of my Spongebob indicator, which was an experiment in using the polyline features of Pine Script to draw complex subjects. This indicator was made with the same methodology, with some helper functions to make things a bit easier on myself. It's sole purpose is to display a picture of Patrick Star on your chart, particularly the "I have $3" meme.
The initial Spongebob indicator included more than 1300 lines of code, as there were several more shapes to account for compared to Patrick, however it was done rather inefficiently. I essentially used an anchor point for each "layer" or shape (eye, nose, mouth, etc.), and drew from that point. This resulted in a ton of trial and error as I had to be very careful about the anchor points for each and every layer, and then draw around that point. In this indicator, however, I gave myself a frame to work with by specifying fixed bounds that you'll see in the code: LEFT, RIGHT, TOP, and BOTTOM.
var y_size = 4
atr = ta.atr(50)
LEFT = bar_index + 10
RIGHT = LEFT + 200
TOP = open + atr * y_size
BOTTOM = open - atr * y_size
You may notice that the top and bottom scale with the atr, or Average True Range to account for varying price fluctuations on different assets.
With these limits established, I could write some simple functions to translate my coordinates, using a range of 0-100 to describe how far the X coordinates should be from left to right, where left is 0 and right is 100; and likewise how far the Y coordinates should be from bottom to top, where bottom is 0 and top is 100.
X(float P) =>
result = LEFT + math.floor((RIGHT - LEFT)*P/100)
Y(float P) =>
result = BOTTOM + (TOP - BOTTOM)*P/100
With these functions, I could then start drawing points much simpler, with respect to the overall frame of the picture. If I wanted a point in the dead center of the frame, I would choose X(50), Y(50) for example.
At this point, the process just became tediously drawing each layer of my reference picture, including but not limited to Patrick's body, arm, mouth, eyes, eyebrows, etc. I've attached the reference picture here (left), without the text enabled.
As tedious as this was to create, it was done much more efficiently than Spongebob, and the ideas used here will make it much easier to draw more complex subjects in the future.
Drawing
Volatility ZigZagIt calculates and plots zigzag lines based on volatility and price movements. It has various inputs for customization, allowing you to adjust parameters like source data, length, deviation, line styling, and labeling options.
The indicator identifies pivot points in the price movement, drawing lines between these pivots based on the deviation from certain price levels or volatility measures.
The script labels various data points at the ZigZag pivot points on the chart. These labels provide information about different aspects of the price movement and volume around these pivot points. Here's a breakdown of what gets labeled:
Price Change: Indicates the absolute and average percentage change between the two pivot points. It displays the absolute or relative change in price as a percentage. Additionally, the average absolute price increase or the average rate of increase can also be labeled.
Volume: Shows the total volume and average volume between the two pivot points.
Number of Bars: Indicates the number of bars between the current and the last pivot point.
Reversal Price: Displays the price of the reversal point (the previous pivot).
Psychological Support/Resistence [BigBeluga]The Psychological Support/Resistance indicator aims to provide the user with hypothetical support and resistance zones that are likely to provoke a strong reaction in price, either in both directions, providing good bouncing zones or significant movements once those levels are breached.
🔶 CALCULATION
The script takes into consideration the total number of sequential candles moving in the same direction, as determined by the user's settings. When this sequence is identified, a level is created.
A level is considered broken when the candle's close is above the top/bottom of the level.
Users have the option to select the width of the area based on the Average (AVG), Open, or Close.
AVG will provide the average width of the level of the area.
Close will offer a broader range to work with.
Open will provide a very narrow area.
🔶 METHODOLOGY
The idea behind these areas is that the price will be more likely to produce either a substantial move in the ongoing direction or, when breached, a strong price reaction.
The more the support level is touched or tested, the more likely it is to break.
The longer it has been since its creation and the less it has been tested, the more likely it is to offer strong support or resistance.
Wicks starting to close above the level will indicate a potential breakout to the upside or downside if a candle manages to close above it.
🔶 INPUTS
Users have the option to determine the number of sequential candles.
Users also have the option to decide how many zones to display on the chart.
Color changes are possible.
The possibility to show volume on the creation of the zone is included."
[-_-] 2D FractalsThe sole purpose of this script is to demonstrate what's possible to make with Pinescript, namely to display images (2D Fractals in this case).
The script consists of two functions: one that generates the values of a fractal and one that displays them (utilising table) with each cell being used as a "pixel". We can control the "resolution" of image, as well as choose one of three fractal types.
[-_-] Custom Type ExamplesDescription:
This script shows an example use of new Pinescript's feature called User Defined Types, which can be seen as analogue of from C++ or from Python. It is not an indicator for technical analysis, and serves only as an example of how to use the new feature mentioned above.
In the script I define 4 custom types and a custom initialisation function for each:
- Point (represents a coordinate with x -> bar_index, y -> price)
- Tria (creates a triangle using objects and objects as coordinates of 3 points)
- Path (creates a path-like object from an of )
- Trade (creates a visual representation of a Long/Short trade with set Take Profit and Stop Loss, and displays an info label with realized Profit/Loss)
I'd personally like to see this feature improved by adding methods (so that we could, for example, define functions inside a custom type), which could be an analogue of classes from other programming languages.
Titans Trend LinesThis indicator will plot trend lines based on recent pivot highs and lows.
The pivot sensitivity level may be customised under the indicator settings. The pivot highs and lows are identified by 'H' and 'L' markers.
Through the indicator, a purple dotted line connects the last two pivot highs and another purple dotted line connects the last two pivot lows. These lines are extended to the left and right beyond the connected points.
If a new trend line has developed due to the formation of a new pivot high or low, the last trend line will be grayed to help with referencing.
The user is advised to use this indicator at his own risk.
DrawingOBForSMCDrawing OB for SMC trading technique.
Control the parameters to:
- Only draw supply
- Only draw demand.
- Draw minor structure...
Example - Future Line DrawingExample primarily focuses on:
• creating a simple function to get a time offset value
• using the offset to set drawing locations in the future
• how to properly set up and manipulate line positions
Extras ( end of script ):
• inclusion of vertical lines for visualising start and end points using the time offsets
• inclusion of label to read out the current time offset forwards/backwards
This script publication is intended for:
• Educational Purposes
Who is it for?
• anyone who wants to learn the basics of drawing using 'time' for purposes of positioning
GartleyPattern_ULTRA V1 [NXT2017] Autodrawing Harmonic PatternPrivate indicator.
HI BIG PLAYERS AROUND THE WORLD,
this script allows to draw automatically lines of Gartley Pattern. The Gartley Pattern is part of Harmonic Pattern.
Parallel to the automatic drawing, the indicator can give signals as soon as the typically Fibonacci extension immediately reached or has been reached. This allows the indicator GartleyPattern_ULTRA V1 to give early signals. In the default settings, the signals are displayed with a blue background on the chart.
NO REPAINT
As soon as the most points of the pattern are developed, the last point is a fix prediction without any repaints!
GartleyPattern_ULTRA V1 is offered for sale. More information can be found below in the signature.
In the settings it is possible to change the degree of details. This is sometimes necessary because TradingView limited only 55 lines per indicator in Pinescript Version 4.
Furthermore, you can set a range how much bars back you want go from current bar for the automatic drawings. As default is setting 2000 bars back.
In extreme cases it is possible to change the settings to "lite" that the Gartley Pattern represent waves only with 2 lines. This allows the indicator to detect far more Gartley Pattern on the same chart.
For more great indicators everyone is invited to follow me on TradingView.
Kind regards
NXT2017
More Examples:
Plotchar - How to draw external symbols on a chartHey everyone
It's been a while :) but still on holidays and working on the website. I'll resume the scripts sharing shortly once I'll get back home
For today, I wanted to share a very useful script that is going to make you a top of money 100% guaranteed and you'll even have a Lamborghini delivered at your place by tomorrow... (imagine some followers would believe me for this)
This "script" is a proof of concept that you can draw external Unicode symbols on a chart.
If you're tired with the plotshape shapes by default, you can use some others - I usually find mine there emojipedia.org
What are the use cases?
- Draw a dead skeleton when your stop-loss is hit
- Draw a winning cup when your take profit is hit
- Draw a coffin when you run out of capital
FAQ
Q: Does this script has any interest?
A: I'm not sure myself
Q: Will you make money using it?
A: I'm not a financial advisor but ... very likely NO
Q: Is it cool though?
A: Hell yeah!!
Be sure to hit the thumbs up so that I'll share real scripts the next times and not "joke scripts". I promise it's the first and last time I'm sharing such a script
Dave
____________________________________________________________
- I'm an officially approved PineEditor/LUA/MT4 approved mentor on codementor. You can request a coaching with me if you want and I'll teach you how to build kick-ass indicators and strategies
Jump on a 1 to 1 coaching with me
- You can also hire for a custom dev of your indicator/strategy/bot/chrome extension/python