This indicator is sample code that you can customize.
It selectively displays a label based on how severe a warning should be.
Simply add it to your chart, then open the code to make a copy for your own use.
Normally I would make this a library, but because libraries can't retain state (yet) and pine script doesn't allow classes (yet), I thought this would be...
Utility for managing active labels on the chart.
add(level, txt, labelColor, textColor) For displaying a lable at the last bar.
level : The value to display the label at.
txt : The text to show on the label.
labelColor : The color of the label.
textColor : The text color of the label.
Functions to create labels, from simple to complex.
Creates a label each time a condition is true. All label parameters can be customised.
_condition The condition which must evaluate true for the label to be printed.
_x The x location.
_y The y location.
_text The text to print on the label.
K-Means Clustering Method.
nearest(point_x, point_y, centers_x, centers_y) finds the nearest center to a point and returns its distance and center index.
point_x : float, x coordinate of point.
point_y : float, y coordinate of point.
centers_x : float array, x coordinates of cluster centers.
This script shows an example of how to manage objects (lines/labels/boxes) and prevent the need of garbage collecting and missing objects.
You only have to push your object into the right array.
*_FIXED (left-lock) or *_FORWARD (right-lock)
We hope you enjoy it! 🎉
CRYPTOLINX - jango_blockchained 😊👍
Trading success is all about following your...
Pinescript - Common Label & Line Array Functions Library by RagingRocketBull 2021
This script provides a library of common array functions for arrays of label and line objects with live testing of all functions.
Using this library you can easily create, update, delete, join label/line object arrays, and get/set properties of individual label/line...
Hi BIG PLAYERS
Each of us makes mistakes and exceptions confirm the rule.
However, if you disregard the rules of trading, you lose your money - without any ifs and buts!
I have therefore created a reminder label for myself, which trading approaches I always want to stick to. These rules serve me as a guideline when I should trade.
Through the permanent...
This indicator looks simple but it was bit tricky to code and to make it work on all time frames .
I have used array in this to showcase the use of array, array give you more flexibly.
It works on all time frame 1m 2m 3m 5m 10m 15m 30m 60m 120m.
When the time frame is greater than the or equal to "D" it will show the current bar volume only.
Total volume is...
Script to display Supertrend trend state of 8 different securities in a panel. Timeframe & Tickers which are to be displayed can be configured from settings.
Part of code is from the ADX DI Monitoring Panel script by u/wugamlo with his permission. Thanks to him for that and do please check out his work also.
An example of using str.replace_all() function to extract a crypto ticker without its pair.
It can be useful if you didn't know syminfo.basecurrency existed.
I didn't know syminfo.basecurrency exists. Lol
This is a script to make calculating position size easier. It calculates position size as a percentage of account balance and Risk/Reward based on input values of entry, exit, stoploss and shows the R/R box similar to tradingview's R/R tool. There is an option to toggle showing label and choosing of label text color.
Have to enter the following inputs in order...
This screens for Hull MA trend reversal's in 10 different securities. If the label color is not visible due to the text in it being white colored, then choose a different color from settings. Also added a simple HullMA to it. If want can increase it upto 40 securities in the code which is upto user to decide.
This was requested by soderstromkenan in comments and...
This screens for Supertrend reversal's in 10 different securities. The main logic for the screener is taken from "Simple Custom Screener in Pinescript" by QuantNomad with his permission. If the label color is not visible due to the text in it being white colored, then choose a different color from settings. Also added a simple supertrend to it.
Function: labelling recent highs and lows automatically. Easy and clean.
In this example, we can see the previous low of the ticker is around 105.5, the previous high is around 120.
We can set up our entries and exits by referring to the last lows and highs.
Users can adjust the searching bar range by themselves.
A good amount of users requested a text box showing various price statistics, the following script returns various of these stats in a user-selected range, and include classical ones such as a central tendency measurement (mean), dispersion (normalized range) and percent change, but also include less common statistics such as average traded volume and number of...
Some code for detecting the very rare occurrences of the Marubozu candle. This candle occurs when the High = Close, and Low = Open, or vice versa. They are continuation candles, so if you see a bullish Marubozu during an uptrend its possible that the uptrend will continue.