ToClrToStrContains functions for conversion of color to string and vice versa:
method toClr( string this ) - converts string reperesentation of color (in hex format) to color
method toHex( color this ) - converts color to string (hex form)
method toRgb( color this ) - converts color to string ("rgb(11,11,11,0)" form)
Thanks to @ImmortalFreedom for his `color_tostring()` function from "RGB Color Fiddler"
HEX
Emibap's HEX Uniswap v3 Liquidity PoolThis script will display a histogram of the Uniswap V3 HEX liquidity pool, versus as many tokens as possible.
Current supported pairs:
HEX/USDC
HEX/WETH
HEX/WETH.USD (Ethereum expressed in USD)
HEX/USDT (Just showing the USDC liquidity)
Similar to what you can see in the liquidity section of the Uniswap pool page but conveniently rendered alongside your chart.
It's meant to be used on a HEX / WETH chart only. The price should be expressed in WETH for it to work.
One of the main motivations for using this in your chart is to get an idea of the current sentiment: If most of the volume is above the price it might be an indication of an upcoming move up, for instance.
I'll try to update the liquidity regularly.
Using the 4h, daily, or weekly time frames is highly recommended.
The options are straightforward:
Histogram bars color. Default is blue
Histogram background color. Default is black at 20% opacity
Upper price limit of the diagram: Visible upper bound price limit for the histogram, based on the current price. I.E: 200%: If the price is 1, the histogram will show 3 as the upper bound
Lower price limit of the diagram. Visible lower bound price limit for the histogram, based on the current price. I.E: 99%: If the price is 1, the histogram will show 0. 01 as the upper bound
Width of the widest bar: Width (in bars) for the widest bar of the histogram. The more the higher resolution you'll get
Locked volume marker line thickness
Locked volume marker color
signal_datagramThe purpose of this library is to split and merge an integer into useful pieces of information that can easily handled and plotted.
The basic piece of information is one word. Depending on the underlying numerical system a word can be a bit, octal, digit, nibble, or byte.
The user can define channels. Channels are named groups of words. Multiple words can be combined to increase the value range of a channel.
A datagram is a description of the user-defined channels in an also user-defined numeric system that also contains all runtime information that is necessary to split and merge the integer.
This library simplifies the communication between two scripts by allowing the user to define the same datagram in both scripts.
On the sender's side, the channel values can be merged into one single integer value called signal. This signal can be 'emitted' using the plot function. The other script can use the 'input.source' function to receive that signal.
On the receiver's end based on the same datagram, the signal can be split into several channels. Each channel has the piece of information that the sender script put.
In the example of this library, we use two channels and we have split the integer in half. However, the user can add new channels, change them, and give meaning to them according to the functionality he wants to implement and the type of information he wants to communicate.
Nowadays many 'input.source' calls are allowed to pass information between the scripts, When that is not a price or a floating value, this library is very useful.
The reason is that most of the time, the convention that is used is not clear enough and it is easy to do things the wrong way or break them later on.
With this library validation checks are done during the initialization minimizing the possibility of error due to some misconceptions.
Library "signal_datagram"
Conversion of a datagram type to a signal that can be "send" as a single value from an indicator to a strategy script
method init(this, positions, maxWords)
init - Initialize if the word positons array with an empty array
Namespace types: WordPosArray
Parameters:
this (WordPosArray) : - The word positions array object
positions (int ) : - The array that contains all the positions of the worlds that shape the channel
maxWords (int) : - The maximum words allowed based on the span
Returns: The initialized object
method init(this)
init - Initialize if the channels word positons map with an empty map
Namespace types: ChannelDesc
Parameters:
this (ChannelDesc) : - The channels' descriptor object
Returns: The initialized object
method init(this, numericSystem, channelDesc)
init - Initialize if the datagram
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object
numericSystem (simple string) : - The numeric system of the words to be used
channelDesc (ChannelDesc) : - The channels descriptor that contains the positions of the words that each channel consists of
Returns: The initialized object
method add_channel(this, name, positions)
add_channel - Add a new channel descriptopn with its name and its corresponding word positons to the map
Namespace types: ChannelDesc
Parameters:
this (ChannelDesc) : - The channels' descriptor object to update
name (simple string)
positions (int )
Returns: The initialized object
method set_signal(this, value)
set_signal - Set the signal value
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to update
value (int) : - The signal value to set
method get_signal(this)
get_signal - Get the signal value
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to query
Returns: The value of the signal in digits
method set_signal_sign(this, sign)
set_signal_sign - Set the signal sign
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to update
sign (int) : - The negative -1 or positive 1 sign of the underlying value
method get_signal_sign(this)
get_signal_sign - Get the signal sign
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to query
Returns: The sign of the signal value -1 if it is negative and 1 if it is possitive
method get_channel_names(this)
get_channel_names - Get an array of all channel names
Namespace types: Datagram
Parameters:
this (Datagram)
Returns: An array that has all the channel names that are used by the datagram
method set_channel_value(this, channelName, value)
set_channel_value - Set the value of the channel
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to update
channelName (simple string) : - The name of the channel to set the value to. Then name should be as described int the schemas channel descriptor
value (int) : - The channel value to set
method set_all_channels_value(this, value)
set_all_channels_value - Set the value of all the channels
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to update
value (int) : - The channel value to set
method set_all_channels_max_value(this)
set_all_channels_value - Set the value of all the channels
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to update
method get_channel_value(this, channelName)
get_channel_value - Get the value of the channel
Namespace types: Datagram
Parameters:
this (Datagram) : - The datagram object to query
channelName (simple string)
Returns: Digit group of words (bits/octals/digits/nibbles/hexes/bytes) found at the channel accodring to the schema
WordDesc
Fields:
numericSystem (series__string)
span (series__integer)
WordPosArray
Fields:
positions (array__integer)
ChannelDesc
Fields:
map (map__series__string:|WordPosArray|#OBJ)
Schema
Fields:
wordDesc (|WordDesc|#OBJ)
channelDesc (|ChannelDesc|#OBJ)
Signal
Fields:
value (series__integer)
isNegative (series__bool)
words (array__integer)
Datagram
Fields:
schema (|Schema|#OBJ)
signal (|Signal|#OBJ)
RGB Color Codes Chart█ OVERVIEW
This indicator is an educational indicator to make pine coders easier to input color code.
Color code displayed either in hex or rgb code or both.
█ INSPIRATIONS
RGB Color Codes Chart
Table Color For Pairing Black And White
█ FEATURES
Hover table cell to see all properties of color such as Hex code and RGB code via tooltip.
Cell can be show either Full, HEX, RGB, R, G, B or na.
█ LIMITATION
This code does not consider usage of color.new()
█ CONSIDERATION
Code consideration to be used such as color.r(), color.g(), color.b() and color.rgb()
█ EXAMPLE OF USAGE / EXPLAINATION
ColorUtility for working with colors.
Get the luminosity of a color and determine the optimal (black or white) foreground color.
HexLibrary "Hex"
Hex String Utility
intToHex(_n)
helper Binary half octet to hex character
Parameters:
_n : Digits to convert
fromDigits(_input, _buffer)
Digits to Hex String output
Parameters:
_input : Integer Input
_buffer : Number of 0's to pad Hex with
Returns: string output hex character value buffered to desired length (00-ff default)
HEX Risk Metric (v0.2)This indicator plots a "risk metric" based on the % increases of the following averages:
ema21, sma50, sma100, sma200, sma300, sma600.
Depending on the rolling 7-day percentage increase of this moving average, a value is assigned to each data point, then normalized to a common range.
This set of metrics attempts to represent data similar to that of a heat map.
Users can adjust filter top, filter bottom, and toggle on/off the different metrics within the set.
HEX Risk Metric (v0.1)This indicator plots a "risk metric" based on the % increases of the following averages:
ema21, sma50, sma100, sma200, sma300, sma600.
Depending on the rolling 7-day percentage increase of this moving average, a value is assigned to each data point, then normalized to a common range.
This set of metrics attempts to represent data similar to that of a heat map.
Users can adjust filter top, filter bottom, and toggle on/off the different metrics within the set.
RGB Color FiddlerKEEP YOUR COINS FOLKS! I DON'T NEED THEM, DON'T WANT THEM. Many other talented authors on TV deserve them.
INTRODUCTION:
This is my "RGB Color Fiddler", intended as a toy to play with. This colorcator is rated 'E' for every TV member. With this you can quickly generate about 1.67 million potential colors from color.rgb(). While I have a few preferred colors that are ideal for use, this allows you to finely tune colors to anything that pleases your eye on your canvas.
TIPS:
The overlay chart can be peppered with colors of all varieties, so it's necessary to have properly distinguished coloring and contrast separation. If you employ light charts, you can tweak colors to just the right shade you desire on your display. Not all LCDs are created equal, even when color calibrated. With specific discovered colors tailored to your liking, you may uniquely color code ALL of your indicators.
UTILITY:
The input()s in Settings allow up to 4 different colors to tinker with and compare. After selecting focus of an input, you can easily use the up/down keyboard keys to make swift adjustments numerically or with options. The color combos you are creating will be displayed in color hex or a RGB representation within the labels.
Also of great benefit, is the ability to cycle through the currently available plot() styles. Some styles will require you to zoom in closeup to observe their behaviors. There is a few other ways to finagle plot() parameters to also achieve other acrobatic effects that are not demonstrated here. Closer study of plot() parameters in the reference can reveal those. Anyhow, I won't bother you with more elaborate technical jargon, now is the time to fiddle with this toy to your benefit!
CODE REUSE:
Any member has the freedom to use any of the code in this script any way they see fit. It's specifically intended for all. There is absolutely no need for accreditation for any of this code reuse ever, in the present case. Don't worry about, I'm certainly not.
When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members , I may implement more ideas when they present themselves as worthy additions. Have a profitable future everyone!
Chart Theme - Change Bar and Background Colors using HEX #sAdds aesthetic ability to charts by allowing the trader to change the color of the bars, background, and plots using HEX colors, rather than TradingView's limited color selector box. This makes for easy application of color palettes to charts. The color palettes can be saved as indicators and applied quickly, as desired.