Hi Eugene
I am trying to use a portfolio position count in a DataSeries using the following code:
CODE:
Please log in to see this code.
I cannot get around WL running on each Symbol and giving me the Symbol activeposition count as opposed to the portfolio active position count.
A laborious workaround that works is to use the following code to print to file and then export to a spreadsheet where I can manipulate to create portfolio active position count by bar.
CODE:
Please log in to see this code.
I'd very much appreciate if you can give me corrections to my code.
Thanks
Robin.
Size:
Color:
Hi Robin,
Why are you trying to put a portfolio Position count in a DataSeries i.e. what's the purpose?
Size:
Color:
Hi Eugene
I want to use it like a custom sentiment indicator
Size:
Color:
Thanks for the clarification. The thing is, WealthScript was not designed with this in mind i.e. giving you the portfolio active position count. To achieve this you'd have to rewrite your
entire Strategy code to run in Single Symbol mode so that it loops through
DataSetSymbols and
operates across the portfolio. Here's a good example:
Limit Monthly Drawdown / Portfolio Equity Tracker, posts #12 and #15.
Size:
Color:
Thanks Eugene
Got it!
Size:
Color:
You're welcome.
Size:
Color: