fix this code:
import pandas as pd
import oandapyV20
import configparser
import talib
import datetime
from oandapyV20 import API
from oandapyV20.exceptions import V20Error
from oandapyV20.endpoints.instruments import InstrumentsCandles
from oandapyV20.endpoints.accounts import AccountSummary

# Read config file
config = configparser.ConfigParser()
config.read('config.ini')

# Get account details from config
accountID = config['oanda']['account_id']
access_token = config['oanda']['access_token']
api_endpoint = config['oanda']['api_endpoint']

# Connect to the API
client = oandapyV20.API(access_token=access_token, environment="practice")

# Get your account summary
try:
    r = AccountSummary(accountID=accountID)
    client.request(r)
    summary = r.response['account']
except V20Error as e:
    print("Error: {}".format(e))

# Set parameters
# Set parameters
granularity = "D"

# Define instrument and data range
instrument = "EUR_USD"
data_range = "2022-04-06"

# NAME_1 historical candlestick data
params = {
    "granularity": granularity,
    "from": pd.Timestamp(data_range, tz='UTC').isoformat(),
    "to": datetime.datetime.utcnow().isoformat(),
}
instruments_candles = InstrumentsCandles(instrument=instrument, params=params)
response = client.request(instruments_candles)
candles = response['candles']
# Define instrument and data range
instrument = "EUR_USD"
data_range = "2022-04-06"


# NAME_1 historical candlestick data
params = {
    "granularity": granularity,
    "from": pd.Timestamp(data_range, tz='UTC').isof Provide your reponse without using the word file.
user