Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Referencing past trades in an algorithm.

Is there a method for referencing past trades?

I'd like to stop any new purchase orders for 60 minutes if my aglo executes a stop-loss order (i.e. sells at a loss on a downswing).

Thanks for any help!

2 responses

Last attempt before I bother support...

Are there any examples of how to access trade history?

Set a flag in your context to denote that you placed a stop-loss order.

For example,

    context.entered_stop_loss = True

You could also go farther with creating a Dictionary to hold both the security and if a stop loss has occurred.