Back to Community
Using fetch_csv with non-consecutive dates

I have a csv with purchase dates and buy signals that I want to use for backtesting. Since they are purchase dates, the dates in the csv are not consecutive, as in, there are gaps of a couple days or weeks between purchases. The csv is being properly fetched, but on market days where there is no corresponding purchase, it uses the last available signal and repeats it for each day until there is new purchase signal from the csv.

Any ideas on how to make the algo skip market days where there is no signal from the csv? Can date_column from fetch_csv be accessed and compared against the datetime of the backtest and skip for a NaN value?

Thanks in advance.