in following code : sls = [0.01,0.015, 0.02, 0.025 ,0.03,0.035, 0.04,0.045, 0.05,0.055,…
- User
in following code : sls = [0.01,0.015, 0.02, 0.025 ,0.03,0.035, 0.04,0.045, 0.05,0.055, 0.06,0.065, 0.07,0.075,0.08,0.085, 0.09,0.095, 0.1] tls = [0.01,0.015, 0.02, 0.025 ,0.03,0.035, 0.04,0.045, 0.05,0.055, 0.06,0.065, 0.07,0.075,0.08,0.085, 0.09,0.095, 0.1] hours_to_look = [24 ,48 , 72, 96, 120] symbols = pred_df['Symbol'].unique() current_symbol = '' columns = [] for sl in sls: for tl in tls: for hours in hours_to_look: columns.add(f'{sl}{tl}{hours}') combined_columns = list(pred_df.columns) + columns all_results= [] for index, row in pred_df.iterrows(): date, symbol, start_price = row['Date'], row['Symbol'], row['Close'] row_result = [] if(symbol != current_symbol): hourly_path = find_first_matching_1h(symbol) hourly_df = pd.read_csv(hourly_path) hourly_df['Date'] = pd.to_datetime(hourly_df['Date'], format="ISO8601", utc=True)
for sl in sls: for tl in tls: for hours in hours_to_look: result = analyze_price_move(date, start_price,sl,tl,hourly_df) row_result.add(result) all_results.add(row_result)i want to add calculated rows and columns to my pred_df
- Assistant