def break_even_amount(buy_price, amount, target_change, trade_fee = 0):
  """
  This function take a buy order price, the amount to buy
  and a target price to sell as a relative change from buy price
  and returns the amount to sell at the target price to break even
  """
  buy_value = buy_price * amount
  buy_cost = buy_value * ( 1 + trade_fee )
  traget_sell_price = buy_price * ( 1 + target_change )
  sell_amount = (buy_cost / traget_sell_price) / ( 1 - trade_fee)

  return sell_amount