- ago
Using limit orders I face following problem at the moment:
My strategy buys 3 stocks in a certain period which derive from the transaction weight. WL8 does of course properly sort out the stocks that do not fit into my strategy (e.g. stocks that start the day with a big gap up and thus are not within the buying range). That's fine!
But what I see is that WL8 fills up the buying list (3 stocks) discretionary with the next stock based on the transaction weight that fits.

I'd rather like that WL8 does the backtesting without filling up, e.g. just buying 2 stocks if the third one does not start the day within the limit range.

What settings do I have to set in WL8 (preferences, etc.?) in order that the backtesting will work properly? Could you please help me?
0
535
Solved
17 Replies

Reply

Bookmark

Sort
Cone8
 ( 22.68% )
- ago
#1
The scenario and what "doesn't work properly" is not at all clear. Use a specific example. A minimal code example that targets a specific group of stocks with a defined date range would be best to show your case.
0
- ago
#2
Well, I am not using a coded strategy. I just use the strategy block "Buy at limit or stop" and set buy at limit 2,0% above close. It is difficult for me to display a specific situation but conceptionally following occurs:
WL8 suggests following stocks to be bought today according to my strategy and based on the transaction weight, e.g.:
Stock A
Stock B
Stock C
Stock D
...
Since my strategy stipulates that I should buy 3 stocks, I send market-on-open-orders for stock A, B and C to my broker. By end of the day I see that e.g. stock C was not bought since the stock opened with a gap-up of more than +2% to yesterdays closing price. So I have in fact only stocks A and B in my portfolio.
When doing a backtest, WL8 sorts out stock C as well, because of the gap-up. But buys stock D instead (since stock D starts trading within the limit).
It would be fine if WL8 also left out stock C and traded no other stock D instead. Thus, tomorrows positions list should just show 2 positions for today (i.e. stock A and B)
0
Glitch8
 ( 12.83% )
- ago
#3
WL8 assumes you’re placing all orders, for example using the Quotes tool to monitor and place orders when triggered. Nothing is “incorrect” here.

If you really only want to place 3 of the 4 orders, you need to do some sorting in PreExecute and then place only the top 3. instead of all the orders.

That’s what my “Deterministic Knife Juggler” on WealthSignals.com does.
0
Best Answer
- ago
#4
Thanks!
Well, I am not using the Quote monitor and I do not "send" the orders directly from WL8. I take the best ranked stocks from the WL8 signals list and create the orders manually in my trading software.
Nevertheless, is there still a possibility that WL8 will sort out not executed orders in the positions list?
0
Glitch8
 ( 12.83% )
- ago
#5
See Tactical Asset Rotation in the Sample Strategies folder.
0
- ago
#6
If you set the number 5 in the MaxEntrySignals field for the backtest, then five limit orders will be selected according to the weight (if it is set in the system) or randomly?
And another question. If, for example, there are only two free places in the portfolio, will five limit orders be placed anyway or two?

0
Cone8
 ( 22.68% )
- ago
#7
If there are at least n (5) entry Signals, then you'll see n (5) Signals. Don't read anything else into it.

If there are only 2 places in the Portfolio, then you can sort the Entry Signals by Weight and Place the 2 orders with the greatest weight.
0
- ago
#8
It's clear. But I was interested in how the backtest does it. Places orders according to weights or randomly, as well as on the second question.
0
Cone8
 ( 22.68% )
- ago
#9
Weights were created specifically to control backtests. It's well documented and we have several videos discussing them. If you don't assign weights, then the weights are assigned randomnly - that's why backtests may have random results.

You really don't need weights when trading because you can pick any indicator you want to use as your priority signal. If you want to trade like the backtest, use the same indicator as the one you're using for weights.
0
- ago
#10
I asked a question about weights regarding MaxEntrySignals. When this field contains the number 5, and the system issues 20 limit orders, will five orders be selected with the highest weight or randomly? Or will those who will be fulfilled on that day be chosen retrospectively? :)
0
Cone8
 ( 22.68% )
- ago
#11
Yes, this is part of the documentation of that feature.

0
- ago
#12
Understood thanks
0
- ago
#13
But still, something is wrong. For example, we get five signals to open positions on May 25th.





Now we are testing the system today and we see that on May 25, completely different positions were opened, and not those for which orders were placed.



That is, it turns out that in the backtest on limit orders, positions, nevertheless, are not opened by weight.



Just in case, here is the system on which it was tested



That is, it turns out that in the backtest on limit orders, positions, nevertheless, are not opened by weight
0
Glitch8
 ( 12.83% )
- ago
#14
I don’t think you’re loading enough data to even generate the indicator with a period of 252.

To check this look at the chart and see if you can see the indicator plotted. Make the start year 2021 to be safe.
0
- ago
#15
Yes, here is my mistake. But that doesn't change things. Anyway, in the new backtest (3 years), the positions are not the ones for which orders were placed:







0
Glitch8
 ( 12.83% )
- ago
#16
I was able to duplicate this and corrected it for Build 36, thanks for the report!
2

Reply

Bookmark

Sort