- ago
I'm doing a 2 week demo of Wealthlab for the first time. Really loving this software but finding the documentation a bit lacking/ambiguous when it comes to what parts of the UI mean.

I built a Building Blocks strategy. It has 2 Exit Signals declared in the Design Surface:
1) Sell at Market (with a condition)
2) Sell at ATR Stop (not a Trailing Stop)

The backtest Positions report Exit Signal column has 3 different **unique** signal names being displayed:
1) Sell at ATR Stop
2) Sell at Market (1)
3) Sell at Market (2)

Additional info:
In my Design Surface I have 2 Entry Signals:
1) Buy at Market (with multiple condition blocks)
2) Buy at Stop

What is the Exit Signal named "Sell at Market (2)" referring to in my Design Surface? is the (2) in the Sell at Market Exit Signal description simply saying this was the closing trade for the 2nd Buy Entry Signal? FWIW, if this is the case, this is confusing because I can clearly see that the Entry Signal used for the trade since it is in the adjacent Positions report column.
0
148
Solved
18 Answers

Reply

Bookmark

Sort
- ago
#1
QUOTE:
What is the Exit Signal named "Sell at Market (2)" referring to in my Design Surface?

This is a group code which indicates which order group is processed. In other words, "Sell at Market (1)" applies to the first group and "Sell at Market (2)" to the second.
0
- ago
#2
Thank you for this response.

Additional question for clarification: What do you mean when you say "order group"? Do you mean the Entry or Exit "order group" in your explanation?

Then why doesn't the "Sell At ATR Stop" Exit Signal description also append a (2) to the Exit Signal description? It seems like the description meaning should be consistent across all signal block types.

I really appreciate your response to this. Great user group here it sounds like.
0
- ago
#3
By order group I mean entry/exit blocks. There are two sell at market exits, the number (1) or (2) indicates the block (top to bottom).
0
Cone7
- ago
#4
Exits (could be more than 1) are paired with the entry directly above them. These combination create the "group".

2
- ago
#5
@Cone thanks! that answered another one of my questions about the definition of Groups and logic evaluation.

Out of simplicity I was creating my Building Blocks like this:

Entry Signal Block 1
Entry Signal Block 2
Entry Signal Block 3
Entry Signal Block 4

Exit Signal Block 1
Exit Signal Block 2

Where I understand that the Entry and Exit Signal Blocks like this are implicitly <OR>'ed with each other. And this works for me because I just want each of Exit Signal 1 <OR> 2 applied to ALL of the Entry Signals the same (Fully understanding that at any given time I will only be in a Single Trade since I have the radio button "Single Positions" selected)

0
Cone7
- ago
#6
That structure will not work. Each entry must be paired with one or more Exits.

The way to "OR" entries for the same order type is to use the Multi-Condition Group and drag multiple rules into it. There are options (see User Guide), but by setting only "1" condition need be true, you effectively have OR'd the conditions.


2
Best Answer
Cone7
- ago
#7
Here's an example. This strategy will buy at market when any one of the 3 multi conditions are true. Also, it will sell a long position at market when the RSI(20) < 30 or after 5 bars, whichever comes first.

1
- ago
#8
Thanks for this example!
I'm trying it out with some simple examples myself and the behavior is unexpected. It doesn't make sense to me as to why this simple setup results in 0 positions in SPY between 2010 - 2016 because it is pretty obviouse that there has been at least 1 time when the 1-month return of SPY > -5% or SPY made a new 42-day High.

Then,, if I change the Multi-condition N to be equal to 2 instead of 1, then it does in fact enter a position in SPY during this time frame. Since setting N=2 is effectively AND'ing these conditions it does not make sense to me that when N=1 that no Buy trade is made.






0
Cone7
- ago
#9
I agree with what you said, but there must be something else about the strategy that's causing it to happen. I checked the rules you're showing, and the combination does work for me.

The first place to start would be to check the Metrics Report for the "NSF Position Count". Click on metrics to pop up an explanation.
0
- ago
#10
Ok thanks. I disabled all the other blocks - so it's confusing.
Maybe some bug in how the tool manages disabled blocks or something. I will start a fresh Building Blocks document from scratch and try it.

Thanks for confirming on your end that it works for you!

0
- ago
#11
@Cone
I am able to reproduce this unexpected behavior with a simple setup as seen in these attached screenshots. If you then change the Multi-condition to be N=2 then you will see actual trades made during 2010-2015 timeframe as would have been expected when N=1 in the Multi-condition.

Even after inspecting the Chart with these condition indicators plotted on it I cannot for the life of me figure out what's going on :)

Thanks for investigating this!





0
- ago
#12
@Cone
I am able to reproduce this unexpected behavior with a simple setup as seen in these attached screenshots. If you then change the Multi-condition to be N=2 then you will see actual trades made during 2010-2015 timeframe as would have been expected when N=1 in the Multi-condition.

Even after inspecting the Chart with these condition indicators plotted on it I cannot for the life of me figure out what's going on :)

Thanks for investigating this!








***** UPDATE/EDIT **********
I composed another strategy in the tool breaking out the "OR" logic into separate Entry/Exit Groups and it works as expected. See below screenshots - so I am still confused by the underlying logic within the Multi-Condition block as see originally above.




0
Cone7
- ago
#13
The problem here is very subtle, but you didn't check NSF Positions like I asked ;)

You're using 100% sizing. If you "miss" a long trade because of a gap higher AND you "Retain NSF Positions", then the strategy is "long" [an NSF Position] until it exits it hypothetically. Since it's NSF, it's not used by the simulation.

There are several ways to get what you want here:
1. Use somewhat less than 100% Equity OR use a little bit of margin (1.05) so that if there's gap higher, the strategy is still able to put on a position, OR,
2. Change the Basis price to the next day's open. (See User Guide > Strategy > Strategy Settings > Basis Price), OR,
3. Uncheck "Retain NSF Position" so that the Strategy can enter on the next "non gap" opportunity with 100% sizing.
2
- ago
#14
Ugh... sorry about that. Geesh.. I definitely did not expect any NSF positions to even be recorded or considered in the logic evaluation given I selected the "Single Position" radio button. I couldn't find where all of the NSF positions are recorded (I figure they should be on a tab or somewhere to click on the Positions tab, but I can't find it and it would really nice to be able to see this as a list sortable by date, exportable to CSV, etc). Yes, I do see a value greater than 0 for NSF positions in the Metrics Report.

Thanks for explaining the nuances - definitely not an expected behavior from the perspective of a new user, but I totally understand it now. Thanks for your time explaining this.

When I select "Single Position" in the setup I only expect a single position to ever be taken and then when it is exited all logic is re-initiated without a queue of previous NSF positions to work through since they are not on my ledger of open PnL positions. Obviously, I'm just one guy with one opinion, and just my .02 (as someone whose been building quant strategies/trading for a couple decades at this point). I realize this could just be a personal preference or bias for simplicity though.

Now I know to simply uncheck the "Retain NSF Positions" checkbox.

Sorry for the confusion and not discovering this in the FAQ initially.

1
- ago
#15
Hi JTrader, WL’s backtesting engine simulates a real world scenario. So you can wind up with NSF positions even if the backtest is using only one symbol. It could happen when using a position size of 100% of equity. The number of shares to buy is based on the basis price, which is the closing price of the signal bar (unless changed.) So if prices gap up the simulated account wouldn’t have enough capital to take the trade. You can get around this the same way as you would in real world trading, use a small margin like 1.1:1 or a smaller position size.
1
- ago
#16
Thanks. This makes sense now given the backtester is based off of daily closing bar data and has to make the sizing decision on a closing bar rather than the execution bar that is an entire day away and it does not have the benefit of the minutely, for example, data required to make the sizing calculation at near execution time. (Unsure why it can't just do the sizing calculation when it sees the price for execution, even if the signal occurred on a price from previous close, but it's not that big of a deal in the grand scheme for the purposes of the strategies I will test on WL that have very low turnover and longer holding periods over many days/weeks.
0
- ago
#17
QUOTE:
This makes sense now given the backtester is based off of daily closing bar data and has to make the sizing decision on a closing bar rather than the execution bar

It can be adjusted to use the execution bar's open price in Strategy Settings > Position Sizing: "Basis Price". Not all brokers support this though.
2
- ago
#18
This is really cool - I guess I hadn't realized how easy it is to connect a broker and just turn on a live strategy and turn a backtested strategy into production - and now I fully understand the how/why behind the backtester settings and assumptions. I really only originally came to demo WL as a backtester. Very cool I could use it for trading live as well.
3

Reply

Bookmark

Sort