Historical Open Position vs. Current Open Position
Author: wcargill
Creation Date: 2/19/2009 9:19 AM
profile picture

wcargill

#1
I am trying to Drag and Drop to create an exit when a historical open position is 10 bars old and I have a current open position of the same security. I have tried to use the Position Based > Current Open Position is older than a number of bars - but this appears to use the current open position - am I doing something wrong? How can I set an exit for the historical position. In other words - opened a position 8 days ago - opened another position 3 days ago with same security - I want to set an exit to sell the position established 8 days ago when it is 10 days old. Any help would be most appreciated!
profile picture

Eugene

#2
That's right. If you look at the code generated by the Wizard for multiple open positions with "Current Open Position is older than a number of bars", we see references to LastPosition:

CODE:
Please log in to see this code.


If you substitute "LastPosition" with "p", the code will work as desired.
profile picture

wcargill

#3
Eugene - THANKS SO MUCH !!! I really appreciate your help!