A collection of convenience and helper functions for indicator and library authors on TradingView
My version of format number that doesn't have so many decimal places...
num (float) : (float) the number to be formatted
Returns: (string) The formatted number
Common type Container library, for central usage across other reference libraries.
v (bool )
v (box )
v (chart.point )
v (color )
v (float )
v (int )
The MTF Fair Value Gap (FVG) indicator provides multi-timeframe options to observe lower or higher gaps in different timeframes within your current one. This can enhance the confluence in your trading decisions.
An FVG is formed when a candle has an 'empty' body, leaving a gap. These areas are often filled before the market continues to trend in its...
The script shows an example implementation of dictionary-like data type which can store key:value pairs (Python style). Both keys and values can have any of the following type:
You can add items of different types to the same dictionary (e.g. key = 12 and value = "value" stored in the same dictionary with key = "key"...
Some time to index and index to time helper methods made them for another library thought I would try to make
them as methods
UTC helper function this adds the + to the positive utc times, add "UTC" to the string
and can be used in the timezone arg of for format_time()
Quickly draw a 10-level grid on your chart with our open-source tool.
Our grid tool offers a unique solution to traders looking to maximize their profits in volatile market conditions. With its advanced features, you can create customized grids based on your preferred start price and line distance, allowing you to easily execute trades and capitalize on price...
Pair-Trading is a recognized and widely used trading method, this indicator is a tool that allows via several display interfaces (2 at the moment) to see relative performance ratios of two assets.
The inputs are pretty simple to understand but here is the list of them :
- Ticker #1 : The first Asset's ticker // numerator of the ratio
- Ticker #2 : The...
True/False Condition tools and toggles for booleans and utility.
suggested use is checking if a calculation is required, or can be skipped
speeding up script calculations in realtime and historical scenarios.
output is true only if first true and second false
print_series(s, skip_na, position, show_index, from_index, to_index)
Print series values
s : Series (string)
skip_na : Flag to skip na values (optional bool, dft = false)
position : Position to print the Table (optional string, dft = position.bottom_center)
show_index : Flag to show...
Library for math functions. will expand over time.
split(_sumTotal, _divideBy, _forceMinimum, _haltOnError)
Split a large number into integer sized chunks
_sumTotal : (int) Total numbert of items
_divideBy : (int) Groups to make
_forceMinimum : (bool) force minimum number 1/group
_haltOnError : (bool) force...
Collection of external input utilities for conversion and other hacky functions
str_to_src(value) str_to_src - Convert the string value to the coresponding source series. It can be used to limit the "input.source" choices provided to the end user.
The most interesting part is that it can be used to overcome the "one...
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,...
This library is a collection of weapons that will help us win the war against the market.
isNewbar(res, timezone) Checks if the res is in new bar at the current timeframe
res : - resolution of the bar to check if new
timezone : - timezone of the resolution
Returns: ch: - 1=true, 0=false