I have a problem: I need to use the PNL of a strategy into another strategy.
I don't need simply the last value (I managed to access that through a global variable), but I need the whole dataseries (i.e., the PNL of Strategy 1 day by day).
I read a lot the forum but couldn't find what I need, so I decided to take a stab at it and use a public DataSeries method.
It seemed fine, because I could access the DataSeries of Strategy 1 (Strategy1_PNL) into Strategy 2, but when I tried to run Strategy 2 I get no trades and the following error in the log: "Error on calling OnBarUpdate method: Strategy1: ADX[BarsAgo]; barsAgo out of valid range 0 through -2, was 0".
I don't really understand... I guess the DataSeries size doesn't match... so, the DataSeries are not synchronized? I don't understand this ADX[BarsAgo] message, since I'm not even using the ADX indicator in the strategy!
I know this is out of the scope of NT, I would just really appreciate if someone more knowledgeable could point me to the right direction.
Is there a way to fix this problem? Or should I try to go another way around?
Any help is greatly appreciated!
Thank you everyone!
Stefy
Comment