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...
Show Array or Matrix Elements In Table
For Arrays: Set the number of rows you want the data displayed in and it will generate a table, calculating the columns based on the size of the array being displayed.
For Matrix: It will automatically match the Rows and Columns to the values in the matrix.
Note: On the left, the table shows the...
Provides functions to time the execution of a script.
When timing scripts, keep in mind that the runtime environment is fluid on TradingView. Different servers or server loads will impact execution time.
stopwatchStats() Times the execution of a script.
Returns: A tuple of four values: timePerBarInMs, totalTimeInMs, barsTimed,...
I'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...
Methods for debuging/output into a table, console like style.
init(size) initiate property variables.
size : int, console line size.
Returns: tuple, table and string array.
queue(console_id, new_line) Regular Queue, will be called once every bar its called.
console_id : string array, console...
This is a logging library for Pinescript. It is aimed to help developers testing and debugging scripts with a simple to use logger function.
Pinescript lacks a native logging implementation. This library would be helpful to mitigate this insufficiency.
This library uses table to print outputs into its view. It is simple, customizable and...
Currently in PineScript you cannot modify global variables in functions because of scope limitations.
One way to work around that is to use arrays.
This Library simplifies the use of arrays as global variables to make your code look cleaner.
If you're coming from other programming languages, I'm sure you will come across this issue in your PineScript journey at...
A simple banchmark library to analyse script performance and bottlenecks.
Very useful if you are developing an overly complex application in Pine Script, or trying to optimise a library / function / algorithm...
Supports artificial looping benchmarks (of fast functions)
Supports integrated linear benchmarks (of expensive scripts)
Simple method I used to debug problem in my script.
For loop generates 5 numbers from the given depth. At present, depth is 9
Rules for generating the combinations are as follows:
First number is always 1
Two even numbers should not be adjacent to each other and two odd numbers should not be adjacent to each other
Numbers should be ordered in...
TODO: add library description here
outlierLevel(src, len, level)
Gets the (standard deviation) outlier level for a given series.
src : The series to average and add a multiple of the standard deviation to.
len : The The number of bars to measure.
level : The positive or negative multiple of the standard...
An easy way to output messages to a console like table using a a simple "print" function that can be called from anywhere in your code including functions.
- Scrollable console messages
- Customisable number of displayed messages
- More than one "console" for different types of output if...
A collection of functions used for trade automation
Gets the base currency for the chart's ticker. Supported trade pairs are USD, USDT, USDC, BTC, and PERP.
Returns: Base currency as a string
Get the current chart's symbol without the base currency appended to it....
ma(source, length, type)
Generates moving average based on the given parameters
source : - series
length : - length of the moving average
type : - type of moving average (SMA, WMA, VWMA, RMA, HMA, LSMA, MAEMA, TMA) default: EMA
@ returns - moving average series
nearby(a, b, atr_period, atr_deviation)...
Utility functions written by me
Prints string in a label on the last bar
string : value to print
Prints float in a label on the last bar
float : value to print
Type Check for Function Builders to allow Single item to be
passed in, and determine what to do with the item, ie: need an x value?
function that allows label, line, box, float, or even a string..
check item type? string ? 'str.tonumber(_item)' can be in the same
switch as a 'line.get_price(_item, bar_index)' both outputting float
Matrix Global Registry.
Get, Set, automatic growing, universal get/set,
multi-matrix dictionaries, multi-dictionary matrixes..
add slice matrixes of any type, share one common global key registry
pull up an item from a category, and item name ie a table of info.
same cell needs a color, a size, a string, a value, etc..
all of which can be...
up_bar() 'up_bar' checks true for every candle that closed above open price.
Returns: custom Series Bool
last_up_bar() 'last_up_bar' checks true for every last candle that closed above open price.
Returns: custom Series Bool
down_bar() 'down_bar' checks true for every candle that closed below open price.
This is a collection of functions either found on the internet, or made by me.
This is only public so my other scripts that reference this can also be public.
If you find anything useful for you here, be my guest.