beginner: How to close e-mini position? - solved.

Hey,

I just started at Quantopian and have searched the forum extensively for an answer to this question, but couldn't find one.
I get a runtime error for the "order_target(context.future, 0)" below. I want to trade ES. It says that "UnsupportedOrderParameters: Passing non-Asset argument to 'order()' is not supported." Why do I not get a runtime error for the buy orders, but for the sell order, even though I basically use the same argument?

    if current_price > (1.005 * average_price):