Open the57chambers opened 1 year ago
Have you checked for duplicates in the index?
Yes, i ran numerous functions to remove problematic values but am still getting the same error, see below for the adjustments i tried: data = data.dropna() cusum_events = cusum_events.dropna() vertical_barriers = vertical_barriers.dropna() daily_vol = daily_vol.dropna() data = data.drop_duplicates() cusum_events = cusum_events.drop_duplicates() daily_vol = daily_vol.drop_duplicates()
Running through the triple barrier labeling process, the code keeps getting an error
"IndexError: index 0 is out of bounds for axis 0 with size 0" - i take it this means it is trying to pull from an empty dataframe, but i have checked each of the inputs (cusum, ptsl, target,verticalbarriertimes, ES and Side) and they all have data. there are also no NaN, inf, NaT or other blank values or error in the dataframe. Any idea what could be causing this?
Code:
triple_barrier_events = ml.labeling.get_events(close=data['ES'], t_events=cusum_events, pt_sl=pt_sl, target=daily_vol, min_ret=min_ret, num_threads=3, vertical_barrier_times=vertical_barriers, side_prediction=data['side'])