Profile Picture

PositionManager.Load() and PositionManager.Save()

Posted By diabolischGut 7 Years Ago
Message
Posted Wednesday October 13 2010
I found out that you have since Build23 implement 2 new methods in the PositionManager SaveOpenPositions() and LoadOpenPositions(). I tried the save method and it works fine. I also tried the load method but this does not seem to work. Is this function not implemented yet or do I something wrong?


Thanks in advance.

Edited: Wednesday October 13 2010 by diabolischGut
Posted Wednesday October 13 2010
These are methods used internally by RightEdge. They're not meant to be called from your trading system code.

Thanks,
Daniel
Posted Thursday October 14 2010
Would it be possible to use these functions. Because I need it for my optimizations to load Positions before the actual backtesting starts?

Edited: Thursday October 14 2010 by diabolischGut
Posted Thursday October 14 2010
These methods are called internally, so the only way you could circumvent this is to modify OpenPositions.xml yourself. It's pretty unlikely this will work as you expect though. We have a feature request in to have more control over open positions before a simulation or live system starts.

diabolischGut (10/14/2010)
Would it be possible to use these functions. Because I need it for my optimizations to load Positions before the actual backtesting starts?
Posted Thursday October 14 2010
I just wondered if it is possible to save the OpenPositions from a backtest let ' s say from 2000-2005. I the shutdown method I will save the OpenPositons. My Second backtest would be from 2005-2010 and in the startup method I want to load the OpenPositions. I try it but it does not work.


public override void Startup()
   {
PositionManager.LoadOpenPositions(@"C:\Test.xml");
}
   
   
   
   
   public override void Shutdown()
   {
PositionManager.SaveOpenPositions(@"C:\Test.xml");   
   }

Edited: Thursday October 14 2010 by diabolischGut
Posted Thursday October 14 2010
The reason calling LoadOpenPositions doesn't work is because it is a static method which doesn't modify anything about the PositionManager instance. It justs reads the data from the file and returns it as a PositionXml object. When RightEdge uses this method internally, it then goes through a lot of logic afterwards to set up the open positions.

It sounds like you may be trying to do a walk-forward optimization. In this thread I describe how you could do so.

Allowing you to set the open positions before starting an optimization run would make writing a walk-forward optimization plugin a lot easier. It's something we'd like to support in the future, but it won't necessarily be any time soon.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems