It might already be posted, however, I cant seem to find the solution... Can someone tell me how to get the TOTAL Active Position count. It seems the ActivePosition.Count property is the count per symbol.. I need to get the count across a DataSet.
Size:
Color:
It depends on how you code it and how you run it. For example, in a Rotational strategy ActivePositions.Count would represent the count across a DataSet.
The total active position count is available to PosSizers. Without using a PosSizer, you'll have to loop by DataSetSymbols to create a portfolio-level backtest in the manner of Symbol Rotation strategies, and run them in Single Symbol mode (the Strategy will do the portfolio backtest itself).
Size:
Color:
Eugene, Im running my script across a data set of symbols.
Im limiting the number of positions per symbol to 1 by the following line of code...
CODE:
Please log in to see this code.
But since Im running this across a dataset i want to find out the number of active positions current day across a dataset of symbols..
Size:
Color:
Across a DataSet by looping in your Strategy code (see above) or by making Wealth-Lab run a portfolio backtest? Anyway, please see my edited message above.
Size:
Color:
Im using portfolio backtest..
Ok.. I will take a look..
Thanks..
Size:
Color:
Hi Eugene,
Ive been trying to play around with the code to get it to work, however, Im getting mixed results. Below is the code Im trying.. Is this the correct way to get active positions in a portfolio?
CODE:
Please log in to see this code.
Size:
Color:
Almost, but you need to eliminate that IsLastPositionActive logic altogether. In a multi-position strategy, there's no need in logic applicable when working with single position.
Size:
Color:
ok thanks..
Size:
Color: