Show Array or Matrix Elements In Table
Use anytime you want to see the elements in an array or a matrix displayed.
Effective debugger, particularly for strategies and complex logic structures.
Look in code to find instructions. Reach out if you need assistance.
Viewing the contents of an array or matrix on screen....
functions for assertions and unit testing
Namespace types: Test
method is_true(this, expression, message)
assert that expression is true, if it's false a runtime error will be thrown
Namespace types: Test
expression (bool) : The value to be...
This library helps creating and managing nice looking data (key/value) tooltips that you can use for
labels. The tooltips data key/value will align automatically. It is optional to convert the data to a values only string too.
Calculates the amount of spaces needed after the key to make it the key least 4...
A library of many helper methods, plus a comprehensive print method and a printer object.
This is a newer version of the helpers library. This script uses pinescripts v5 latest objects and methods.
Using Stopwatch Library by PineCoders, I am trying to test which is faster, an array of user-defined type (UDT) objects vs an object with many child arrays.
The task is to store and manipulate array of objects having total 9 values: 4 floats, 4 strings and 1 int.
Option 1: create a UDT with 9 fields and store an array of such UDT objects.
Option 2: create a...
📕 Console Library
While there are many nice console/logger scripts out there, my personal goal was to achieve inline functionality and visual object (label, lines) logging...
Illustrate discrepancies between two symbols of the same higher timeframe.
- HTF data can come for one symbol but not for another
- or come with gaps (e.g. after HTF bar 3 in the next chart TF's candle we have HTF bar 5 for one or both symbols)
This script allows to compare which code is more efficient by running it inside a loop for a certain time or a certain number of iterations.
Just paste your pieces of code as Option 1 and Option 2 inside the loop (see comments in the script).
The "Signal Viewer" script is a debugging tool that can be used for the signal of a Signal Indicator script like the "Two MA Signal Indicator" or the "Template Signal Indicator". This script will visualize the signal based on the convention that was defined in the settings. Also, alerts will be produced based on this convention. It's useful to be used before you...
Debug Tools | Pinescript Debugging Tool Kit
All in one Debugger - the benefit of wrapper functions to simply wrap variables or outputs and have the code still execute the same. Perfect for Debugging on Pine
Overloaded tostring like Function for all type+including Object Variables will also do arrays and matricies of all...
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...
When having a script with lot's of values, it can be difficult to seek the values you need to debug
For example, here, multiple values aren't visible anymore (right side chart)
This script show a way where you can show the values in a table on 1 particular bar, with 2 options:
Automatic Table from Matrixes with pseudo correction for na values and default color override for missing values. uses overloads in cases of cheap float only, with additional addon for strings next, then cell colors, then text colors, and tooltips last.. basic size and location are auto, include the template to speed this up...
Simple debug console to print messages from your strategy code.
Make sure your strategy overlay is false
Import the library :
import keio/console/1 as console
var log = console.init()
lines : Optional. Number of lines to display
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...
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...