# Initialize HA_Open with the first Open value
ha_df["HA_Open"] = 0
ha_df.iloc[0, ha_df.columns.get_loc("HA_Open")] = (ha_df.iloc[0]["Open"] + ha_df.iloc[0]["Close"]) / 2
# Calculate HA_Open for the rest of the rows
for i in range(1, len(ha_df)):
ha_df.iloc[i, ha_df.columns.get_loc("HA_Open")] = (
ha_df.iloc[i - 1]["HA_Open"] + ha_df.iloc[i - 1]["HA_Close"]
) / 2
You can view all discussion threads in this forum. You cannot start a new discussion thread in this forum. You cannot reply in this discussion thread. You cannot start on a poll in this forum. You cannot upload attachments in this forum. You cannot download attachments in this forum.