1) Is there a way to place limit and stop orders with futures, it seems from the posted futures tutorials that the way to order is through order_optimal_portfolio(). But I want to be able to set a target price to buy/sell at.
2) My strategy requires specific times to trigger and I am currently using data.current(context.future,'high') to track the minute to minute high over a custom time frame, however in the back tester it is giving me the current times high not the high at the time of the back test.
current_time = get_datetime('US/Eastern').time()
if (current_time >= context.startTime and current_time < datetime.time(3,15)):
context.todayHigh = max(context.todayHigh, data.current(context.future,'high'))
context.todayLow = min(context.todayLow, data.current(context.future,'low'))
if(current_time == datetime.time(8,30)):
context.todayHigh = 0
context.todayLow = 9999999999999999