There seems to be something broken with the latest WL 8 Update (Build: 172).
Before the update each portfolio backtest run returns the same results.
After the update each run returns slightly different results.
I am using target limit orders:
ClosePosition(pos, OrderType.Limit, targetPrice);
Each trade has a clearly weight assigned.
May it has something to do with:
Can you please check this issue.
Before the update each portfolio backtest run returns the same results.
After the update each run returns slightly different results.
I am using target limit orders:
ClosePosition(pos, OrderType.Limit, targetPrice);
Each trade has a clearly weight assigned.
May it has something to do with:
QUOTE:
Changed Backtester SignalSorter to properly order random weights for multiple stop/limit Transactions on the same bar for the same-symbol.
Can you please check this issue.
Rename
If the strategy uses stop and limit exits, it's probably because there are some bars where both exits could have occurred and you have selected (by default) Preference > Backtest > Other Settings > Exit Prioritization > Neutral (Random) .
The change you suggested only affects stop and limit strategies with multiple same-symbol entries on the same bar... and it actually fixed the previous problem with that entry scenario that you're describing. (e.g., the backtester should always give more priority to BUY a higher limit price before a lower price.)
Anyway, let me know if "Exit Prioritization" is the reason (select Pessimistic, for example), and, if it's not, we'll take another look.
The change you suggested only affects stop and limit strategies with multiple same-symbol entries on the same bar... and it actually fixed the previous problem with that entry scenario that you're describing. (e.g., the backtester should always give more priority to BUY a higher limit price before a lower price.)
Anyway, let me know if "Exit Prioritization" is the reason (select Pessimistic, for example), and, if it's not, we'll take another look.
Also if you could email us the strategy to support@wealth-lab.com we can take a closer look.
@Cone
Shouldn't it be the other way (lower price has higher priority for BUY)?
And this only applies to limit orders that are not fillable at market open.
QUOTE:
the backtester should always give more priority to BUY a higher limit price before a lower price.
Shouldn't it be the other way (lower price has higher priority for BUY)?
And this only applies to limit orders that are not fillable at market open.
Why should it be the other way? When you try to explain it, you'll see why. But just take the simple example of buying 2 positions: 1% below today's close and 2% below today's close. If today's open is at [yesterday's] close, which order should fill first?
Remember, priority/weights only have context for Entry signals (Buy and Short). Exit signals will always fill in a backtest - no priority required.
Remember, priority/weights only have context for Entry signals (Buy and Short). Exit signals will always fill in a backtest - no priority required.
yes you are right. The closer one will be filled first.
Thanks for your response.
I did some quick tests.
It seems that the problem has nothing to do with limit orders.
I already have an issue on my trading signals.
So for example when I am using the following entry code for my portfolio backtest:
With the following strategy settings:
I got for example the following signals:
Shouldn't the signal with not NSF (so entry for today) should have a weight of "8.5415"?
Also the weight for the not NSF signal differs each run (seems to be a random between 0 and 1).
For signals that have no NSF equivalent the weight equals the defined priority.
I did some quick tests.
It seems that the problem has nothing to do with limit orders.
I already have an issue on my trading signals.
So for example when I am using the following entry code for my portfolio backtest:
CODE:
priority = 8.5415; var trade = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0, priority.ToString("N6")); trade.Weight = priority;
With the following strategy settings:
CODE:
Max Open Pos: 10 Max Open Per Symbol: 1
I got for example the following signals:
CODE:
NSF | Symbol | Action | Order Type | Weight ------------------------------------------- No | XYZ | Buy | Market | 0.5712 Yes | XYZ | Buy | Market | 7.4134
Shouldn't the signal with not NSF (so entry for today) should have a weight of "8.5415"?
Also the weight for the not NSF signal differs each run (seems to be a random between 0 and 1).
For signals that have no NSF equivalent the weight equals the defined priority.
Thanks for those details. The Market order weight should not change from what you had set.
We'll look into it and get to the bottom of it right away.
We'll look into it and get to the bottom of it right away.
I cannot duplicate what you're reporting. A critical detail must be missing, so I'm afraid you'll have to provide a strategy that actually makes this happen.
The only way I can get the random weight (a value between 0 and 1) is by not assigning the value as you have shown in your snippet. I'd urge you to first look for another Buy at Market signal in your code for which Transaction.Weight is not assigned.
The only way I can get the random weight (a value between 0 and 1) is by not assigning the value as you have shown in your snippet. I'd urge you to first look for another Buy at Market signal in your code for which Transaction.Weight is not assigned.
Your Response
Post
Edit Post
Login is required