Profile Picture

keeping track of previous positions?

Posted By uaruss 7 Years Ago
Posted Sunday November 06 2011
I need the ability to keep track of the last position, no matter how long ago it was closed (basically, I want the system to wait "x" number of days before acting on a buy signal, if the last position was a short-sale). Anyone have any ideas? I imagine I could write the trades to a file and then read that on each "New Bar", but I was hoping for something a little easier.

Posted Tuesday November 08 2011
You can use position Manager to get a list of closed positions and then check the last trade to see if it was long or short.

You may need to go trough the list of trades in the last position to get trade direction and close date.

Posted Tuesday November 08 2011
Kaizen's answer is correct if you are running a historical simulation. In live mode I don't think the closed positions would currently be preserved between stopping and restarting the system.

Posted Wednesday November 09 2011
thanks guys. I used a public variable that seemed to work pretty well for me.

Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems