I am using Portfolio Trader w/ MultiCharts 9.1. I have developed a strategy that uses an "observer signal" to derive some information on the strategy position's trading performance in order to make portfolio decisions. The relevant code looks like this:
This code works like a charm in backtesting. During auto-trading, I am not seeing MaxPositionsAgo increase while plowing through the historic data and historic positions. This results in the money-management signal not having the information it needs to work properly.variables:
while(stats.LastPositionsAgo < MaxPositionsAgo) begin
var: thePos (0); thePos = MaxPositionsAgo - stats.LastPositionsAgo;
var: theEntry (0); theEntry = EntryPrice(thePos);
var: theExit (0); theExit = ExitPrice(thePos);
var: theDirection(0); theDirection = MarketPosition(thePos);
// derive some trading info here
Here are my questions:
* how is MaxPositionsAgo supposed to behave during auto-trading and for historic positions? Should it show historic positions, or only real trades?
* is there any other way I can retrieve historic position information during auto-trading?
* is there any elegant way to save data during backtesting and reload them during auto-trading?
Thanks a lot,