Hello,
I am hoping someone can help me with a bubble sort I am trying to use to sort price data.
I am reading in the data and looping through day by day for analysis.
I am trying to use "bubble sort" to sort the highest 10 prices over a rolling 20 day window and then average those 10 prices. for some reason I just cannot get the sorting correctly when I go day to day.
So each day I read the new close price in a loop
gosub readdata
for iday=1 to ndays
gosub bubble sort
print new averages for day
next iday
readdata: bring all historical prices into an array.
Thanks for the help...
I am hoping someone can help me with a bubble sort I am trying to use to sort price data.
I am reading in the data and looping through day by day for analysis.
I am trying to use "bubble sort" to sort the highest 10 prices over a rolling 20 day window and then average those 10 prices. for some reason I just cannot get the sorting correctly when I go day to day.
So each day I read the new close price in a loop
gosub readdata
for iday=1 to ndays
gosub bubble sort
print new averages for day
next iday
readdata: bring all historical prices into an array.
Thanks for the help...