NEoWave Wave Chart - Can I start a Pine Script indicator at a specific price bar?

Viewed 211

I'm trying to write a script using Pine Script that will plot a NEoWave chart. As I'm new to coding and Pine-Script I haven't got far. The first obstacle is that I want the indicator to start at a bar index that is not necessarily the first historical price bar (which has a bar index of 0) but rather a bar index value that is input. Is this possible?

At present I'm creating my NEoWave charts manually. I've developed an approach that would appear to generate realistic looking NEoWave charts overlaid on a price bar chart. What I do is always work with four price bars as the NEoWave analysis period. The first price bar is the starting bar and the fourth price bar is the finishing bar. The highest high and lowest low of the four price bars are determined and these two values are plotted in the order they occur at the first and third bars so they are equal distance apart.

Example NEoWave chart

Is there a function that will determine the highest high and lowest low between two specified price bars? The bar index of first price bar would be an input value and the second bar index would be determined from the first.

The functions highest(source,length) and lowest(source, length) where length = integer don't appear suitable.

3 Answers

There are 2 NeoWave scripts in the public library.
Both are open source, so you can see the code.

NeoWave public scripts

Thanks for that. Yes I was aware of those scripts. I don't think the first one works and the second one does not produce an accurate NEoWave chart.

You could use the function math.max for the set of highs, and math.min for the lows.

As for how to select the specific range of bars, you could look into and adapt the indicator by TV "CAGR Custom Range".

Related