Fantastic indicator! As an example Im confused what would be the signal for the close of either gap1up or gap1dn? I can use gap1up and gap1dn to determine their activations but Id like a seperate number that shows me how many of those closed
i came across this post today... sorry i didn't reply earlier.
i had to read it 6 times before it started to make sense, of what you are asking.
i was hung up on ' close of gap1up' . variables don't have a close price, they store 1 number per bar.
i tend to read things literally, i don't try to guess what someone means.
variables don't close. they have numbers or are true or false.
gaps can get filled, close
if you had said , count the filled gaps, that would make sense.
counting the price gaps that price later moves across ( filled, or closed )
https://centerpointsecurities.com/what-is-a-gap-fill-in-stocks/
------------------------------------
i don't know what counting gaps has to do with trying to plot 42 lines on a chart. 42 is a ridiculous amount of lines.
when creating a study, keep it simple.
for counting gaps, you only need the first 10 code lines. the other 500+ are just complicating things.
-----------------------------
to do this thoroughly, you would need to use arrays, but thinkscripts doesn't have arrays.
there will be a random number of gaps on a chart. and a random quantity of them that will be filled.
in order to count the filled gaps, you would need have,
. variables to save every gap range high and low.
. then compare those variables to all of the close prices, on all the bars after each gap.
something could be hard coded to look for a few , like 3 gaps. but if there are 6 gaps on the chart, then some data will missed and totals will be wrong.