I am trying to find the smallest position (in number of shares) in ActivePositions. I am using Portfolio Sim mode because I am using SetShareSize. I tried Position.Shares and Position.Size properties but neither are valid in Portfolio mode. How to do this?
I am doing an pyramid algorithm and and am selecting which positions to close based on the size of the active positions. Also I am determining the size of new positions based on the size of current open positions.
Thanks,
Ron
Size:
Color:
Quoting the QuickRef: "
In portfolio simulation mode, all trades are pre-executed using 1 share per Position, and then position sizing is applied after the fact. So the Shares/Size property will always return 1 while the Strategy is executing."
You can approach what you want in PosSizer. Furthermore, pyramiding in a multi-symbol portfolio backtest mode
should be supported by PosSizer: e.g.
Pyramiding PosSizer. Otherwise you may get incorrect results because if Wealth-Lab skips the initial entry signal due to insufficient funds, your system will be entering pyramided trades like nothing happened.
Size:
Color:
I have read the web page for the Pyramiding PosSizer above and the WL UserGuide section on PosSizers. I found and downloaded
the attachment but it unzipped to a rather complex directory of files that I do not know what to do with. How do I install the Pyramiding PosSizer?
Related note: on the Pyramiding PosSizer web page, Figures 2 and 3 are reversed with respect to their references in the text.
Thanks,
Ron
Size:
Color:
You downloaded the project's source code from the Wiki, not knowing what to do with it. It's catered to developers only, and you have to know how to program in C# using Visual Studio or SharpDevelop in order to make any use of it. I suggested that you might need to develop your own custom PosSizer for that logic because you can not approach this in Strategy (for there's no access to the actual Shares value in portfolio simulation mode).
I'm not sure if the Pyramiding PosSizer is applicable to your task of
selecting which positions to close based on the size of the active positions. It was designed for well-known use cases such as upright, reverse pyramid etc. Still you might want to give it a shot. To install Extensions like
MS123 PosSizers (that includes the Pyramiding PosSizer), simply visit the Extensions section of this site. On how to install/uninstall/update Wealth-Lab extensions, review
this illustrated tutorial and/or check out the Wealth-Lab User Guide >
Extension Manager.
Size:
Color: