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...
Illustrate discrepancies between two symbols of the same higher timeframe. Sometimes: - 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...
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: 1) 'middle' ->...
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...
Function to make it easy to display text information on the chart.