Soldi
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: February 21st, 2022

Array help

Hey guys! I just found this place today! very excited to start reading and learning more.

I found here because I have a problem with arrays, I don't really understand them or how to use them but the script I'm building is going to need me to use them!

So I want to build a Fair Value Gap indicator that will only plot the 10 closest fair value gaps.

Of course as price moves on it will create more FVG's. but price can trend far far away before returning. I don't entirely want to delete those values as they will be used later as price retraces back. Is there a way for me to create example a 200 value array where as FVG's happen I can store and sort them.

Only plotting the closest 10 values and deleting the ones that get filled

extra: I would love to have the FVG candle change color once it gets filled aswell.

I have the logic down for the FVG where we can plot the Box extensions and then also delete them as they get filled. But as you already could assume it plots EVERY FVG. this clogs up computing and also the screen.

ANY help is very very much appreciated

processingclouds
Pine Script Master
Pine Script Master
Posts: 115
Joined: January 30th, 2022

Re: Array help

It would be helpful if you provide some code and can help on implementing logic into pinescript. Otherwise are you just looking to know what is array and its functions?

You mentioned you have the logic down, we can work from there.

Return to “Pine Script Q&A”