Positions with Multi-Symbol
Author: gpetrie
Creation Date: 5/8/2009 10:10 AM
profile picture

gpetrie

#1
Let's say one uses SetContext to enter a long with a different symbol than the primary one. After the trade RestoreContext reverts to the original symbol. On subsequent bars, when accessing the position object, for example, IsLastPositionActive, do you need to SetContext to the symbol traded in order to find the Position object?

Thanks,

Gene
profile picture

Eugene

#2
Yes, you need to call SetContext after calling IsLastPositionActive to exit the right stock.
profile picture

Cone

#3
Eugene., can you check that? I don't think it's required since passing the Position object to the exit signal should be sufficient.
profile picture

Eugene

#4
You're right, removing the SetContext call doesn't seem to make a difference. Live and learn.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).