MAJOR UPDATE WITH ARRAYS !!
To keep track of the high and low pivot points and the time of occurence, these values are stored in a custom DATAFRAME ARRAY.
This dataframe structure basically turns the standard 1 dimensional Pinescript arrays in a structured 3D dataframe!
!! Feel free to use the df structure in other scripts if you so desire, however a little shoutout would be nice!! ;-)
//////////////////////////////////
/ BASIC INFO ON THE DATAFRAME: ///
//////////////////////////////////
The df is set up as an EXCELL workbook and is devided in SHEETS, ROWS/RECORDS and COLUMNS.
With the use of some purpose-built functions, values can be placed or retrieved in a specific column of a certain row on a certain sheet
this can be done by intuitively using sheet_nr, row_nr and column_nr coördinates,
without having to worry on what exact index of the Pine array this value is located (the functions do these conversions for you)
the syntax I propose for the 3D dataframe array has the following structure:
- the array starts with 3 VALUES describing the DIMENSION INFORMATION, (nr of sheets, rows, columns)
these are ignored in the actual calculations and serve as a metadata header (similar to the "location, time,... etc." data that is stored in photo files)
so the array always carries it's own info about the nr. of sheets, rows and columns and doesn't need is seperate "info" file!
To stay consistent with the standard Pinescript (array and [lookback]) indexing:
- indexes for sheets and columns start from 0 (first) and run up to the (total nr of sheets or columns) - 1
- indexes for rows also start from 0 (most recent, cfr.[lookback]) and run up to the (total nr of rows) - 1
- this 3 value metadata header is followed by the actual df data
the actual data array can consist of (100,000 - 3) usable items,
In a practical example, you can have a df with 3 sheets, containing 6,666 rows with each 5 columns of data (eg. open, high, low, close, volume) in it!!!
Enjoy!
Gr, JD.