Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Modifying orders?

Hi all,

Is there a way to modify resting limit/stop orders, updating the quantity? I am having difficulty keeping a stop order in sync with the actual position size, as fills on the original entry order dribble in. I naturally want the stop-loss to be for my position amount, no more or less, so I am trying to modify the stop order on every minute with the amount of my position, but it looks like I'll have to cancel and resubmit the order? (which makes iterating through the open stop orders while adding and removing them a bit tedious).

Simon.

4 responses

If you don't want to iterate over and over and waste valuable time, save the quantites in a dictionary indexed by assets, and keep it up to date.

Or build your own "stop order" into your code.

I'm hesitant to store things like quantities or prices in a dictionary in context, since I'm pretty sure all that will blow up the day after a split...

I do store weights of course, and stopped-out times etc. Oh well!

So the technical answer for modifying orders in Quantopian is "no"? No API to do it?