Is it possible to make a market entry using a stop order? After my signal is generated i would like to place a buy order above todays market price, and keep it there.
My understanding is that that could be done in the following way: order(security, 0.16, style=StopOrder(context.output.get_value(security, 'High')))
I understand that Quantopian delete unfilled orders at the end of the day, so to keep the stop order, it must be saved, and redeployed each day until triggered.
When i use the following code to verify my stop order, nothing is printed, so they do not seem to be placed within the market :
order(security, 0.16, style=StopOrder(context.output.get_value(security, 'High')))
for equity, orders in get_open_orders().items():
print(equity)
print(orders)
for open_order in orders:
debug_str = "order created on {0} for {1} shares of {2}"
print debug_str.format(open_order.created, open_order. amount, open_order.sid)
additional information about the stop order:
I have printed out all parameters of the order, so it gets a security name, amount and a stop price, so why does it not come up as an active order when i do the check right after the order should have been initiated ??
Hope anyone could help me clarify this.