Position Options: Reject on Alerts
Author: Christos
Creation Date: 5/2/2012 9:12 AM
profile picture

Christos

#1
I thought that this position sizer was not taking any trades at all on bar+1 if the alerts on bar were greater or less than the specified number. However this does not seem to be the case after a few backtests I run. Since there is no documentation on this one besides WL Wiki (Reject a Position when candidate trade count (number of Alerts) is above or below some Alert cutoff threshold). The backtest I refer to is at portfolio level.

profile picture

Eugene

#2
PosSizers have a special property - CandidateCount - that returns a list of Position objects that represent the candidate Positions that are being sized on the current bar, at the point in time that the SizePosition method is being called.

Consequently, what this option does is reject a Position when this candidate trade count is above or below some specified cutoff.
profile picture

Christos

#3
I am afraid I cannot follow your explanation so I will attempt to form a simple example. Suppose that I have a dataset with 50 symbols. Out of these 50 symbols I get 1 alert for each symbol (50 alerts). All the alerts contain either limit or stop or market orders. In the Position sizer I have specified the alert cutoff at > 30 alerts. How many of the alerts will be rejected?

My guess would be all of them, correct?
profile picture

Eugene

#4
All of them, right - and it indeed will work in a historical backtest.

The reason it appears not working to you is the Candidates list actually being empty when it comes to Alert sizing. Please create a support ticket, because I think that Wealth-Lab not populating the Candidates collection in PosSizers at Bars.Count sounds like a bug to me.
profile picture

Christos

#5
What happens in my case is that not all but a portion of the trades done in the raw profit mode become trades in the portfolio simulation mode.

I will create a support ticket as you suggested.
profile picture

Eugene

#6
Currently, this bug (confirmed) makes the PosSizer always compare a threshold with 0 (rather than the actual Alerts count).
profile picture

wl64bit

#7
I would like to clarify. In my case, Reject on Alerts does not work properly.

If alerts are just Limit Orders, the Position Options takes into consideration just those alerts that have been "taken" the next day, but it does not take into consideration the number of Candidates from the previous day.
For example, if I set Reject on Alerts < 3, the Position Sizer will take trades only on those days, which at least 3 Limits were reached, but in the case if there were 10 Candidates and only 1 or 2 reached the limit the Position Sizer will not take any of those 2 trades, which is wrong, because there were 10 Alerts the day before.

Is it possible to fix it so Position Sizer looks on the Candidates but not on the actual trades that have been taken?
profile picture

Eugene

#8
There's nothing to fix in the PosSizer itself. A bug in 6.3 has been found and was reflected on the Open Issues list:

(62853) In PosSizers, the Candidates list is empty for Alert sizing

As I mentioned above, this bug prevents PosSizers from operating with Candidate trades correctly when it comes to sizing for Alerts (the historical trades aren't affected). Consequently, the PosSizer option will start working again by itself when the Wealth-Lab bug is fixed. At this time, ETA is not available but Fidelity is informed.
profile picture

Eugene

#9
UPDATE:
This bug will be fixed in WLD 6.9.24. No ETA at the moment as we're still trying to fix an issue with this build.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).