In the ClearPostions() documentation in the Wealthscropt QuickRef it says
QUOTE:
Remarks
In Multi-Symbol Backtest mode, the ClearPositions method clear trades for all symbols in a DataSet. On the Trades list, only the last symbol's trades are left.
It is working by design of the new Wealth-Lab .NET, where all of the positions are stored in one list. That's why ClearPositions clears them all and does not work as expected in Multi-Symbol Backtest mode. This problem is under investigation.
I don't know when this was posted but is this issue still under investigation? The code allows for some interesting possibilities for backtests if multiple symbols could be run
Thanks for the update
Size:
Color:
I'm afraid we will have to live with this.
Size:
Color:
Ok, Thanks for the update.
Out of curiosity, is there any way to access the List of Positions within a strategy?
The syntax below is incorrect but could something like the psuedo code below work?
code the ExitSignal property with the string ">50%) and then
Positions.RemoveAll ( p => p.ExitSignal contains "<50%"); // eliminate all trades with this exit signal
Size:
Color:
But you're already accessing the List<Position> Positions, aren't you? Because the List of Positions is the List<Position> Positions.
Custom PosSizer is the straightforward way to filtering new entries by condition (e.g. exit signal) by virtue of assigning a zero size.
Size:
Color:
I'll check into the Custom PosSizer
Size:
Color:
Note that if you were asking for an alternative to ClearPositions(), it's not. You can not affect existing and/or closed positions with PosSizer, what you can do is rule out new positions on some portfolio-based condition (e.g. equity dipped below a moving average of portfolio equity).
Size:
Color:
Related to this, I' am curious whether there is a method or property that will let me know if the current run is part of a mult-symbol backtest or in single symbol mode. I've checked (unsuccessfully) on the forums and the quick reference guide
Thanks
Size:
Color:
Size:
Color:
Thank you
Size:
Color:
I created a variation on Cone's RSI Rotation Strategy using a custom-generated indicator that uses position data from another trading strategy (child strategy). I did it all under one Execute method, creating separate loops for the child strategy and the Rotation strategy, and I sync the bars by calculation.. Both strategies use the same symbols but different buying criteria.
It looks like I got it working except for one remaining issue: Since the custom indicator requires access to the positions from the child strategy, I have to keep them in place while executing the Rotation strategy (at least if I maintain the basic flow Cone created). At the end of running both strategies, positions from both strategies are mixed together with positions from both sorted by date. I would like to discard the positions from the child strategy and only keep the ones from the Rotator strategy, including performance stats, alerts, etc.
Is there a way to delete specific positions from the list of positions, e.g. by Entry Name? It doesn't appear that the ClearPositions() function has any overloads or options to do this. Or with code sorting through a Positions list? Is it possible to modify the Positions list this way? If not, can you suggest another potential approach to accomplish the goal of getting results from the Rotator strategy without keeping data from the child strategy? Previously I had used the (unsupported) donor strategy approach which somewhat isolates the two strategies and their performance results. Do you think that's best way to go or do you have some other ideas?
Size:
Color: