For the following strategy, with "Retain NSF Positions" it has a APR of 12.7% and without it the APR dropped to ~8%. List of trades are different.
I thought this option does not affect backtest result, am I wrong about this?

I thought this option does not affect backtest result, am I wrong about this?
Rename
The choice to Retain (or not) NSF Positions most often will definitely affect a Portfolio backtest.
In short, if you don't retain NSF, it allows a new positions to be created whenever there is available buying power because the backtest will be running the buying logic for any symbol not already held. That's opposed to "Retain NSF", which causes the backtest to run the buy/sell logic even if the position isn't part of the backtest results. In the latter scenario you'll actually get exit signals for [NSF] positions too.
In short, if you don't retain NSF, it allows a new positions to be created whenever there is available buying power because the backtest will be running the buying logic for any symbol not already held. That's opposed to "Retain NSF", which causes the backtest to run the buy/sell logic even if the position isn't part of the backtest results. In the latter scenario you'll actually get exit signals for [NSF] positions too.
@Cone:
I get the point that with "Retain NSF" there'll be NSF positions and signals, but my understanding is that those NSF positions are not actual positions show up in the backtest position list, and are not accounted when calculating backtest performance. So signals and NSF ratios will change but not other core metrics like CAGR?
From https://wealth-lab.com/Support/ApiReference/Backtester#NSFPositions:
NSFPositions
public PositionList NSFPositions
Returns a PositionList instance that contains Position instances representing the positions that were flagged as NSF (non-sufficient funds) and thus not included in the performance results. The Backtest still tracks these NSF positions during a backtest so the Strategy's integrity can be maintained. It also issues exit signals for NSF positions, since you might have initiated an entry into an NSF position in your live trading account, even if the Backtester did not have enough simulated capital to enter the trade.
I get the point that with "Retain NSF" there'll be NSF positions and signals, but my understanding is that those NSF positions are not actual positions show up in the backtest position list, and are not accounted when calculating backtest performance. So signals and NSF ratios will change but not other core metrics like CAGR?
From https://wealth-lab.com/Support/ApiReference/Backtester#NSFPositions:
NSFPositions
public PositionList NSFPositions
Returns a PositionList instance that contains Position instances representing the positions that were flagged as NSF (non-sufficient funds) and thus not included in the performance results. The Backtest still tracks these NSF positions during a backtest so the Strategy's integrity can be maintained. It also issues exit signals for NSF positions, since you might have initiated an entry into an NSF position in your live trading account, even if the Backtester did not have enough simulated capital to enter the trade.
You're understanding is correct, but you're missing the point about what happens when you don't retain NSF - a strategy that would have been holding a position no longer will be, so it can enter a new trade whenever the entry logic triggers.
I made a video demonstrating the difference many years ago - https://www.youtube.com/watch?v=HXA-AetQ3Jk&t=10s
I made a video demonstrating the difference many years ago - https://www.youtube.com/watch?v=HXA-AetQ3Jk&t=10s
Thanks Cone.
Just to make sure I understand this correctly: if “Retain NSF” is turned on, does an NSF position still count toward the max positions (when one is set) and potentially block a later entry that would otherwise be filled as an actual position when “Retain NSF” is off?
Just to make sure I understand this correctly: if “Retain NSF” is turned on, does an NSF position still count toward the max positions (when one is set) and potentially block a later entry that would otherwise be filled as an actual position when “Retain NSF” is off?
A NSF Position does not count towards Max Positions. A Position is marked NSF because there already other positions with higher weight; or that filled the N slots in Max Positions, if that's enabled.
Your Response
Post
Edit Post
Login is required