Hello,

I am new to both the platform and Python, so I appologise if my question is silly. I have been trying for days to put a code together that would put an orer at every time period based on current price and cancel this orders 2 hours later if unfilled. Enclosed is my epic failled attempt. While the code indeed run it is not canceling a given order after 2 hours if unfilled, instead it is keeping all of them live (and as a result they all filled up at 2013-10-08 11:00:00 (As you see from Log, Orders 1 to orders 28 get all filled but they should have been cancelled since they were more than 2 hours old!). My guess is that the orders should be stored in a table with their Expiry date and screening them at each iteration (e.g every hours) but I am at a loss as to how to do this.

In oanda for instance it is possible to set the expiry date on every order so it would be a great feature to have (along with some embeded take profit)

I would really appreciate the help and wisdom from this forum